Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pull: custom platform: do not use local image name
Do not use the name of the locally resolved image when pulling an image with a custom platform. As we recently re-discovered [1], many multi-arch images in the wild do not adhere to the OCI image spec and either declare custom or simply wrong platforms (arch, os, variant). To address such wrong images, we enforce the pull-always policy whenever a custom arch, os or variant is specified. We have to do that since we cannot reliably perform platform matches to any image we would find in the local containers storage. To complete the fix, we need to ignore any local image and not use the locally resolved name which we usually have to do (see [2]). Let's assume we have a local image "localhost/foo" (arch=amd64). If we perform a `pull --arch=arm64`, we would not attempt to be pulling `localhost/foo` but use the ordinary short-name resolution and look for a matching alias or walk the unqualified-search registries. In other words: short-name resolution of multi-arch images is prone to errors but we should continue supporting images in the wild. [1] containers/podman/issues/10682 [2] containers/buildah/issues/2904 Signed-off-by: Valentin Rothberg <[email protected]>
- Loading branch information