Skip to content

Commit

Permalink
Add guard for action
Browse files Browse the repository at this point in the history
  • Loading branch information
ycombinator committed Oct 5, 2023
1 parent c5b060d commit 7f06caa
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions internal/pkg/agent/application/coordinator/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,15 @@ func (c *Coordinator) Upgrade(ctx context.Context, version string, sourceURI str

// override the overall state to upgrading until the re-execution is complete
c.SetOverrideState(agentclient.Upgrading, fmt.Sprintf("Upgrading to version %s", version))
det := details.NewDetails(version, details.StateRequested, action.ActionID, details.DetailsMetadata{
ScheduledAt: action.ActionStartTime},
)

// initialize upgrade details
actionID := ""
detMetadata := details.DetailsMetadata{}
if action != nil {
actionID = action.ActionID
detMetadata.ScheduledAt = action.ActionStartTime
}
det := details.NewDetails(version, details.StateRequested, actionID, detMetadata)
det.RegisterObserver(c.setUpgradeDetails)

cb, err := c.upgradeMgr.Upgrade(ctx, version, sourceURI, action, det, skipVerifyOverride, skipDefaultPgp, pgpBytes...)
Expand Down

0 comments on commit 7f06caa

Please sign in to comment.