auto update: return restart error

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 #17607 will reveal errors.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
Valentin Rothberg
2023-03-15 13:50:41 +01:00
parent 68bf49799d
commit 3c51b61d76

View File

@ -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
}