diff options
author | Urvashi Mohnani <umohnani@redhat.com> | 2020-12-07 16:28:38 -0500 |
---|---|---|
committer | Urvashi Mohnani <umohnani@redhat.com> | 2020-12-07 17:04:53 -0500 |
commit | b0707af68b88168fa7b48df039e27e4e165f3423 (patch) | |
tree | c9ba0804a92d9644c9d378a65f77efda1c86a9df /pkg/domain/infra/abi | |
parent | a5ca03915e7ad8b9db81d22a256013ce5ae3cc87 (diff) | |
download | podman-b0707af68b88168fa7b48df039e27e4e165f3423.tar.gz podman-b0707af68b88168fa7b48df039e27e4e165f3423.tar.bz2 podman-b0707af68b88168fa7b48df039e27e4e165f3423.zip |
Do not pull if image domain is localhost
With podman play kube, podman would always attempt to
pull if the image has the :latest tag. But this would
fail if the image was built locally and given latest
as the tag. Images build with podman and buildah have
localhost as the domain, so check if the domain is localhost.
If that is the case, then don't attempt a pull.
Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
Diffstat (limited to 'pkg/domain/infra/abi')
-rw-r--r-- | pkg/domain/infra/abi/play.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go index 3aeb6a2ee..5b983a3f4 100644 --- a/pkg/domain/infra/abi/play.go +++ b/pkg/domain/infra/abi/play.go @@ -212,8 +212,10 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY return nil, errors.Wrapf(err, "Failed to parse image %q", container.Image) } // In kube, if the image is tagged with latest, it should always pull + // but if the domain is localhost, that means the image was built locally + // so do not attempt a pull. if tagged, isTagged := named.(reference.NamedTagged); isTagged { - if tagged.Tag() == image.LatestTag { + if tagged.Tag() == image.LatestTag && reference.Domain(named) != image.DefaultLocalRegistry { pullPolicy = util.PullImageAlways } } |