Skip to content

Commit

Permalink
promo controller bug fix
Browse files Browse the repository at this point in the history
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
  • Loading branch information
krancour committed Dec 5, 2024
1 parent 139c3de commit ca48855
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions internal/controller/promotions/promotions.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ func (r *reconciler) promote(
// examine the results of their own previous execution.
promoCtx.StartFromStep = 0
promoCtx.StepExecutionMetadata = nil
workingPromo.Status.HealthChecks = nil
} else if !os.IsExist(err) {
return nil, fmt.Errorf("error creating working directory: %w", err)
}
Expand All @@ -512,15 +513,14 @@ func (r *reconciler) promote(
workingPromo.Status.CurrentStep = res.CurrentStep
workingPromo.Status.StepExecutionMetadata = res.StepExecutionMetadata
workingPromo.Status.State = &apiextensionsv1.JSON{Raw: res.State.ToJSON()}
if res.Status == kargoapi.PromotionPhaseSucceeded {
var healthChecks []kargoapi.HealthCheckStep
for _, step := range res.HealthCheckSteps {
healthChecks = append(healthChecks, kargoapi.HealthCheckStep{
for _, step := range res.HealthCheckSteps {
workingPromo.Status.HealthChecks = append(
workingPromo.Status.HealthChecks,
kargoapi.HealthCheckStep{
Uses: step.Kind,
Config: &apiextensionsv1.JSON{Raw: step.Config.ToJSON()},
})
}
workingPromo.Status.HealthChecks = healthChecks
},
)
}
if err != nil {
workingPromo.Status.Phase = kargoapi.PromotionPhaseErrored
Expand Down

0 comments on commit ca48855

Please sign in to comment.