Merge pull request #5571 from vmarmol/fix

Adding errors to Kubelet events.
This commit is contained in:
Yu-Ju Hong
2015-03-17 16:14:58 -07:00
2 changed files with 3 additions and 4 deletions

View File

@@ -349,7 +349,6 @@ func (p dockerPuller) Pull(image string) error {
} }
// Image spec: [<registry>/]<repository>/<image>[:<version] so we count '/' // Image spec: [<registry>/]<repository>/<image>[:<version] so we count '/'
explicitRegistry := (strings.Count(image, "/") == 2) explicitRegistry := (strings.Count(image, "/") == 2)
glog.Errorf("Foo: %s", explicitRegistry)
// Hack, look for a private registry, and decorate the error with the lack of // Hack, look for a private registry, and decorate the error with the lack of
// credentials. This is heuristic, and really probably could be done better // credentials. This is heuristic, and really probably could be done better
// by talking to the registry API directly from the kubelet here. // by talking to the registry API directly from the kubelet here.

View File

@@ -963,7 +963,7 @@ func (kl *Kubelet) createPodInfraContainer(pod *api.Pod) (dockertools.DockerID,
ok, err := kl.dockerPuller.IsImagePresent(container.Image) ok, err := kl.dockerPuller.IsImagePresent(container.Image)
if err != nil { if err != nil {
if ref != nil { if ref != nil {
kl.recorder.Eventf(ref, "failed", "Failed to inspect image %q", container.Image) kl.recorder.Eventf(ref, "failed", "Failed to inspect image %q: %v", container.Image, err)
} }
return "", err return "", err
} }
@@ -1003,7 +1003,7 @@ func (kl *Kubelet) pullImage(img string, ref *api.ObjectReference) error {
if err := kl.dockerPuller.Pull(img); err != nil { if err := kl.dockerPuller.Pull(img); err != nil {
if ref != nil { if ref != nil {
kl.recorder.Eventf(ref, "failed", "Failed to pull image %q", img) kl.recorder.Eventf(ref, "failed", "Failed to pull image %q: %v", img, err)
} }
return err return err
} }
@@ -1119,7 +1119,7 @@ func (kl *Kubelet) pullImageAndRunContainer(pod *api.Pod, container *api.Contain
present, err := kl.dockerPuller.IsImagePresent(container.Image) present, err := kl.dockerPuller.IsImagePresent(container.Image)
if err != nil { if err != nil {
if ref != nil { if ref != nil {
kl.recorder.Eventf(ref, "failed", "Failed to inspect image %q", container.Image) kl.recorder.Eventf(ref, "failed", "Failed to inspect image %q: %v", container.Image, err)
} }
glog.Errorf("Failed to inspect image %q: %v; skipping pod %q container %q", container.Image, err, podFullName, container.Name) glog.Errorf("Failed to inspect image %q: %v; skipping pod %q container %q", container.Image, err, podFullName, container.Name)
return "", err return "", err