Merge pull request #20823 from nalind/close-that-readcloser

utils: close a couple of ReadClosers
This commit is contained in:
openshift-merge-bot[bot]
2023-11-29 02:18:06 +00:00
committed by GitHub

View File

@ -77,6 +77,7 @@ func TarToFilesystem(source string, tarball *os.File) error {
if err != nil {
return err
}
defer tb.Close()
_, err = io.Copy(tarball, tb)
if err != nil {
return err
@ -98,6 +99,7 @@ func TarChrootToFilesystem(source string, tarball *os.File) error {
if err != nil {
return err
}
defer tb.Close()
_, err = io.Copy(tarball, tb)
if err != nil {
return err