fix confusing defer

This commit is contained in:
Daniel Smith 2015-02-19 17:11:25 -08:00
parent 5eb71a1877
commit b7b537efc7

View File

@ -686,7 +686,7 @@ func (kl *Kubelet) runContainer(pod *api.BoundPod, container *api.Container, pod
// 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()
fs.Close() // Close immediately; we're just doing a `touch` here
b := fmt.Sprintf("%s:%s", containerLogPath, container.TerminationMessagePath)
binds = append(binds, b)
}