Skip to content

Commit

Permalink
update freight after invoke promoMechanism
Browse files Browse the repository at this point in the history
Signed-off-by: Phuong D. Nguyen <knowledge.phuongnguyen@gmail.com>
  • Loading branch information
phuongdnguyen authored and hiddeco committed Apr 22, 2024
1 parent a79a28f commit 41751fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion internal/controller/promotion/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (g *gitMechanism) Promote(
); err != nil {
return nil, newFreight, err
}
newStatus = aggregateGitPromoStatus(newStatus, *otherStatus).WithFreight(&newFreight)
newStatus = aggregateGitPromoStatus(newStatus, *otherStatus)
}

logger.Debugf("done executing %s", g.name)
Expand Down
8 changes: 1 addition & 7 deletions internal/controller/promotions/promotions.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,18 +452,12 @@ func (r *reconciler) promote(
if err != nil {
return nil, err
}
// record the freight reference to the promotion's status
err = kubeclient.PatchStatus(ctx, r.kargoClient, &promo, func(status *kargoapi.PromotionStatus) {
status.Freight = &targetFreightRef
})
if err != nil {
logger.Errorf("Promotion status patch failed: %v", err)
}

newStatus, nextFreight, err := r.promoMechanisms.Promote(ctx, stage, &promo, targetFreightRef)
if err != nil {
return nil, err
}
newStatus = newStatus.WithFreight(&targetFreight)

logger.Debugf("promotion %s", newStatus.Phase)

Expand Down

0 comments on commit 41751fa

Please sign in to comment.