Skip to content

Commit

Permalink
Adds an additional test for prefixing tags (#278)
Browse files Browse the repository at this point in the history
* Adds an additional test for prefixing tags

* Bump version
  • Loading branch information
ehotinger authored Sep 6, 2018
1 parent e442260 commit f7035b5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.0.6
v1.0.7
27 changes: 24 additions & 3 deletions util/prefixes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,31 @@ func TestPrefixTags(t *testing.T) {
expected string
expectedTags []string
}{
{"foo.azurecr.io", "build -f Dockerfile . -t test:latest --tag bar", "build -f Dockerfile . -t foo.azurecr.io/test:latest --tag foo.azurecr.io/bar", []string{"foo.azurecr.io/test:latest", "foo.azurecr.io/bar"}},
{"", "build -t bar/foo:latest . --tag bar", "build -t bar/foo:latest . --tag bar", []string{"bar/foo:latest", "bar"}},
{
"foo.azurecr.io",
"build -f Dockerfile . -t test:latest --tag bar",
"build -f Dockerfile . -t foo.azurecr.io/test:latest --tag foo.azurecr.io/bar",
[]string{"foo.azurecr.io/test:latest", "foo.azurecr.io/bar"},
},
{
"",
"build -t bar/foo:latest . --tag bar",
"build -t bar/foo:latest . --tag bar",
[]string{"bar/foo:latest", "bar"},
},
{"foo.azurecr.io", "build -f Dockerfile . -t foo.azurecr.io/test:latest", "build -f Dockerfile . -t foo.azurecr.io/test:latest", []string{"foo.azurecr.io/test:latest"}},
{"foo.azurecr.io", "build -f Dockerfile -t library/test:latest", "build -f Dockerfile -t library/test:latest", []string{"library/test:latest"}},
{
"sample.azurecr.io",
"build -f src/Dockerfile https://github.com/Azure/acr-builder.git -t testing/sub/repo:l",
"build -f src/Dockerfile https://github.com/Azure/acr-builder.git -t sample.azurecr.io/testing/sub/repo:l",
[]string{"sample.azurecr.io/testing/sub/repo:l"},
},
{
"foo.azurecr.io",
"build -f Dockerfile -t library/test:latest",
"build -f Dockerfile -t library/test:latest",
[]string{"library/test:latest"},
},
}
for _, test := range tests {
actual, actualTags := PrefixTags(test.cmd, test.registry)
Expand Down

0 comments on commit f7035b5

Please sign in to comment.