podman/pkg/api/server
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
..
idle Change http ConnState actions between new and active 2020-10-31 20:31:33 -06:00
docs.go [CI:DOCS] Set all operation id to be compatibile 2021-04-05 19:54:30 -07:00
handler_api.go Add CORS support 2021-06-04 16:14:52 +03:00
listener_api.go Make podman service log events 2020-11-19 14:42:56 -07:00
register_archive.go [CI:DOCS] Set all operation id to be compatibile 2021-04-05 19:54:30 -07:00
register_auth.go [CI:DOCS] Set all operation id to be compatibile 2021-04-05 19:54:30 -07:00
register_containers.go remote: always send resize before the container starts 2021-06-04 16:55:48 +02:00
register_distribution.go bump go module to v3 2021-02-22 09:03:51 +01:00
register_events.go [CI:DOCS] Set all operation id to be compatibile 2021-04-05 19:54:30 -07:00
register_exec.go Fix resize race with podman exec -it 2021-06-16 16:43:30 +02:00
register_generate.go swagger: remove name wildcards 2021-04-07 15:21:44 +02:00
register_healthcheck.go swagger: remove name wildcards 2021-04-07 15:21:44 +02:00
register_images.go create: support images with invalid platform 2021-06-23 15:42:13 +02:00
register_info.go [CI:DOCS] Set all operation id to be compatibile 2021-04-05 19:54:30 -07:00
register_manifest.go Merge pull request #9121 from tmds/swagger_remove_name_wildcards 2021-04-08 13:04:23 -04:00
register_monitor.go bump go module to v3 2021-02-22 09:03:51 +01:00
register_networks.go [CI:DOCS] Update swagger for inspect network 2021-06-08 15:23:46 -07:00
register_ping.go [CI:DOCS] Set all operation id to be compatibile 2021-04-05 19:54:30 -07:00
register_play.go add --mac-address to podman play kube 2021-05-04 20:14:13 +02:00
register_plugins.go bump go module to v3 2021-02-22 09:03:51 +01:00
register_pods.go [CI:DOCS] Correct status code for /pods/create 2021-04-12 09:33:51 -07:00
register_secrets.go [CI:DOCS] Set all operation id to be compatibile 2021-04-05 19:54:30 -07:00
register_swagger.go bump go module to v3 2021-02-22 09:03:51 +01:00
register_swarm.go bump go module to v3 2021-02-22 09:03:51 +01:00
register_system.go [CI:DOCS] Set all operation id to be compatibile 2021-04-05 19:54:30 -07:00
register_version.go [CI:DOCS] Set all operation id to be compatibile 2021-04-05 19:54:30 -07:00
register_volumes.go Reflect current state of prune implementation in docs 2021-04-13 09:16:25 +02:00
server.go Add CORS support 2021-06-04 16:14:52 +03:00
swagger.go swagger: update system version response body 2021-03-29 14:25:25 +00:00