Skip to content

Commit

Permalink
enable to specify image with hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
masarakki committed May 16, 2015
1 parent 09b26bf commit 608377e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion shared/build/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ func parseImageName(image string) (owner, name, tag string) {
}

parts := strings.Split(name, "/")
if len(parts) == 2 {
if len := len(parts); len == 3 {
owner = fmt.Sprintf("%s/%s", parts[0], parts[1])
name = parts[2]
} else if len == 2 {
owner = parts[0]
name = parts[1]
}
Expand Down
2 changes: 2 additions & 0 deletions shared/build/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ func TestParseImageName(t *testing.T) {
{"johnsmith", "redis", "latest", "johnsmith/redis"},
// image name with no owner specified
{"bradrydzewski", "redis", "2.8", "redis:2.8"},
// image name with hostname
{"docker.example.com/johnsmith", "redis", "latest", "docker.example.com/johnsmith/redis"},
// image name with ownly name specified
{"bradrydzewski", "redis2", "latest", "redis2"},
// image name that is a known alias
Expand Down

0 comments on commit 608377e

Please sign in to comment.