Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dockerbuild pulls all images rather than :latest #9104

Merged
merged 1 commit into from
Jun 2, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imageapi.DefaultImageTag?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This package can't take any dependencies on other OpenShift code, because we're going to move this out of the repo.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sgtm

}

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