mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
Merge pull request #46221 from FengyunPan/close-file
Automatic merge from submit-queue Close file after os.Open() None
This commit is contained in:
commit
e6c74bbaaf
@ -99,6 +99,7 @@ func setupProviderConfig() error {
|
|||||||
framework.Logf("Couldn't open cloud provider configuration %s: %#v",
|
framework.Logf("Couldn't open cloud provider configuration %s: %#v",
|
||||||
cloudConfig.ConfigFile, err)
|
cloudConfig.ConfigFile, err)
|
||||||
}
|
}
|
||||||
|
defer config.Close()
|
||||||
cloudConfig.Provider, err = azure.NewCloud(config)
|
cloudConfig.Provider, err = azure.NewCloud(config)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2013,6 +2013,7 @@ func newStreamingUpload(filePath string) (*io.PipeReader, *multipart.Writer, err
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
defer file.Close()
|
||||||
|
|
||||||
r, w := io.Pipe()
|
r, w := io.Pipe()
|
||||||
|
|
||||||
|
@ -372,6 +372,7 @@ func injectLog(file string, timestamp time.Time, log string, num int) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
defer f.Close()
|
||||||
for i := 0; i < num; i++ {
|
for i := 0; i < num; i++ {
|
||||||
_, err := f.WriteString(fmt.Sprintf("%s kernel: [0.000000] %s\n", timestamp.Format(time.Stamp), log))
|
_, err := f.WriteString(fmt.Sprintf("%s kernel: [0.000000] %s\n", timestamp.Format(time.Stamp), log))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user