spiegel_podman/libpod
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
..
common Set blob cache directory based on GraphDriver 2019-03-29 08:27:33 -04:00
config Fix spelling mistakes in code found by codespell 2020-03-07 10:30:44 -05:00
define Revert "Exec: use ErrorConmonRead" 2020-03-09 09:50:40 -04:00
driver removMergeDir from inspect result if not mounted 2019-08-13 15:13:20 -04:00
events auto updates 2020-03-17 17:18:56 +01:00
image Merge pull request #5469 from giuseppe/no-size-create-container 2020-03-12 10:20:02 -04:00
layers Initial checkin from CRI-O repo 2017-11-01 11:24:59 -04:00
lock make lint: include unit tests 2020-01-14 10:51:59 +01:00
logs Follow up changes from #5244 2020-03-12 10:06:51 +05:30
boltdb_state.go codespell: spelling corrections 2019-11-13 08:15:00 +11:00
boltdb_state_internal.go make lint: enable gocritic 2020-01-13 14:27:02 +01:00
boltdb_state_linux.go Error on netns not exist only when ctr is running 2019-11-19 15:38:03 -05:00
boltdb_state_unsupported.go podman-remote inspect 2019-01-18 15:43:11 -06:00
common_test.go Remove ImageVolumes from database 2020-02-21 09:37:30 -05:00
container.go auto updates 2020-03-17 17:18:56 +01:00
container.log.go [WIP] Add cmd flag to show container name in log 2020-02-19 16:58:04 +05:30
container_api.go Revert "exec: get the exit code from sync pipe instead of file" 2020-03-09 09:50:55 -04:00
container_commit.go Deprecate & remove IsCtrSpecific in favor of IsAnon 2020-01-29 14:04:51 -05:00
container_graph.go make lint: enable gocritic 2020-01-13 14:27:02 +01:00
container_graph_test.go generate systemd: support pods and geneartig files 2019-08-21 17:28:30 +02:00
container_inspect.go Fix spelling mistakes in code found by codespell 2020-03-07 10:30:44 -05:00
container_internal.go Revert "exec: get the exit code from sync pipe instead of file" 2020-03-09 09:50:55 -04:00
container_internal_linux.go Ensure that exec sessions inherit supplemental groups 2020-02-28 11:32:56 -05:00
container_internal_test.go make lint: include unit tests 2020-01-14 10:51:59 +01:00
container_internal_unsupported.go When restoring containers, reset cgroup path 2019-10-10 14:53:29 -04:00
container_linux.go Do not fetch pod and ctr State on retrieval in Bolt 2018-07-31 14:19:50 +00:00
container_log_linux.go update systemd & dbus dependencies 2020-03-10 18:34:55 +01:00
container_log_unsupported.go libpod removal from main (phase 2) 2019-06-27 07:56:24 -05:00
container_top_linux.go refactor top code 2020-01-15 17:08:22 +01:00
container_top_unsupported.go libpod removal from main (phase 2) 2019-06-27 07:56:24 -05:00
container_unsupported.go Do not fetch pod and ctr State on retrieval in Bolt 2018-07-31 14:19:50 +00:00
container_validate.go Add validate() for containers 2020-03-02 10:58:11 -05:00
diff.go Correctly export the root file-system changes 2019-12-09 13:29:36 +01:00
events.go get last container event 2019-07-07 08:54:20 -05:00
healthcheck.go make lint: enable gocritic 2020-01-13 14:27:02 +01:00
healthcheck_linux.go pkg/systemd: add dbus support 2020-03-17 11:29:37 +01:00
healthcheck_unsupported.go remove libpod from main 2019-06-25 13:51:24 -05:00
in_memory_state.go add libpod/config 2019-10-31 17:42:37 +01:00
info.go Merge pull request #4220 from mheon/null_runtime 2019-10-11 20:55:37 +02:00
kube.go fix security-opt generate kube 2020-03-03 11:21:14 -05:00
mounts_linux.go set root propagation based on volume properties 2018-11-26 13:55:02 +01:00
networking_linux.go vendor: update github.com/containernetworking/cni to v0.7.2-0.20200304161608-4fae32b84921 2020-03-06 10:03:27 -06:00
networking_unsupported.go Add support for multiple CNI networks in podman inspect 2020-02-25 13:20:25 -05:00
oci.go Revert "exec: get the exit code from sync pipe instead of file" 2020-03-09 09:50:55 -04:00
oci_attach_linux.go Revert "exec: get the exit code from sync pipe instead of file" 2020-03-09 09:50:55 -04:00
oci_attach_linux_cgo.go Implement conmon exec 2019-07-22 15:57:23 -04:00
oci_attach_linux_nocgo.go Implement conmon exec 2019-07-22 15:57:23 -04:00
oci_attach_unsupported.go Implement conmon exec 2019-07-22 15:57:23 -04:00
oci_conmon_linux.go update systemd & dbus dependencies 2020-03-10 18:34:55 +01:00
oci_conmon_unsupported.go add libpod/config 2019-10-31 17:42:37 +01:00
oci_missing.go Revert "exec: get the exit code from sync pipe instead of file" 2020-03-09 09:50:55 -04:00
oci_util.go libpod: fix case for executable file not found errors 2019-12-02 18:03:33 +01:00
options.go auto updates 2020-03-17 17:18:56 +01:00
pod.go Update pod bindings and Add test to validate prune pod apiv2 binding. 2020-02-28 11:51:02 -05:00
pod_api.go Update pod bindings and Add test to validate prune pod apiv2 binding. 2020-02-28 11:51:02 -05:00
pod_internal.go add libpod/config 2019-10-31 17:42:37 +01:00
pod_status.go APIv2 review corrections #3 2020-01-25 15:09:09 -06:00
pod_top_linux.go libpod removal from main (phase 2) 2019-06-27 07:56:24 -05:00
pod_top_unsupported.go remove libpod from main 2019-06-25 13:51:24 -05:00
reset.go Fix bug podman reset to not remove $XDG_RUNTIME_DIR 2020-03-05 09:21:41 -05:00
runtime.go make lint: enable gocritic 2020-01-13 14:27:02 +01:00
runtime_cstorage.go make lint: enable gocritic 2020-01-13 14:27:02 +01:00
runtime_ctr.go auto updates 2020-03-17 17:18:56 +01:00
runtime_img.go Allow users to set TMPDIR environment 2020-03-06 10:21:37 -05:00
runtime_img_test.go switch projectatomic to containers 2018-08-16 17:12:36 +00:00
runtime_migrate.go Migrate can move containers to a new runtime 2019-10-10 10:25:06 -04:00
runtime_migrate_unsupported.go Add podman system reset command 2019-11-29 05:34:52 -05:00
runtime_pod.go APIv2 review corrections #3 2020-01-25 15:09:09 -06:00
runtime_pod_infra_linux.go auto updates 2020-03-17 17:18:56 +01:00
runtime_pod_linux.go Only modify conmon cgroup if we have running containers 2020-02-06 10:20:54 -05:00
runtime_pod_unsupported.go remove libpod from main 2019-06-25 13:51:24 -05:00
runtime_renumber.go Re-add locks to volumes. 2019-08-28 11:35:00 -04:00
runtime_volume.go Add basic deadlock detection for container start/remove 2020-02-24 09:29:34 -05:00
runtime_volume_linux.go Add basic deadlock detection for container start/remove 2020-02-24 09:29:34 -05:00
runtime_volume_unsupported.go remove libpod from main 2019-06-25 13:51:24 -05:00
state.go add libpod/config 2019-10-31 17:42:37 +01:00
state_test.go make lint: include unit tests 2020-01-14 10:51:59 +01:00
stats.go api: fix the CPU stats reported 2020-02-11 22:24:14 +01:00
stats_config.go api: fix the CPU stats reported 2020-02-11 22:24:14 +01:00
stats_unsupported.go remove libpod from main 2019-06-25 13:51:24 -05:00
storage.go golangci: enable goimports 2020-03-05 20:03:44 +01:00
util.go Add an API for Attach over HTTP API 2020-01-16 13:49:21 -05:00
util_linux.go Fix SELinux labels of volumes 2020-02-13 21:42:57 -05:00
util_test.go Remove ImageVolumes from database 2020-02-21 09:37:30 -05:00
util_unsupported.go rm: add containers eviction with rm --force 2019-09-25 19:44:38 +02:00
volume.go binding tests for volumes 2020-02-27 13:11:42 -06:00
volume_inspect.go Deprecate & remove IsCtrSpecific in favor of IsAnon 2020-01-29 14:04:51 -05:00
volume_internal.go Ensure volumes reacquire locks on state refresh 2019-12-02 23:06:00 -05:00
volume_internal_linux.go make lint: enable gocritic 2020-01-13 14:27:02 +01:00
volume_internal_unsupported.go Add ability for volumes with options to mount/umount 2019-09-05 17:12:27 -04:00