@@ -122,6 +122,9 @@ func IsDistributedRedisClusterProperly(f *Framework, drc *redisv1alpha1.Distribu
122122 return err
123123 }
124124 if result .Status .Status != redisv1alpha1 .ClusterStatusOK {
125+ if result .Status .Status == redisv1alpha1 .ClusterStatusKO {
126+ f .Logf ("DistributedRedisCluster %s is %s, reason: %s" , drc .Name , result .Status .Status , result .Status .Reason )
127+ }
125128 return LogAndReturnErrorf ("DistributedRedisCluster %s status not healthy, current: %s" , drc .Name , result .Status .Status )
126129 }
127130 stsList , err := f .GetDRCStatefulSetByLabels (getLabels (drc ))
@@ -177,6 +180,7 @@ func IsDistributedRedisClusterProperly(f *Framework, drc *redisv1alpha1.Distribu
177180 }
178181 }
179182
183+ drc .Spec = result .Spec
180184 return nil
181185 }
182186}
@@ -299,6 +303,21 @@ func DeleteMasterPodForDRC(drc *redisv1alpha1.DistributedRedisCluster, client cl
299303 }
300304}
301305
306+ func IsDRCPodBeDeleted (f * Framework , drc * redisv1alpha1.DistributedRedisCluster ) func () error {
307+ return func () error {
308+ stsList , err := f .GetDRCStatefulSetByLabels (getLabels (drc ))
309+ if err != nil {
310+ return LogAndReturnErrorf ("GetDRCStatefulSetByLabels err: %s" , err )
311+ }
312+ for _ , sts := range stsList .Items {
313+ if sts .Status .ReadyReplicas != (drc .Spec .ClusterReplicas + 1 ) {
314+ return nil
315+ }
316+ }
317+ return LogAndReturnErrorf ("StatefulSet's Pod still running" )
318+ }
319+ }
320+
302321func NewRedisClusterBackup (name , namespace , image , drcName , storageSecretName , s3Endpoint , s3Bucket string ) * redisv1alpha1.RedisClusterBackup {
303322 return & redisv1alpha1.RedisClusterBackup {
304323 ObjectMeta : metav1.ObjectMeta {
0 commit comments