Merge pull request #1288 from mrunalp/attach_close_ctl

container_attach: Ensure ctl file is closed
This commit is contained in:
Antonio Murdaca 2018-01-26 18:05:30 +01:00 committed by GitHub
commit 33e1057102
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)