From 649b1dedb008766c9a047db7996457634a52f378 Mon Sep 17 00:00:00 2001 From: Nir Soffer Date: Wed, 6 Nov 2024 19:03:07 +0200 Subject: [PATCH] Add .Message to VR conditions Based on the messages addded in https://github.com/csi-addons/kubernetes-csi-addons/pull/691. We want to propagate the error messages to the protected pvcs conditions. Signed-off-by: Nir Soffer --- internal/controller/vrg_volrep_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/controller/vrg_volrep_test.go b/internal/controller/vrg_volrep_test.go index a7138e736..83138d0f5 100644 --- a/internal/controller/vrg_volrep_test.go +++ b/internal/controller/vrg_volrep_test.go @@ -2368,7 +2368,7 @@ func (v *vrgTest) promoteVolRepsAndDo(options promoteOptions, do func(int, int)) if options.ValidatedFailed { volRepStatus.State = volrep.UnknownState - volRepStatus.Message = "precondition failed ..." + volRepStatus.Message = "failed to meet prerequisite: details..." } volRep.Status = volRepStatus @@ -2411,11 +2411,13 @@ func (v *vrgTest) generateVRConditions(generation int64, options promoteOptions) ObservedGeneration: generation, Status: metav1.ConditionTrue, LastTransitionTime: lastTransitionTime, + Message: "volume is validated", } if options.ValidatedFailed { validated.Status = metav1.ConditionFalse validated.Reason = volrep.PrerequisiteNotMet + validated.Message = "failed to meet prerequisite: details..." } conditions = append(conditions, validated) @@ -2427,11 +2429,13 @@ func (v *vrgTest) generateVRConditions(generation int64, options promoteOptions) ObservedGeneration: generation, Status: metav1.ConditionTrue, LastTransitionTime: lastTransitionTime, + Message: "volume is completed", } if options.ValidatedFailed { completed.Status = metav1.ConditionFalse completed.Reason = volrep.FailedToPromote + completed.Message = "failed to promote" } degraded := metav1.Condition{ @@ -2440,6 +2444,7 @@ func (v *vrgTest) generateVRConditions(generation int64, options promoteOptions) ObservedGeneration: generation, Status: metav1.ConditionFalse, LastTransitionTime: lastTransitionTime, + Message: "volume is healthy", } resyncing := metav1.Condition{ Type: volrep.ConditionResyncing, @@ -2447,6 +2452,7 @@ func (v *vrgTest) generateVRConditions(generation int64, options promoteOptions) ObservedGeneration: generation, Status: metav1.ConditionFalse, LastTransitionTime: lastTransitionTime, + Message: "volume is not resyncing", } return append(conditions, completed, degraded, resyncing)