diff options
author | baude <bbaude@redhat.com> | 2018-07-12 13:44:26 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-07-13 13:37:49 +0000 |
commit | 6f1dd44b29be4a3046c3bcd5d4d44f7acc5f88fc (patch) | |
tree | 3303735f8d41331a73f0e16d6391edcb744c1b42 /libpod/image/image.go | |
parent | a2dde5a50d21f8857a57d412a8a1c4c8f731a8d1 (diff) | |
download | podman-6f1dd44b29be4a3046c3bcd5d4d44f7acc5f88fc.tar.gz podman-6f1dd44b29be4a3046c3bcd5d4d44f7acc5f88fc.tar.bz2 podman-6f1dd44b29be4a3046c3bcd5d4d44f7acc5f88fc.zip |
fix pull image that includes a sha
when pulling an image that includes a sha such as:
centos/nginx-112-centos7@sha256:42330f7f29ba1ad67819f4ff3ae2472f62de13a827a74736a5098728462212e7
the final image name in libpod should not contain portions of the sha itself nor the sha
identifier. and like docker, we provide a 'none' tag as well.
this should fix #877
Signed-off-by: baude <bbaude@redhat.com>
Closes: #1085
Approved by: mheon
Diffstat (limited to 'libpod/image/image.go')
-rw-r--r-- | libpod/image/image.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libpod/image/image.go b/libpod/image/image.go index 082c4906f..b5c4c537f 100644 --- a/libpod/image/image.go +++ b/libpod/image/image.go @@ -1055,3 +1055,9 @@ func (i *Image) Comment(ctx context.Context, manifestType string) (string, error } return ociv1Img.History[0].Comment, nil } + +// HasShaInInputName returns a bool as to whether the user provide an image name that includes +// a reference to a specific sha +func (i *Image) HasShaInInputName() bool { + return strings.Contains(i.InputName, "@sha256:") +} |