From a323eca59ec9c5ea9e42ab9b3ffc1029c6858986 Mon Sep 17 00:00:00 2001 From: Dong Gang Date: Tue, 28 Jul 2020 09:54:27 +0800 Subject: [PATCH] fix(template): Correct the error of helm/template Signed-off-by: Dong Gang --- pkg/action/action.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/action/action.go b/pkg/action/action.go index fec86cd42..68c3659fc 100644 --- a/pkg/action/action.go +++ b/pkg/action/action.go @@ -183,7 +183,11 @@ func (c *Configuration) renderResources(ch *chart.Chart, values chartutil.Values if outputDir == "" { fmt.Fprintf(b, "---\n# Source: %s\n%s\n", crd.Name, string(crd.File.Data[:])) } else { - err = writeToFile(outputDir, crd.Filename, string(crd.File.Data[:]), fileWritten[crd.Name]) + newDir := outputDir + if useReleaseName { + newDir = filepath.Join(outputDir, releaseName) + } + err = writeToFile(newDir, crd.Filename, string(crd.File.Data[:]), fileWritten[crd.Name]) if err != nil { return hs, b, "", err }