mirror of
https://github.com/fluxcd/flagger.git
synced 2026-04-15 06:57:34 +00:00
Merge pull request #1139 from cdlliuy/ying_short_metric_analysis_waiting_promption
shorten the metric analysis cycle after confirm promotion gate is open
This commit is contained in:
@@ -158,6 +158,9 @@ func setStatusPhase(flaggerClient clientset.Interface, cd *flaggerv1.Canary, pha
|
||||
if phase != flaggerv1.CanaryPhaseProgressing && phase != flaggerv1.CanaryPhaseWaiting {
|
||||
cdCopy.Status.CanaryWeight = 0
|
||||
cdCopy.Status.Iterations = 0
|
||||
if phase == flaggerv1.CanaryPhaseWaitingPromotion {
|
||||
cdCopy.Status.Iterations = cd.GetAnalysis().Iterations - 1
|
||||
}
|
||||
}
|
||||
|
||||
// on promotion set primary spec hash
|
||||
|
||||
@@ -347,7 +347,7 @@ func (c *Controller) advanceCanary(name string, namespace string) {
|
||||
}
|
||||
|
||||
// check if the number of failed checks reached the threshold
|
||||
if cd.Status.Phase == flaggerv1.CanaryPhaseProgressing &&
|
||||
if (cd.Status.Phase == flaggerv1.CanaryPhaseProgressing || cd.Status.Phase == flaggerv1.CanaryPhaseWaitingPromotion) &&
|
||||
(!retriable || cd.Status.FailedChecks >= cd.GetAnalysisThreshold()) {
|
||||
if !retriable {
|
||||
c.recordEventWarningf(cd, "Rolling back %s.%s progress deadline exceeded %v",
|
||||
|
||||
@@ -90,6 +90,10 @@ func (c *Controller) runConfirmPromotionHooks(canary *flaggerv1.Canary, canaryCo
|
||||
if !webhook.MuteAlert {
|
||||
c.alert(canary, "Canary promotion is waiting for approval.", false, flaggerv1.SeverityWarn)
|
||||
}
|
||||
} else {
|
||||
if err := canaryController.SetStatusIterations(canary, canary.GetAnalysis().Iterations-1); err != nil {
|
||||
c.recordEventWarningf(canary, "%v", err)
|
||||
}
|
||||
}
|
||||
return false
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user