diff --git a/pkg/argocd/git.go b/pkg/argocd/git.go index 1764a454..d3216d98 100644 --- a/pkg/argocd/git.go +++ b/pkg/argocd/git.go @@ -291,6 +291,12 @@ func writeOverrides(app *v1alpha1.Application, wbc *WriteBackConfig, gitC git.Cl } } + dir := filepath.Dir(targetFile) + err = os.MkdirAll(dir, 0700) + if err != nil { + return + } + err = os.WriteFile(targetFile, override, 0600) if err != nil { return