From 2407e7df462ea3bc85cefd9b5870526bc7806a9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20N=C3=A4gele?= Date: Thu, 29 Oct 2020 15:02:17 +0100 Subject: [PATCH] Log invalid chart dirs to stderr (#290) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If directories are deleted from a chart, ct detects them as invalid chart directories. A log message is printed to stdout which messes up the regular output. In order to fix this, the message is now logged to stderr. *Example:* ``` $ ct list-changed Directory 'charts/mychart/templates/deleted' is not a valid chart directory. Skipping... charts/mychart ``` Signed-off-by: Reinhard Nägele --- pkg/chart/chart.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/chart/chart.go b/pkg/chart/chart.go index 856540d..96b1b7d 100644 --- a/pkg/chart/chart.go +++ b/pkg/chart/chart.go @@ -17,6 +17,7 @@ package chart import ( "fmt" "io/ioutil" + "os" "path/filepath" "strings" @@ -729,7 +730,7 @@ func (t *Testing) ComputeChangedChartDirectories() ([]string, error) { changedChartDirs = append(changedChartDirs, chartDir) } } else { - fmt.Printf("Directory '%s' is not a valid chart directory. Skipping...\n", dir) + fmt.Fprintf(os.Stderr, "Directory '%s' is not a valid chart directory. Skipping...\n", dir) } }