Fixes oc cluster fails to abort when it first fails to pull an image
Fixes
@@ -157,6 +157,16 @@ func (h *Helper) CheckAndPull(image string, out io.Writer) error {
if err != nil {
return starterrors.NewError("error pulling Docker image %s", image).WithCause(err)
}
+
+ // This is to work around issue https://github.com/docker/engine-api/issues/138
+ // where engine-api/client/ImagePull does not return an error when it should.
+ // which also still seems to exist in https://github.com/moby/moby/blob/master/client/image_pull.go
+ _, _, err = h.client.ImageInspectWithRaw(image, false)
+ if err != nil {
+ glog.V(5).Infof("Image %q not found: %v", image, err)
+ return starterrors.NewError("error pulling Docker image %s", image).WithCause(err)
+ }
+
fmt.Fprintf(out, "Image pull complete\n")
return nil
}
