summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorValentin Rothberg <vrothberg@redhat.com>2022-08-02 17:32:38 +0200
committerValentin Rothberg <vrothberg@redhat.com>2022-08-04 13:07:58 +0200
commit13a8ebd09f7d76d43f1b8af86c7ca2bbc1acfbca (patch)
tree25e9b81464bbbffabfb6c6f58fa6751054202409 /pkg
parent2c999f1ecb87a6688c19502f0f594e002104e951 (diff)
downloadpodman-13a8ebd09f7d76d43f1b8af86c7ca2bbc1acfbca.tar.gz
podman-13a8ebd09f7d76d43f1b8af86c7ca2bbc1acfbca.tar.bz2
podman-13a8ebd09f7d76d43f1b8af86c7ca2bbc1acfbca.zip
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 <vrothberg@redhat.com>
Diffstat (limited to 'pkg')
-rw-r--r--pkg/autoupdate/autoupdate.go4
1 files changed, 3 insertions, 1 deletions
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)
}