diff --git a/pkg/analyze/download.go b/pkg/analyze/download.go index 86465b301..ad0bc08f2 100644 --- a/pkg/analyze/download.go +++ b/pkg/analyze/download.go @@ -114,6 +114,9 @@ func extractTroubleshootBundle(reader io.Reader, destDir string) error { case tar.TypeReg: name := filepath.Join(destDir, header.Name) file, err := os.OpenFile(name, os.O_RDWR|os.O_CREATE, os.FileMode(header.Mode)) + if err != nil { + return err + } _, err = io.Copy(file, tarReader) file.Close() if err != nil {