Use imageParts.normalizedReference in normalizeTag

This is another step to using reference values instead of strings here.

CHANGES BEHAVIOR: docker.io/busybox is now normalized to docker.io/library/busybox.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač
2019-01-09 21:35:04 +01:00
parent 1c19d19c6e
commit e060a19c87
2 changed files with 9 additions and 2 deletions

View File

@ -268,6 +268,7 @@ func TestNormalizeTag(t *testing.T) {
{"example.com/busybox:notlatest" + digestSuffix, "example.com/busybox:notlatest" + digestSuffix}, // Qualified name:tag@digest
{"busybox:latest", "localhost/busybox:latest"}, // Unqualified name-only
{"ns/busybox:latest", "localhost/ns/busybox:latest"}, // Unqualified with a dot-less namespace
{"docker.io/busybox:latest", "docker.io/library/busybox:latest"}, // docker.io without /library/
} {
res, err := normalizeTag(c.input)
if c.expected == "" {