Skip to content

Commit

Permalink
Merge pull request #9104 from smarterclayton/dont_pull_all
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot committed Jun 2, 2016
2 parents b42bfc3 + 020d51f commit d8db748
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/util/docker/dockerfile/builder/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,12 @@ func (e *ClientExecutor) LoadImage(from string) (*docker.Image, error) {
return nil, docker.ErrNoSuchImage
}

repository, _ := docker.ParseRepositoryTag(from)
repository, tag := docker.ParseRepositoryTag(from)
if len(tag) == 0 {
tag = "latest"
}

glog.V(4).Infof("attempting to pull %s with auth from repository %s", from, repository)
glog.V(4).Infof("attempting to pull %s with auth from repository %s:%s", from, repository, tag)

// TODO: we may want to abstract looping over multiple credentials
auth, _ := e.AuthFn(repository)
Expand All @@ -298,7 +301,7 @@ func (e *ClientExecutor) LoadImage(from string) (*docker.Image, error) {
for _, config := range auth {
// TODO: handle IDs?
// TODO: use RawJSONStream:true and handle the output nicely
if err = e.Client.PullImage(docker.PullImageOptions{Repository: from, OutputStream: e.Out}, config); err == nil {
if err = e.Client.PullImage(docker.PullImageOptions{Repository: from, OutputStream: e.Out, Tag: tag}, config); err == nil {
break
}
lastErr = err
Expand Down

0 comments on commit d8db748

Please sign in to comment.