Skip to content

Commit

Permalink
close opened files (#2241)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgalsaleh committed Oct 12, 2021
1 parent 7937a70 commit bec7c20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/store/kotsstore/supportbundle_store.go
Expand Up @@ -295,6 +295,7 @@ func (s *KOTSStore) CreateSupportBundle(id string, appID string, archivePath str
if err != nil {
return nil, errors.Wrap(err, "failed to open archive file")
}
defer f.Close()

outputPath := filepath.Join("supportbundles", id, "supportbundle.tar.gz")
err = filestore.GetStore().WriteArchive(outputPath, f)
Expand Down Expand Up @@ -391,6 +392,7 @@ func (s *KOTSStore) UploadSupportBundle(id string, archivePath string, marshalle
if err != nil {
return errors.Wrap(err, "failed to open archive file")
}
defer f.Close()

outputPath := filepath.Join("supportbundles", id, "supportbundle.tar.gz")
err = filestore.GetStore().WriteArchive(outputPath, f)
Expand Down
1 change: 1 addition & 0 deletions pkg/store/kotsstore/version_store.go
Expand Up @@ -211,6 +211,7 @@ func (s *KOTSStore) CreateAppVersionArchive(appID string, sequence int64, archiv
if err != nil {
return errors.Wrap(err, "failed to open archive file")
}
defer f.Close()

outputPath := fmt.Sprintf("%s/%d.tar.gz", appID, sequence)
err = filestore.GetStore().WriteArchive(outputPath, f)
Expand Down

0 comments on commit bec7c20

Please sign in to comment.