From 63ec848b380d3ac541a817e65fdc4cec416d6d34 Mon Sep 17 00:00:00 2001 From: Sanskar Jaiswal Date: Fri, 17 Nov 2023 18:03:56 +0530 Subject: [PATCH] controller: wait for canary deployment to be ready before removing finalizers Fix the waiting logic to actually wait for the canary deployment to be ready before continuing with the rest of the finalization logic. Previously, the canary deployment was not being checked for a ready status due to the the absence of the `Steps` field in the specified backoff. Signed-off-by: Sanskar Jaiswal --- pkg/controller/finalizer.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/controller/finalizer.go b/pkg/controller/finalizer.go index 9781b511c..57eee9a96 100644 --- a/pkg/controller/finalizer.go +++ b/pkg/controller/finalizer.go @@ -75,9 +75,10 @@ func (c *Controller) finalize(old interface{}) error { // Ensure that targetRef has met a ready state c.logger.Infof("Checking if canary is ready %s.%s", canary.Name, canary.Namespace) backoff := wait.Backoff{ - Duration: time.Second, + Duration: time.Second * 3, Factor: 2, Cap: canary.GetAnalysisInterval(), + Steps: 4, } retry.OnError(backoff, func(err error) bool { return err.Error() == "retriable error"