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
This commit is contained in:
baude
2018-07-12 13:44:26 -05:00
committed by Atomic Bot
parent a2dde5a50d
commit 6f1dd44b29
4 changed files with 40 additions and 8 deletions

View File

@ -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:")
}