Distinguish image registry unavailable and pull failure

This commit is contained in:
jiangyaoguo
2015-09-19 00:09:16 +08:00
parent 036fe16849
commit af46c69553
4 changed files with 11 additions and 3 deletions

View File

@@ -130,7 +130,7 @@ func filterHTTPError(err error, image string) error {
jerr.Code == http.StatusServiceUnavailable ||
jerr.Code == http.StatusGatewayTimeout) {
glog.V(2).Infof("Pulling image %q failed: %v", image, err)
return fmt.Errorf("image pull failed for %s because the registry is temporarily unavailable.", image)
return kubecontainer.RegistryUnavailable
} else {
return err
}