Skip to content

Commit

Permalink
auto update: return restart error
Browse files Browse the repository at this point in the history
Return the error when restarting the unit failed during an update.
The task is correctly marked to have failed but we really need to
return the error to the user.

[NO NEW TESTS NEEDED] - The flakes in containers#17607 will reveal errors.

Signed-off-by: Valentin Rothberg <[email protected]>
  • Loading branch information
vrothberg committed Mar 15, 2023
1 parent 68bf497 commit 3c51b61
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/autoupdate/autoupdate.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ func (u *updater) updateUnit(ctx context.Context, unit string, tasks []*task) []

// Jump to the next unit on successful update or if rollbacks are disabled.
if updateError == nil || !u.options.Rollback {
if updateError != nil {
errors = append(errors, fmt.Errorf("restarting unit %s during update: %w", unit, updateError))
}
return errors
}

Expand Down

0 comments on commit 3c51b61

Please sign in to comment.