Skip to content

Commit 586281b

Browse files
committed
Add .Message to VR conditions
Based on the messages addded in csi-addons/kubernetes-csi-addons#691. We want to propagate the error messages to the protected pvcs conditions. Signed-off-by: Nir Soffer <[email protected]>
1 parent 91ebbd2 commit 586281b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

internal/controller/vrg_volrep_test.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -2368,7 +2368,7 @@ func (v *vrgTest) promoteVolRepsAndDo(options promoteOptions, do func(int, int))
23682368

23692369
if options.ValidatedFailed {
23702370
volRepStatus.State = volrep.UnknownState
2371-
volRepStatus.Message = "precondition failed ..."
2371+
volRepStatus.Message = "failed to meet prerequisite: details..."
23722372
}
23732373

23742374
volRep.Status = volRepStatus
@@ -2411,11 +2411,13 @@ func (v *vrgTest) generateVRConditions(generation int64, options promoteOptions)
24112411
ObservedGeneration: generation,
24122412
Status: metav1.ConditionTrue,
24132413
LastTransitionTime: lastTransitionTime,
2414+
Message: "volume is validated",
24142415
}
24152416

24162417
if options.ValidatedFailed {
24172418
validated.Status = metav1.ConditionFalse
24182419
validated.Reason = volrep.PrerequisiteNotMet
2420+
validated.Message = "failed to meet prerequisite: details..."
24192421
}
24202422

24212423
conditions = append(conditions, validated)
@@ -2427,11 +2429,13 @@ func (v *vrgTest) generateVRConditions(generation int64, options promoteOptions)
24272429
ObservedGeneration: generation,
24282430
Status: metav1.ConditionTrue,
24292431
LastTransitionTime: lastTransitionTime,
2432+
Message: "volume is completed",
24302433
}
24312434

24322435
if options.ValidatedFailed {
24332436
completed.Status = metav1.ConditionFalse
24342437
completed.Reason = volrep.FailedToPromote
2438+
completed.Message = "failed to promote"
24352439
}
24362440

24372441
degraded := metav1.Condition{
@@ -2440,13 +2444,15 @@ func (v *vrgTest) generateVRConditions(generation int64, options promoteOptions)
24402444
ObservedGeneration: generation,
24412445
Status: metav1.ConditionFalse,
24422446
LastTransitionTime: lastTransitionTime,
2447+
Message: "volume is healthy",
24432448
}
24442449
resyncing := metav1.Condition{
24452450
Type: volrep.ConditionResyncing,
24462451
Reason: volrep.NotResyncing,
24472452
ObservedGeneration: generation,
24482453
Status: metav1.ConditionFalse,
24492454
LastTransitionTime: lastTransitionTime,
2455+
Message: "volume is not resyncing",
24502456
}
24512457

24522458
return append(conditions, completed, degraded, resyncing)

0 commit comments

Comments
 (0)