From d44881ddc096444f210e1f4c3e39f95f80723753 Mon Sep 17 00:00:00 2001 From: yxxhero Date: Sat, 29 Oct 2022 22:05:17 +0800 Subject: [PATCH] fix template --output-dir issue Signed-off-by: yxxhero (cherry picked from commit 1c25a1fadd1f5f11fae9ea85f981ba0947ac97cb) --- cmd/helm/template.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/helm/template.go b/cmd/helm/template.go index ce2be55bc..0ddd0c551 100644 --- a/cmd/helm/template.go +++ b/cmd/helm/template.go @@ -106,11 +106,15 @@ func newTemplateCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { if client.UseReleaseName { newDir = filepath.Join(client.OutputDir, client.ReleaseName) } + _, err := os.Stat(filepath.Join(newDir, m.Path)) + if err == nil { + fileWritten[m.Path] = true + } + err = writeToFile(newDir, m.Path, m.Manifest, fileWritten[m.Path]) if err != nil { return err } - fileWritten[m.Path] = true } }