Skip to content

Commit

Permalink
Don't set upgrade details when creating upgrade marker
Browse files Browse the repository at this point in the history
  • Loading branch information
ycombinator committed Nov 27, 2023
1 parent 3afa073 commit 6821832
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions internal/pkg/agent/application/upgrade/step_mark.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func newMarkerSerializer(m *UpdateMarker) *updateMarkerSerializer {
}

// markUpgrade marks update happened so we can handle grace period
func (u *Upgrader) markUpgrade(_ context.Context, log *logger.Logger, hash string, action *fleetapi.ActionUpgrade, upgradeDetails *details.Details) error {
func (u *Upgrader) markUpgrade(_ context.Context, log *logger.Logger, hash string, action *fleetapi.ActionUpgrade) error {
prevVersion := release.Version()
prevHash := release.Commit()
if len(prevHash) > hashLen {
Expand All @@ -119,7 +119,6 @@ func (u *Upgrader) markUpgrade(_ context.Context, log *logger.Logger, hash strin
PrevVersion: prevVersion,
PrevHash: prevHash,
Action: action,
Details: upgradeDetails,
}

markerBytes, err := yaml.Marshal(newMarkerSerializer(marker))
Expand Down
3 changes: 1 addition & 2 deletions internal/pkg/agent/application/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ func (u *Upgrader) Upgrade(ctx context.Context, version string, sourceURI string
return nil, err
}

det.SetState(details.StateWatching)
if err := u.markUpgrade(ctx, u.log, newHash, action, det); err != nil {
if err := u.markUpgrade(ctx, u.log, newHash, action); err != nil {
u.log.Errorw("Rolling back: marking upgrade failed", "error.message", err)
rollbackInstall(ctx, u.log, newHash)
return nil, err
Expand Down

0 comments on commit 6821832

Please sign in to comment.