Skip to content

Commit

Permalink
Merge pull request #3844 from LiilyZhang/zhangl/Issue3843
Browse files Browse the repository at this point in the history
Issue #3843 - Failed to decompress agent image tarball du…
  • Loading branch information
LiilyZhang authored Jul 20, 2023
2 parents 4e01770 + d94c4f7 commit d5eee60
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions clusterupgrade/cluster_install_files.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,13 @@ func decompress(tarGZFilePath, targetFolder string) error {
}
defer uncompressStream.Close()

// create the target folder if it is not exist
if _, err := os.Stat(targetFolder); err != nil {
if err := os.MkdirAll(targetFolder, 0755); err != nil {
return err
}
}

tarReader := tar.NewReader(uncompressStream)
for {
header, err := tarReader.Next()
Expand Down

0 comments on commit d5eee60

Please sign in to comment.