From 5af1077e4053b30da1e3ca597b0518b4eec9ae7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20R=C3=BCegg?= Date: Fri, 6 Nov 2020 17:25:01 +0100 Subject: [PATCH] Remove spurious debug output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Log to debug log instead of stdout. Signed-off-by: Simon Rüegg --- cmd/helm/template.go | 2 +- pkg/action/action.go | 4 ++-- pkg/action/install.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/helm/template.go b/cmd/helm/template.go index 6123d29d4..0840cea47 100644 --- a/cmd/helm/template.go +++ b/cmd/helm/template.go @@ -197,7 +197,7 @@ func writeToFile(outputDir string, name string, data string, append bool) error return err } - fmt.Printf("wrote %s\n", outfileName) + debug("wrote %s\n", outfileName) return nil } diff --git a/pkg/action/action.go b/pkg/action/action.go index 79bb4f638..33bb70eff 100644 --- a/pkg/action/action.go +++ b/pkg/action/action.go @@ -186,7 +186,7 @@ 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]) + err = writeToFile(outputDir, crd.Filename, string(crd.File.Data[:]), fileWritten[crd.Name], c.Log) if err != nil { return hs, b, "", err } @@ -207,7 +207,7 @@ func (c *Configuration) renderResources(ch *chart.Chart, values chartutil.Values // output dir is only used by `helm template`. In the next major // release, we should move this logic to template only as it is not // used by install or upgrade - err = writeToFile(newDir, m.Name, m.Content, fileWritten[m.Name]) + err = writeToFile(newDir, m.Name, m.Content, fileWritten[m.Name], c.Log) if err != nil { return hs, b, "", err } diff --git a/pkg/action/install.go b/pkg/action/install.go index caeefca68..3b1ff61aa 100644 --- a/pkg/action/install.go +++ b/pkg/action/install.go @@ -480,7 +480,7 @@ func (i *Install) replaceRelease(rel *release.Release) error { } // write the to /. controls if the file is created or content will be appended -func writeToFile(outputDir string, name string, data string, append bool) error { +func writeToFile(outputDir string, name string, data string, append bool, log DebugLog) error { outfileName := strings.Join([]string{outputDir, name}, string(filepath.Separator)) err := ensureDirectoryForFile(outfileName) @@ -501,7 +501,7 @@ func writeToFile(outputDir string, name string, data string, append bool) error return err } - fmt.Printf("wrote %s\n", outfileName) + log("wrote %s\n", outfileName) return nil }