UPSTREAM: 56506: kubelet: include runtime error in event on CreatePodSandbox failure
@@ -645,20 +645,20 @@ func (m *kubeGenericRuntimeManager) SyncPod(pod *v1.Pod, _ v1.PodStatus, podStat
if err != nil {
createSandboxResult.Fail(kubecontainer.ErrCreatePodSandbox, msg)
glog.Errorf("createPodSandbox for pod %q failed: %v", format.Pod(pod), err)
- ref, err := ref.GetReference(legacyscheme.Scheme, pod)
- if err != nil {
- glog.Errorf("Couldn't make a ref to pod %q: '%v'", format.Pod(pod), err)
+ ref, referr := ref.GetReference(legacyscheme.Scheme, pod)
+ if referr != nil {
+ glog.Errorf("Couldn't make a ref to pod %q: '%v'", format.Pod(pod), referr)
}
- m.recorder.Eventf(ref, v1.EventTypeWarning, events.FailedCreatePodSandBox, "Failed create pod sandbox.")
+ m.recorder.Eventf(ref, v1.EventTypeWarning, events.FailedCreatePodSandBox, "Failed create pod sandbox: %v", err)
return
}
glog.V(4).Infof("Created PodSandbox %q for pod %q", podSandboxID, format.Pod(pod))
podSandboxStatus, err := m.runtimeService.PodSandboxStatus(podSandboxID)
if err != nil {
- ref, err := ref.GetReference(legacyscheme.Scheme, pod)
- if err != nil {
- glog.Errorf("Couldn't make a ref to pod %q: '%v'", format.Pod(pod), err)
+ ref, referr := ref.GetReference(legacyscheme.Scheme, pod)
+ if referr != nil {
+ glog.Errorf("Couldn't make a ref to pod %q: '%v'", format.Pod(pod), referr)
}
m.recorder.Eventf(ref, v1.EventTypeWarning, events.FailedStatusPodSandBox, "Unable to get pod sandbox status: %v", err)
glog.Errorf("Failed to get pod sandbox status: %v; Skipping pod %q", err, format.Pod(pod))
