container_attach: Ensure ctl file is closed

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
Mrunal Patel 2018-01-25 17:04:01 -08:00
parent 4b658672aa
commit 6f45c1726e

View file

@ -64,6 +64,7 @@ func (ss streamService) Attach(containerID string, inputStream io.Reader, output
if err != nil { if err != nil {
return fmt.Errorf("failed to open container ctl file: %v", err) return fmt.Errorf("failed to open container ctl file: %v", err)
} }
defer controlFile.Close()
kubecontainer.HandleResizing(resize, func(size remotecommand.TerminalSize) { kubecontainer.HandleResizing(resize, func(size remotecommand.TerminalSize) {
logrus.Infof("Got a resize event: %+v", size) logrus.Infof("Got a resize event: %+v", size)