Skip to content

Commit

Permalink
corresponding promotion reconciler changes
Browse files Browse the repository at this point in the history
Signed-off-by: Kent Rancourt <[email protected]>
  • Loading branch information
krancour committed Sep 22, 2024
1 parent 8792a33 commit 64fea20
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions internal/controller/promotions/promotions.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,12 +515,12 @@ func (r *reconciler) promote(
}
} else {
// If the Promotion has steps, execute them in sequence.
var steps []directives.Step
var steps []directives.PromotionStep

Check warning on line 518 in internal/controller/promotions/promotions.go

View check run for this annotation

Codecov / codecov/patch

internal/controller/promotions/promotions.go#L518

Added line #L518 was not covered by tests
for _, step := range workingPromo.Spec.Steps {
steps = append(steps, directives.Step{
Directive: step.Step,
Alias: step.As,
Config: step.GetConfig(),
steps = append(steps, directives.PromotionStep{
Kind: step.Step,
Alias: step.As,
Config: step.GetConfig(),

Check warning on line 523 in internal/controller/promotions/promotions.go

View check run for this annotation

Codecov / codecov/patch

internal/controller/promotions/promotions.go#L520-L523

Added lines #L520 - L523 were not covered by tests
})
}

Expand All @@ -536,19 +536,19 @@ func (r *reconciler) promote(
}
}()

status, err := r.directivesEngine.Execute(ctx, directives.PromotionContext{
res, err := r.directivesEngine.Promote(ctx, directives.PromotionContext{

Check warning on line 539 in internal/controller/promotions/promotions.go

View check run for this annotation

Codecov / codecov/patch

internal/controller/promotions/promotions.go#L539

Added line #L539 was not covered by tests
WorkDir: workDir,
Project: stageNamespace,
Stage: stageName,
FreightRequests: stage.Spec.RequestedFreight,
Freight: *workingPromo.Status.FreightCollection.DeepCopy(),
}, steps)
switch status {
case directives.StatusPending:
switch res.Status {
case directives.PromotionStatusPending:

Check warning on line 547 in internal/controller/promotions/promotions.go

View check run for this annotation

Codecov / codecov/patch

internal/controller/promotions/promotions.go#L546-L547

Added lines #L546 - L547 were not covered by tests
workingPromo.Status.Phase = kargoapi.PromotionPhaseRunning
case directives.StatusSuccess:
case directives.PromotionStatusSuccess:

Check warning on line 549 in internal/controller/promotions/promotions.go

View check run for this annotation

Codecov / codecov/patch

internal/controller/promotions/promotions.go#L549

Added line #L549 was not covered by tests
workingPromo.Status.Phase = kargoapi.PromotionPhaseSucceeded
case directives.StatusFailure:
case directives.PromotionStatusFailure:

Check warning on line 551 in internal/controller/promotions/promotions.go

View check run for this annotation

Codecov / codecov/patch

internal/controller/promotions/promotions.go#L551

Added line #L551 was not covered by tests
workingPromo.Status.Phase = kargoapi.PromotionPhaseFailed
}
if err != nil {
Expand Down

0 comments on commit 64fea20

Please sign in to comment.