mirror of
https://github.com/containers/podman.git
synced 2025-09-26 08:14:14 +08:00

Add support for simple rollbacks during `podman auto-update`. Rollbacks are enabled by default. If a systemd unit cannot be restarted after an update, the previous image will be retagged and the unit will be restarted a second time. Add system tests for rollbacks. Also fix a bug in the restart sequence; we have to use the channel to actually know whether the restart was successful or not. NOTE: To make rollbacks really useful, users must run their containers with `--sdnotify=container` such that the containers send the ready message over the (mounted) socket. This way, restarting the systemd units during auto update will block until the message has been received (or a timeout kicked in). Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
32 lines
973 B
Go
32 lines
973 B
Go
package entities
|
|
|
|
// AutoUpdateOptions are the options for running auto-update.
|
|
type AutoUpdateOptions struct {
|
|
// Authfile to use when contacting registries.
|
|
Authfile string
|
|
// Only check for but do not perform any update. If an update is
|
|
// pending, it will be indicated in the Updated field of
|
|
// AutoUpdateReport.
|
|
DryRun bool
|
|
// If restarting the service with the new image failed, restart it
|
|
// another time with the previous image.
|
|
Rollback bool
|
|
}
|
|
|
|
// AutoUpdateReport contains the results from running auto-update.
|
|
type AutoUpdateReport struct {
|
|
// ID of the container *before* an update.
|
|
ContainerID string
|
|
// Name of the container *before* an update.
|
|
ContainerName string
|
|
// Name of the image.
|
|
ImageName string
|
|
// The configured auto-update policy.
|
|
Policy string
|
|
// SystemdUnit running a container configured for auto updates.
|
|
SystemdUnit string
|
|
// Indicates the update status: true, false, failed, pending (see
|
|
// DryRun).
|
|
Updated string
|
|
}
|