Chore: Check errors from Close calls (#29562)

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen
2020-12-03 10:11:14 +01:00
committed by GitHub
parent 3c9310e93c
commit f2b7fbc32a
14 changed files with 109 additions and 33 deletions

View File

@ -49,7 +49,11 @@ func (az *AzureBlobUploader) Upload(ctx context.Context, imageDiskPath string) (
if err != nil {
return "", err
}
defer file.Close()
defer func() {
if err := file.Close(); err != nil {
az.log.Warn("Failed to close file", "path", imageDiskPath, "err", err)
}
}()
randomFileName, err := util.GetRandomString(30)
if err != nil {