Skip to content

Commit 44b38cf

Browse files
committed
Add test for private registry w/ sub dirs
1 parent 6c30ec9 commit 44b38cf

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

docker_client_test.go

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,31 @@ func TestSplitDockerImageWithRepositoryAndTag(t *testing.T) {
9595
if "ubuntu:12.04" != dockerImage.String() {
9696
t.Fail()
9797
}
98-
9998
}
10099

100+
func TestSplitDockerImageWithPrivateRegistryPath(t *testing.T) {
101+
registry, repository, tag := splitDockerImage("localhost:8888/ubuntu/foo:12.04")
102+
103+
if registry != "localhost:8888" {
104+
t.Fail()
105+
}
106+
107+
if repository != "ubuntu/foo" {
108+
t.Fail()
109+
}
110+
111+
if tag != "12.04" {
112+
t.Fail()
113+
}
114+
dockerImage := DockerImage{
115+
Registry: registry,
116+
Repository: repository,
117+
Tag: tag,
118+
}
119+
if "localhost:8888/ubuntu/foo:12.04" != dockerImage.String() {
120+
t.Fail()
121+
}
122+
}
101123
func TestSplitDockerImageWithLocalRepositoryAndTag(t *testing.T) {
102124
registry, repository, tag := splitDockerImage("localhost:8888/ubuntu:12.04")
103125

0 commit comments

Comments
 (0)