mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 15:25:57 +00:00
Address more comments
This commit is contained in:
parent
5cbca87add
commit
4b5a3ee2e5
@ -124,14 +124,14 @@ func writeFile(fs utilfs.Filesystem, path string, data []byte) (retErr error) {
|
||||
if retErr == nil {
|
||||
retErr = err
|
||||
} else {
|
||||
retErr = fmt.Errorf("failed to close temp file after error %v", retErr)
|
||||
retErr = fmt.Errorf("failed to close temp file after error %v; close error: %v", retErr, err)
|
||||
}
|
||||
}
|
||||
|
||||
// Clean up the temp file on error.
|
||||
if retErr != nil && tmpPath != "" {
|
||||
if err := removePath(fs, tmpPath); err != nil {
|
||||
retErr = fmt.Errorf("failed to remove the temporary file after error %v", retErr)
|
||||
retErr = fmt.Errorf("failed to remove the temporary file (%q) after error %v; remove error: %v", tmpPath, retErr, err)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
Loading…
Reference in New Issue
Block a user