From 77b2eb36a5636a9c6a83e5061019e791995cc562 Mon Sep 17 00:00:00 2001 From: Ying Liu Date: Thu, 17 Mar 2022 10:49:30 +0800 Subject: [PATCH] ignore FailedCheck result when skipAnalysis defined and be honor to skipAnalysi when internal error happens Signed-off-by: Ying Liu --- pkg/controller/scheduler.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/controller/scheduler.go b/pkg/controller/scheduler.go index 7b52322f..8ec676b6 100644 --- a/pkg/controller/scheduler.go +++ b/pkg/controller/scheduler.go @@ -700,7 +700,7 @@ func (c *Controller) shouldSkipAnalysis(canary *flaggerv1.Canary, canaryControll } // regardless if analysis is being skipped, rollback if canary failed to progress - if !retriable || canary.Status.FailedChecks >= canary.GetAnalysisThreshold() { + if !retriable { c.recordEventWarningf(canary, "Rolling back %s.%s progress deadline exceeded %v", canary.Name, canary.Namespace, err) c.alert(canary, fmt.Sprintf("Progress deadline exceeded %v", err), false, flaggerv1.SeverityError) c.rollback(canary, canaryController, meshRouter) @@ -713,7 +713,7 @@ func (c *Controller) shouldSkipAnalysis(canary *flaggerv1.Canary, canaryControll canaryWeight := 0 if err := meshRouter.SetRoutes(canary, primaryWeight, canaryWeight, false); err != nil { c.recordEventWarningf(canary, "%v", err) - return false + return true } c.recorder.SetWeight(canary, primaryWeight, canaryWeight) @@ -722,19 +722,19 @@ func (c *Controller) shouldSkipAnalysis(canary *flaggerv1.Canary, canaryControll canary.Spec.TargetRef.Name, canary.Namespace, canary.Spec.TargetRef.Name, canary.Namespace) if err := canaryController.Promote(canary); err != nil { c.recordEventWarningf(canary, "%v", err) - return false + return true } // shutdown canary if err := canaryController.ScaleToZero(canary); err != nil { c.recordEventWarningf(canary, "%v", err) - return false + return true } // update status phase if err := canaryController.SetStatusPhase(canary, flaggerv1.CanaryPhaseSucceeded); err != nil { c.recordEventWarningf(canary, "%v", err) - return false + return true } // notify