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 committed Nov 10, 2024
1 parent 78d25e6 commit 91ebbd2
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 91ebbd2

Please sign in to comment.