Skip to content

Commit

Permalink
Issue #3843 - Failed to decompress agent image tarball during cluster…
Browse files Browse the repository at this point in the history
… agent auto-upgrade

Signed-off-by: zhangl <[email protected]>
  • Loading branch information
LiilyZhang committed Jul 20, 2023
1 parent 4e01770 commit d94c4f7
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 d94c4f7

Please sign in to comment.