diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-01-14 01:08:13 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-14 01:08:13 -0800 |
commit | 264d0821068c26daae9b2e57bb8ea34dac79e62a (patch) | |
tree | 854b66b38db0ef397c9b0911cbf95da7f2849b48 /libpod/image/image_test.go | |
parent | 140ae25c4d0c7ba89a0bb7ae16f81f90d20be535 (diff) | |
parent | 449116af19305a567933effaced5a0a21a8c71be (diff) | |
download | podman-264d0821068c26daae9b2e57bb8ea34dac79e62a.tar.gz podman-264d0821068c26daae9b2e57bb8ea34dac79e62a.tar.bz2 podman-264d0821068c26daae9b2e57bb8ea34dac79e62a.zip |
Merge pull request #2117 from mtrmac/no-imageParts
RFC: Mostly replace imageParts
Diffstat (limited to 'libpod/image/image_test.go')
-rw-r--r-- | libpod/image/image_test.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libpod/image/image_test.go b/libpod/image/image_test.go index 2a68fd273..077ae460e 100644 --- a/libpod/image/image_test.go +++ b/libpod/image/image_test.go @@ -257,24 +257,25 @@ func Test_stripSha256(t *testing.T) { assert.Equal(t, stripSha256("sha256:a"), "a") } -func TestNormalizeTag(t *testing.T) { +func TestNormalizedTag(t *testing.T) { const digestSuffix = "@sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" for _, c := range []struct{ input, expected string }{ {"#", ""}, // Clearly invalid {"example.com/busybox", "example.com/busybox:latest"}, // Qualified name-only {"example.com/busybox:notlatest", "example.com/busybox:notlatest"}, // Qualified name:tag - {"example.com/busybox" + digestSuffix, "example.com/busybox" + digestSuffix + ":none"}, // Qualified name@digest; FIXME: The result is not even syntactically valid! + {"example.com/busybox" + digestSuffix, "example.com/busybox" + digestSuffix}, // Qualified name@digest; FIXME? Should we allow tagging with a digest at all? {"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) + res, err := normalizedTag(c.input) if c.expected == "" { assert.Error(t, err, c.input) } else { assert.NoError(t, err, c.input) - assert.Equal(t, c.expected, res) + assert.Equal(t, c.expected, res.String()) } } } |