Merge pull request #32106 from jellonek/fd_leaks

Automatic merge from submit-queue

Ensure that we are closing files.

**What this PR does / why we need it**: In several places we are leaking file descriptors. This could be problematic on systems with low ulimits for them.

**Release note**:
```release-note
```
This commit is contained in:
Kubernetes Submit Queue
2016-09-12 23:43:38 -07:00
committed by GitHub
5 changed files with 6 additions and 0 deletions

View File

@@ -1529,6 +1529,7 @@ func readBytesFromFile(filename string) []byte {
framework.Failf(err.Error())
}
defer file.Close()
data, err := ioutil.ReadAll(file)
if err != nil {
framework.Failf(err.Error())