From 3c51b61d766dc6718b62de4906acc21efad57856 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Wed, 15 Mar 2023 13:50:41 +0100 Subject: [PATCH] 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 --- pkg/autoupdate/autoupdate.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/autoupdate/autoupdate.go b/pkg/autoupdate/autoupdate.go index 2ccc0649c4..10258701f8 100644 --- a/pkg/autoupdate/autoupdate.go +++ b/pkg/autoupdate/autoupdate.go @@ -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 }