pkg/kubelet: fix wrong code path in runContainer

This commit is contained in:
Xiang Li 2015-02-16 09:32:37 -08:00
parent 13bb378d1c
commit 2437e94248

View File

@ -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