From 91ebbd24fcffac92ce6ec3d7cc3c0728d158483b Mon Sep 17 00:00:00 2001 From: Nir Soffer Date: Wed, 6 Nov 2024 18:57:56 +0200 Subject: [PATCH] Fix default Validated condition It was added in failed state (Status=False, Reason=PrerequisiteNotMet) by default which is wrong. The issue was hidden since we check the condition only when deleting the VRG. We want to inspect the condition when the when the VRG is live, so we can report the condition status in the protected pvcs conditions. Signed-off-by: Nir Soffer --- internal/controller/vrg_volrep_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/controller/vrg_volrep_test.go b/internal/controller/vrg_volrep_test.go index d428e1f83..a7138e736 100644 --- a/internal/controller/vrg_volrep_test.go +++ b/internal/controller/vrg_volrep_test.go @@ -2388,6 +2388,9 @@ func (v *vrgTest) promoteVolRepsAndDo(options promoteOptions, do func(int, int)) v.waitForVolRepCondition(volrepKey, volrep.ConditionValidated, metav1.ConditionFalse) } } else { + if !options.ValidatedMissing { + v.waitForVolRepCondition(volrepKey, volrep.ConditionValidated, metav1.ConditionTrue) + } v.waitForVolRepCondition(volrepKey, volrep.ConditionCompleted, metav1.ConditionTrue) v.waitForProtectedPVCs(volrepKey) } @@ -2404,9 +2407,9 @@ func (v *vrgTest) generateVRConditions(generation int64, options promoteOptions) if !options.ValidatedMissing { validated := metav1.Condition{ Type: volrep.ConditionValidated, - Reason: volrep.PrerequisiteNotMet, + Reason: volrep.PrerequisiteMet, ObservedGeneration: generation, - Status: metav1.ConditionFalse, + Status: metav1.ConditionTrue, LastTransitionTime: lastTransitionTime, }