diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index 83ffe288246..58321475ae4 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -683,11 +683,13 @@ func (kl *Kubelet) runContainer(pod *api.BoundPod, container *api.Container, pod containerLogPath := path.Join(p, dockerContainer.ID) fs, err := os.Create(containerLogPath) if err != nil { + // TODO: Clean up the previouly created dir? return the error? glog.Errorf("Error on creating termination-log file %q: %v", containerLogPath, err) + } else { + defer fs.Close() + b := fmt.Sprintf("%s:%s", containerLogPath, container.TerminationMessagePath) + binds = append(binds, b) } - defer fs.Close() - b := fmt.Sprintf("%s:%s", containerLogPath, container.TerminationMessagePath) - binds = append(binds, b) } } privileged := false