mirror of
https://github.com/containers/podman.git
synced 2026-02-05 06:45:31 +01:00
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>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user