diff --git a/tools/terraform-bundle/package.go b/tools/terraform-bundle/package.go index c705272b4..b21626aa5 100644 --- a/tools/terraform-bundle/package.go +++ b/tools/terraform-bundle/package.go @@ -36,7 +36,6 @@ func CopyFile(src, dst string) (err error) { } dfi, err := os.Stat(dst) if err != nil { - os.Chmod(dst, sfi.Mode()) if !os.IsNotExist(err) { return } @@ -52,6 +51,7 @@ func CopyFile(src, dst string) (err error) { return } err = copyFileContents(src, dst) + os.Chmod(dst, sfi.Mode()) return }