podman/pkg/spec
Valentin Rothberg f4e873c4e1 auto updates
Add support to auto-update containers running in systemd units as
generated with `podman generate systemd --new`.

`podman auto-update` looks up containers with a specified
"io.containers.autoupdate" label (i.e., the auto-update policy).

If the label is present and set to "image", Podman reaches out to the
corresponding registry to check if the image has been updated.  We
consider an image to be updated if the digest in the local storage is
different than the one of the remote image.  If an image must be
updated, Podman pulls it down and restarts the container.  Note that the
restarting sequence relies on systemd.

At container-creation time, Podman looks up the "PODMAN_SYSTEMD_UNIT"
environment variables and stores it verbatim in the container's label.
This variable is now set by all systemd units generated by
`podman-generate-systemd` and is set to `%n` (i.e., the name of systemd
unit starting the container).  This data is then being used in the
auto-update sequence to instruct systemd (via DBUS) to restart the unit
and hence to restart the container.

Note that this implementation of auto-updates relies on systemd and
requires a fully-qualified image reference to be used to create the
container.  This enforcement is necessary to know which image to
actually check and pull.  If we used an image ID, we would not know
which image to check/pull anymore.

Fixes: #3575
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-17 17:18:56 +01:00
..
config_linux.go apiv2 container create using specgen 2020-02-19 15:20:15 -06:00
config_linux_cgo.go add pkg/seccomp 2020-02-12 17:10:18 +01:00
config_linux_nocgo.go Split up create config handling of namespaces and security 2019-11-07 21:23:23 -05:00
config_unsupported.go apiv2 container create using specgen 2020-02-19 15:20:15 -06:00
containerconfig.go remove libpod from main 2019-06-25 13:51:24 -05:00
createconfig.go auto updates 2020-03-17 17:18:56 +01:00
namespaces.go spec: allow container alias name in lookup 2020-02-26 15:04:31 +01:00
parse.go apiv2 container create using specgen 2020-02-19 15:20:15 -06:00
ports.go Spell check strings and comments 2018-05-25 08:45:15 +00:00
security.go Fix spelling mistakes in code found by codespell 2020-03-07 10:30:44 -05:00
spec.go Merge pull request #5206 from rhatdan/capabilities 2020-03-03 14:48:10 +01:00
spec_test.go Split up create config handling of namespaces and security 2019-11-07 21:23:23 -05:00
storage.go Merge pull request #5222 from mheon/fix_5219 2020-02-20 18:16:52 -05:00
storage_test.go Use EqualValues instead of reflect equality 2019-05-01 10:19:05 -04:00