From 13a8ebd09f7d76d43f1b8af86c7ca2bbc1acfbca Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Tue, 2 Aug 2022 17:32:38 +0200 Subject: pkg/autoupdate: repull image if other containers failed If two containers use the same image and one rolled back (i.e., tagged the old image again), make sure to repull the image for the other container. Once an image has caused a rollback, it may be worth marking this image as broken and not update any other container using it but that is outside of the scope. Signed-off-by: Valentin Rothberg --- pkg/autoupdate/autoupdate.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pkg/autoupdate') diff --git a/pkg/autoupdate/autoupdate.go b/pkg/autoupdate/autoupdate.go index 0f9df9327..dfdbcc956 100644 --- a/pkg/autoupdate/autoupdate.go +++ b/pkg/autoupdate/autoupdate.go @@ -54,8 +54,8 @@ var supportedPolicies = map[string]Policy{ type updater struct { conn *dbus.Conn idToImage map[string]*libimage.Image - unitToTasks map[string][]*task options *entities.AutoUpdateOptions + unitToTasks map[string][]*task updatedRawImages map[string]bool runtime *libpod.Runtime } @@ -278,6 +278,8 @@ func (u *updater) updateRegistry(ctx context.Context, task *task) (*entities.Aut if err := task.image.Tag(rawImageName); err != nil { return report, fmt.Errorf("falling back to previous image: %w", err) } + u.updatedRawImages[rawImageName] = false + if err := u.restartSystemdUnit(ctx, task.container, task.unit); err != nil { return report, fmt.Errorf("restarting unit with old image during fallback: %w", err) } -- cgit v1.2.3-54-g00ecf