From a9e883c97d22c0ba1a763b7d6c7eb73a3a5feedf Mon Sep 17 00:00:00 2001 From: Kamil Sambor Date: Fri, 26 Jul 2024 14:22:07 +0200 Subject: [PATCH] Align restore LastTransitionTime with nova-operator --- controllers/placementapi_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/placementapi_controller.go b/controllers/placementapi_controller.go index e62af68..d2368d0 100644 --- a/controllers/placementapi_controller.go +++ b/controllers/placementapi_controller.go @@ -221,7 +221,6 @@ func (r *PlacementAPIReconciler) Reconcile(ctx context.Context, req ctrl.Request // Always patch the instance status when exiting this function so we can persist any changes. defer func() { - condition.RestoreLastTransitionTimes(&instance.Status.Conditions, savedConditions) // update the Ready condition based on the sub conditions if instance.Status.Conditions.AllSubConditionIsTrue() { instance.Status.Conditions.MarkTrue( @@ -234,6 +233,7 @@ func (r *PlacementAPIReconciler) Reconcile(ctx context.Context, req ctrl.Request instance.Status.Conditions.Set( instance.Status.Conditions.Mirror(condition.ReadyCondition)) } + condition.RestoreLastTransitionTimes(&instance.Status.Conditions, savedConditions) err := h.PatchInstance(ctx, instance) if err != nil { _err = err