Skip to content

Commit

Permalink
Fix default Validated condition
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
nirs authored and ShyamsundarR committed Nov 16, 2024
1 parent 4db50c6 commit c77e8ae
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/controller/vrg_volrep_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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,
}

Expand Down

0 comments on commit c77e8ae

Please sign in to comment.