Documentation ¶
Index ¶
- Constants
- func ChangeDRCRedisConfig(drc *redisv1alpha1.DistributedRedisCluster)
- func DeleteMasterPodForDRC(drc *redisv1alpha1.DistributedRedisCluster, client client.Client)
- func Failf(format string, args ...interface{})
- func IsDBSizeConsistent(originalDBSize int64, goredis *GoRedis) error
- func IsDRCPodBeDeleted(f *Framework, drc *redisv1alpha1.DistributedRedisCluster) func() error
- func IsDistributedRedisClusterProperly(f *Framework, drc *redisv1alpha1.DistributedRedisCluster) func() error
- func IsRedisClusterBackupProperly(f *Framework, drcb *redisv1alpha1.RedisClusterBackup) func() error
- func LogAndReturnErrorf(format string, args ...interface{}) error
- func Logf(format string, args ...interface{})
- func NewDistributedRedisCluster(name, namespace, image, passwordName string, masterSize, clusterReplicas int32) *redisv1alpha1.DistributedRedisCluster
- func NewRedisAdmin(pods []corev1.Pod, password string, cfg *config.Redis, reqLogger logr.Logger) (redisutil.IAdmin, error)
- func NewRedisClusterBackup(...) *redisv1alpha1.RedisClusterBackup
- func RandString(n int) string
- func ResetPassword(drc *redisv1alpha1.DistributedRedisCluster, passwordSecret string)
- func RestoreDRC(drc *redisv1alpha1.DistributedRedisCluster, ...) *redisv1alpha1.DistributedRedisCluster
- func RollingUpdateDRC(drc *redisv1alpha1.DistributedRedisCluster)
- func ScaleUPDRC(drc *redisv1alpha1.DistributedRedisCluster)
- func ScaleUPDown(drc *redisv1alpha1.DistributedRedisCluster)
- type Framework
- func (f *Framework) AfterEach() error
- func (f *Framework) BeforeEach() error
- func (f *Framework) CreateRedisCluster(instance *redisv1alpha1.DistributedRedisCluster) error
- func (f *Framework) CreateRedisClusterBackup(instance *redisv1alpha1.RedisClusterBackup) error
- func (f *Framework) CreateRedisClusterPassword(name, password string) error
- func (f *Framework) CreateS3Secret(id, key string) error
- func (f *Framework) DeleteRedisCluster(instance *redisv1alpha1.DistributedRedisCluster) error
- func (f *Framework) Failf(format string, a ...interface{})
- func (f *Framework) GetDRCPodsByLabels(labels map[string]string) (*corev1.PodList, error)
- func (f *Framework) GetDRCStatefulSetByLabels(labels map[string]string) (*appsv1.StatefulSetList, error)
- func (f *Framework) Logf(format string, a ...interface{})
- func (f *Framework) Namespace() string
- func (f *Framework) NewPasswordName() string
- func (f *Framework) PasswordName() string
- func (f *Framework) S3SecretName() string
- func (f *Framework) UpdateRedisCluster(instance *redisv1alpha1.DistributedRedisCluster) error
- type GoRedis
Constants ¶
const ( Redis3_1_12 = "uhub.service.ucloud.cn/operator/redis:3.2.12-alpine" Redis4_0_14 = "uhub.service.ucloud.cn/operator/redis:4.0.14-alpine" Redis5_0_4 = "uhub.service.ucloud.cn/operator/redis:5.0.4-alpine" Redis5_0_6 = "uhub.service.ucloud.cn/operator/redis:5.0.6-alpine" BackupImage = "uhub.service.ucloud.cn/operator/redis-tools:5.0.4" S3ID = "AWS_ACCESS_KEY_ID" S3KEY = "AWS_SECRET_ACCESS_KEY" S3ENDPOINT = "S3_ENDPOINT" S3BUCKET = "S3_BUCKET" // RedisRenameCommandsDefaultPath default path to volume storing rename commands RedisRenameCommandsDefaultPath = "/etc/secret-volume" // RedisRenameCommandsDefaultFile default file name containing rename commands RedisRenameCommandsDefaultFile = "" )
Variables ¶
This section is empty.
Functions ¶
func ChangeDRCRedisConfig ¶
func ChangeDRCRedisConfig(drc *redisv1alpha1.DistributedRedisCluster)
func DeleteMasterPodForDRC ¶
func DeleteMasterPodForDRC(drc *redisv1alpha1.DistributedRedisCluster, client client.Client)
func Failf ¶
func Failf(format string, args ...interface{})
Failf reports a failure in the current e2e
func IsDBSizeConsistent ¶
func IsDRCPodBeDeleted ¶
func IsDRCPodBeDeleted(f *Framework, drc *redisv1alpha1.DistributedRedisCluster) func() error
func IsDistributedRedisClusterProperly ¶
func IsDistributedRedisClusterProperly(f *Framework, drc *redisv1alpha1.DistributedRedisCluster) func() error
func IsRedisClusterBackupProperly ¶
func IsRedisClusterBackupProperly(f *Framework, drcb *redisv1alpha1.RedisClusterBackup) func() error
func LogAndReturnErrorf ¶
LogAndReturnErrorf logs and return an error
func NewDistributedRedisCluster ¶
func NewDistributedRedisCluster(name, namespace, image, passwordName string, masterSize, clusterReplicas int32) *redisv1alpha1.DistributedRedisCluster
func NewRedisAdmin ¶
func NewRedisAdmin(pods []corev1.Pod, password string, cfg *config.Redis, reqLogger logr.Logger) (redisutil.IAdmin, error)
NewRedisAdmin builds and returns new redis.Admin from the list of pods
func NewRedisClusterBackup ¶
func NewRedisClusterBackup(name, namespace, image, drcName, storageSecretName, s3Endpoint, s3Bucket string) *redisv1alpha1.RedisClusterBackup
func ResetPassword ¶
func ResetPassword(drc *redisv1alpha1.DistributedRedisCluster, passwordSecret string)
func RestoreDRC ¶
func RestoreDRC(drc *redisv1alpha1.DistributedRedisCluster, drcb *redisv1alpha1.RedisClusterBackup) *redisv1alpha1.DistributedRedisCluster
func RollingUpdateDRC ¶
func RollingUpdateDRC(drc *redisv1alpha1.DistributedRedisCluster)
func ScaleUPDRC ¶
func ScaleUPDRC(drc *redisv1alpha1.DistributedRedisCluster)
func ScaleUPDown ¶
func ScaleUPDown(drc *redisv1alpha1.DistributedRedisCluster)
Types ¶
type Framework ¶
type Framework struct { KubeConfig *rest.Config Client client.Client // contains filtered or unexported fields }
func NewFramework ¶
NewFramework create a new Framework with name
func (*Framework) BeforeEach ¶
BeforeEach runs before each test
func (*Framework) CreateRedisCluster ¶
func (f *Framework) CreateRedisCluster(instance *redisv1alpha1.DistributedRedisCluster) error
CreateRedisCluster creates a DistributedRedisCluster in test namespace
func (*Framework) CreateRedisClusterBackup ¶
func (f *Framework) CreateRedisClusterBackup(instance *redisv1alpha1.RedisClusterBackup) error
CreateRedisClusterBackup creates a RedisClusterBackup in test namespace
func (*Framework) CreateRedisClusterPassword ¶
CreateRedisClusterPassword creates a password for DistributedRedisCluster
func (*Framework) CreateS3Secret ¶
CreateS3Secret creates a secret for RedisClusterBackup
func (*Framework) DeleteRedisCluster ¶
func (f *Framework) DeleteRedisCluster(instance *redisv1alpha1.DistributedRedisCluster) error
DeleteRedisCluster delete a DistributedRedisCluster in test namespace
func (*Framework) GetDRCPodsByLabels ¶
func (*Framework) GetDRCStatefulSetByLabels ¶
func (*Framework) NewPasswordName ¶
func (*Framework) PasswordName ¶
func (*Framework) S3SecretName ¶
func (*Framework) UpdateRedisCluster ¶
func (f *Framework) UpdateRedisCluster(instance *redisv1alpha1.DistributedRedisCluster) error
UpdateRedisCluster update a DistributedRedisCluster in test namespace
type GoRedis ¶
type GoRedis struct {
// contains filtered or unexported fields
}
GoRedis contains ClusterClient.
func NewGoRedis ¶
NewGoRedis return a new ClusterClient.
func NewGoRedisClient ¶
func (*GoRedis) StuffingData ¶
StuffingData filled with (round * n)'s key.