Skip to content

Commit

Permalink
Log invalid chart dirs to stderr (#290)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
unguiculus authored Oct 29, 2020
1 parent e287de0 commit 2407e7d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/chart/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package chart
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"

Expand Down Expand Up @@ -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)
}
}

Expand Down

0 comments on commit 2407e7d

Please sign in to comment.