spiegel_podman/pkg
Valentin Rothberg 5fc622f945 create: support images with invalid platform
Much to my regret, there is a number of images in the wild with invalid
platforms breaking the platform checks in libimage that want to make
sure that a local image is matching the expected platform.

Imagine a `podman run --arch=arm64 fedora` with a local amd64 fedora
image.  We really shouldn't use the local one in this case and pull down
the arm64 one.

The strict platform checks in libimage in combination with invalid
platforms in images surfaced in Podman being able to pull an image but
failing to look it up in subsequent presence checks.  A `podman run`
would hence pull such an image but fail to create the container.

Support images with invalid platforms by vendoring the latest HEAD from
containers/common.  Also remove the partially implemented pull-policy
logic from Podman and let libimage handle that entirely.  However,
whenever --arch, --os or --platform are specified, the pull policy will
be forced to "newer".  This way, we pessimistically assume that the
local image has an invalid platform and we reach out to the registry.
If there's a newer image (i.e., one with a different digest), we'll pull
it down.

Please note that most of the logic has either already been implemented
in libimage or been moved down which allows for removing some clutter
from Podman.

[NO TESTS NEEDED] since c/common has new tests.  Podman can rely on the
existing tests.

Fixes: #10648
Fixes: #10682
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-06-23 15:42:13 +02:00
..
annotations Spelling 2020-12-22 13:34:31 -05:00
api create: support images with invalid platform 2021-06-23 15:42:13 +02:00
auth Enable whitespace linter 2021-02-11 23:01:56 +01:00
autoupdate migrate Podman to containers/common/libimage 2021-05-05 11:30:12 +02:00
bindings create: support images with invalid platform 2021-06-23 15:42:13 +02:00
cgroups Fix panic condition in cgroups.getAvailableControllers 2021-06-15 09:22:37 +08:00
channel channel: simplify implementation 2021-05-06 11:51:15 +02:00
checkpoint Allow changing of port forward rules on restore 2021-06-04 13:29:02 +02:00
copy podman cp: support copying on tmpfs mounts 2021-03-04 15:43:12 +01:00
criu Add helper function to read out CRIU version 2018-10-23 12:52:03 +02:00
ctime Re-add int64 casts for ctime 2019-07-23 15:43:40 -04:00
domain create: support images with invalid platform 2021-06-23 15:42:13 +02:00
env Ensure DefaultEnvVariables is used in Specgen 2020-08-18 15:17:46 -04:00
errorhandling create: support images with invalid platform 2021-06-23 15:42:13 +02:00
hooks bump go module to v3 2021-02-22 09:03:51 +01:00
inspect bump go module to v3 2021-02-22 09:03:51 +01:00
kubeutils prune remotecommand dependency 2021-02-25 10:02:41 -06:00
lookup Enable whitespace linter 2021-02-11 23:01:56 +01:00
machine Fix build tags for pkg/machine... 2021-06-10 10:25:16 +02:00
namespaces [NO TESTS NEEDED] Shrink the size of podman-remote 2021-03-29 09:49:45 -04:00
netns rootless cni without infra container 2021-04-01 17:27:03 +02:00
network Split libpod/network package 2021-03-15 14:01:52 +01:00
parallel bump go module to v3 2021-02-22 09:03:51 +01:00
ps migrate Podman to containers/common/libimage 2021-05-05 11:30:12 +02:00
registries Document CONTAINERS_CONF/CONTAINERS_STORAGE_CONF Env variables 2021-03-10 06:34:47 -05:00
resolvconf bump go module to v3 2021-02-22 09:03:51 +01:00
rootless rootless: fix fast join userns path 2021-06-09 15:30:41 +02:00
rootlessport Enable whitespace linter 2021-02-11 23:01:56 +01:00
seccomp Spelling 2020-12-22 13:34:31 -05:00
selinux Fix SELinux functions names to not be repetitive 2020-04-23 15:57:34 -04:00
signal Fix build for mips architecture follow-up 2021-01-07 15:04:22 +01:00
specgen create: support images with invalid platform 2021-06-23 15:42:13 +02:00
systemd systemd/generate: change type to notify 2021-06-04 10:17:25 +02:00
terminal pkg/terminal: use c/storage/pkg/homedir 2021-03-08 09:21:13 +01:00
timetype make lint: enable gocritic 2020-01-13 14:27:02 +01:00
trust Enable whitespace linter 2021-02-11 23:01:56 +01:00
util migrate Podman to containers/common/libimage 2021-05-05 11:30:12 +02:00