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,13 +683,15 @@ func (kl *Kubelet) runContainer(pod *api.BoundPod, container *api.Container, pod
containerLogPath := path.Join(p, dockerContainer.ID) containerLogPath := path.Join(p, dockerContainer.ID)
fs, err := os.Create(containerLogPath) fs, err := os.Create(containerLogPath)
if err != nil { 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) glog.Errorf("Error on creating termination-log file %q: %v", containerLogPath, err)
} } else {
defer fs.Close() defer fs.Close()
b := fmt.Sprintf("%s:%s", containerLogPath, container.TerminationMessagePath) b := fmt.Sprintf("%s:%s", containerLogPath, container.TerminationMessagePath)
binds = append(binds, b) binds = append(binds, b)
} }
} }
}
privileged := false privileged := false
if capabilities.Get().AllowPrivileged { if capabilities.Get().AllowPrivileged {
privileged = container.Privileged privileged = container.Privileged