Skip to content

Commit

Permalink
Merge pull request #10017 from smarterclayton/fix_pull_on_19
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot authored Jul 27, 2016
2 parents 6c631f8 + 613ccfd commit 586d098
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions pkg/util/docker/dockerfile/builder/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (e *ClientExecutor) Build(r io.Reader, args map[string]string) error {
}
from, err = e.CreateScratchImage()
if err != nil {
return err
return fmt.Errorf("unable to create a scratch image for this build: %v", err)
}
defer e.CleanupImage(from)
}
Expand Down Expand Up @@ -157,7 +157,7 @@ func (e *ClientExecutor) Build(r io.Reader, args map[string]string) error {
}
v, err := e.Client.CreateVolume(docker.CreateVolumeOptions{Name: volumeName})
if err != nil {
return err
return fmt.Errorf("unable to create volume to mount secrets: %v", err)
}
defer e.cleanupVolume(volumeName)
sharedMount = v.Mountpoint
Expand All @@ -181,7 +181,7 @@ func (e *ClientExecutor) Build(r io.Reader, args map[string]string) error {
}
container, err := e.Client.CreateContainer(opts)
if err != nil {
return err
return fmt.Errorf("unable to create build container: %v", err)
}
e.Container = container

Expand All @@ -200,7 +200,7 @@ func (e *ClientExecutor) Build(r io.Reader, args map[string]string) error {
})
}
if err := e.Copy(copies...); err != nil {
return err
return fmt.Errorf("unable to copy build context into container: %v", err)
}
}

Expand All @@ -223,7 +223,7 @@ func (e *ClientExecutor) Build(r io.Reader, args map[string]string) error {
}

if err := e.Client.StartContainer(e.Container.ID, &hostConfig); err != nil {
return err
return fmt.Errorf("unable to start build container: %v", err)
}
// TODO: is this racy? may have to loop wait in the actual run step
}
Expand All @@ -245,7 +245,7 @@ func (e *ClientExecutor) Build(r io.Reader, args map[string]string) error {
if mustStart {
glog.V(4).Infof("Stopping container %s ...", e.Container.ID)
if err := e.Client.StopContainer(e.Container.ID, 0); err != nil {
return err
return fmt.Errorf("unable to stop build container: %v", err)
}
}

Expand All @@ -272,7 +272,7 @@ func (e *ClientExecutor) Build(r io.Reader, args map[string]string) error {
Tag: tag,
})
if err != nil {
return err
return fmt.Errorf("unable to commit build container: %v", err)
}
e.Image = image
glog.V(4).Infof("Committed %s to %s", e.Container.ID, e.Image.ID)
Expand All @@ -293,7 +293,7 @@ func (e *ClientExecutor) Cleanup() error {
Force: true,
})
if _, ok := err.(*docker.NoSuchContainer); err != nil && !ok {
return err
return fmt.Errorf("unable to cleanup build container: %v", err)
}
e.Container = nil
return nil
Expand Down Expand Up @@ -389,7 +389,7 @@ func (e *ClientExecutor) LoadImage(from string) (*docker.Image, error) {
for _, config := range auth {
// TODO: handle IDs?
pullImageOptions := docker.PullImageOptions{
Repository: from,
Repository: repository,
Tag: tag,
OutputStream: imageprogress.NewPullWriter(outputProgress),
RawJSONStream: true,
Expand All @@ -406,7 +406,7 @@ func (e *ClientExecutor) LoadImage(from string) (*docker.Image, error) {
continue
}
if lastErr != nil {
return nil, lastErr
return nil, fmt.Errorf("unable to pull image (from: %s, tag: %s): %v", repository, tag, lastErr)
}

return e.Client.InspectImage(from)
Expand Down

0 comments on commit 586d098

Please sign in to comment.