From fff0b16446e76216fd79b93587968a450faf88b9 Mon Sep 17 00:00:00 2001 From: YZ775 Date: Wed, 23 Aug 2023 04:32:44 +0000 Subject: [PATCH] fix condition Signed-off-by: YZ775 --- e2e/lifecycle_test.go | 8 +++++++- e2e/upgrade_test.go | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/e2e/lifecycle_test.go b/e2e/lifecycle_test.go index 16ebe08ba..6692bd06e 100644 --- a/e2e/lifecycle_test.go +++ b/e2e/lifecycle_test.go @@ -49,7 +49,13 @@ var _ = Context("lifecycle", func() { if conditionHealthy == nil { return fmt.Errorf("cluster is not healthy") } - if conditionReconcileSuccess.Status != metav1.ConditionTrue && conditionStatefulSetReady.Status != metav1.ConditionTrue && conditionHealthy.Status != metav1.ConditionTrue { + if conditionReconcileSuccess.Status != metav1.ConditionTrue { + return fmt.Errorf("cluster is not ready") + } + if conditionStatefulSetReady.Status != metav1.ConditionTrue { + return fmt.Errorf("cluster is not ready") + } + if conditionHealthy.Status != metav1.ConditionTrue { return fmt.Errorf("cluster is not ready") } return nil diff --git a/e2e/upgrade_test.go b/e2e/upgrade_test.go index 5a4052e49..9fdd69285 100644 --- a/e2e/upgrade_test.go +++ b/e2e/upgrade_test.go @@ -153,7 +153,13 @@ var _ = Context("upgrade", func() { if conditionHealthy == nil { return fmt.Errorf("cluster is not healthy") } - if conditionReconcileSuccess.Status != metav1.ConditionTrue && conditionStatefulSetReady.Status != metav1.ConditionTrue && conditionHealthy.Status != metav1.ConditionTrue { + if conditionReconcileSuccess.Status != metav1.ConditionTrue { + return fmt.Errorf("cluster is not ready") + } + if conditionStatefulSetReady.Status != metav1.ConditionTrue { + return fmt.Errorf("cluster is not ready") + } + if conditionHealthy.Status != metav1.ConditionTrue { return fmt.Errorf("cluster is not ready") } return nil