Skip to content

Commit

Permalink
fix: canary step analysis run wasn't terminated as keep running after…
Browse files Browse the repository at this point in the history
… promote action being called
  • Loading branch information
oleksandr-codefresh committed Dec 6, 2023
1 parent d378ce7 commit 758b6de
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rollout/analysis.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,10 @@ func (c *rolloutContext) reconcileStepBasedAnalysisRun() (*v1alpha1.AnalysisRun,
return currentAr, nil
}

if step == nil || step.Analysis == nil || index == nil {
// for promotion cases
analysisRunFromPreviousStep := step != nil && step.Analysis != nil && currentAr != nil && currentAr.GetLabels()[v1alpha1.RolloutCanaryStepIndexLabel] != strconv.Itoa(int(*index))

if step == nil || step.Analysis == nil || index == nil || analysisRunFromPreviousStep {
err := c.cancelAnalysisRuns([]*v1alpha1.AnalysisRun{currentAr})
return nil, err
}
Expand Down

0 comments on commit 758b6de

Please sign in to comment.