c8d/save: Handle digested reference same as ID
When saving an image treat `image@sha256:abcdef...` the same as `abcdef...`, this makes it: - Not export the digested tag as the image name - Not try to export all tags from the image repository Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
parent
d131f00fff
commit
5e13f54f57
1 changed files with 6 additions and 0 deletions
|
@ -168,6 +168,12 @@ func (i *ImageService) ExportImage(ctx context.Context, names []string, outStrea
|
|||
|
||||
ref, refErr := reference.ParseNormalizedNamed(name)
|
||||
|
||||
if refErr == nil {
|
||||
if _, ok := ref.(reference.Digested); ok {
|
||||
specificDigestResolved = true
|
||||
}
|
||||
}
|
||||
|
||||
if resolveErr != nil || !specificDigestResolved {
|
||||
// Name didn't resolve to anything, or name wasn't explicitly referencing a digest
|
||||
if refErr == nil && reference.IsNameOnly(ref) {
|
||||
|
|
Loading…
Reference in a new issue