func (redis *RedisReconciler) generateRedisSecret() *corev1.Secret {
	passStr := common.RandomString(8, "a")
	return &corev1.Secret{
		ObjectMeta: metav1.ObjectMeta{
			Name:      redis.HarborCluster.Name,
			Namespace: redis.HarborCluster.Namespace,
			Labels:    redis.Labels,
		},
		StringData: map[string]string{
			"password": passStr,
		},
	}
}
generateRedisSecret returns redis password secret
package cache
import (
	"fmt"
	"github.com/goharbor/harbor-cluster-operator/controllers/common"
	redisCli "github.com/spotahome/redis-operator/api/redisfailover/v1"
	corev1 "k8s.io/api/core/v1"
	"k8s.io/apimachinery/pkg/api/resource"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/util/intstr"
)
var (
	redisFailoversGVR = redisCli.SchemeGroupVersion.WithResource(redisCli.RFNamePlural)
)
func (redis *RedisReconciler) generateRedisCR() (*unstructured.Unstructured, error) {
	redisResource := redis.GetRedisResource()
	redisRep := redis.GetRedisServerReplica()
	sentinelRep := redis.GetRedisSentinelReplica()
	storageSize := redis.GetRedisStorageSize()
	conf := &redisCli.RedisFailover{
		TypeMeta: v1.TypeMeta{
			Kind:       "RedisFailover",
			APIVersion: "databases.spotahome.com/v1",
		},
		ObjectMeta: v1.ObjectMeta{
			Name:      redis.HarborCluster.Name,
			Namespace: redis.HarborCluster.Namespace,
			Labels:    redis.Labels,
		},
		Spec: redisCli.RedisFailoverSpec{
			Redis: redisCli.RedisSettings{
				Replicas: redisRep,
				Resources: corev1.ResourceRequirements{
					Requests: redisResource,
					Limits:   redisResource,
				},
			},
			Sentinel: redisCli.SentinelSettings{
				Replicas: sentinelRep,
				Resources: corev1.ResourceRequirements{
					Requests: redisResource,
					Limits:   redisResource,
				},
			},
			Auth: redisCli.AuthSettings{SecretPath: redis.HarborCluster.Name},
		},
	}
	conf.Spec.Redis.Storage.PersistentVolumeClaim = redis.generateRedisStorage(storageSize, redis.HarborCluster.Name)
	mapResult, err := runtime.DefaultUnstructuredConverter.ToUnstructured(conf)
	if err != nil {
		return nil, err
	}
	data := unstructured.Unstructured{Object: mapResult}
	return &data, nil
}