Merge pull request #3783 from RyanHartje/fail_lint_when_chart_yaml_missing

return a non 0 exit code when lint fails due to missing Chart.yaml
pull/3840/head
Taylor Thomas 6 years ago committed by GitHub
commit 6a649134e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -101,6 +101,9 @@ func (l *lintCmd) run() error {
if linter, err := lintChart(path, rvals, l.namespace, l.strict); err != nil {
fmt.Println("==> Skipping", path)
fmt.Println(err)
if err == errLintNoChart {
failures = failures + 1
}
} else {
fmt.Println("==> Linting", path)

@ -28,6 +28,7 @@ var (
archivedChartPathWithHyphens = "testdata/testcharts/compressedchart-with-hyphens-0.1.0.tgz"
invalidArchivedChartPath = "testdata/testcharts/invalidcompressedchart0.1.0.tgz"
chartDirPath = "testdata/testcharts/decompressedchart/"
chartMissingManifest = "testdata/testcharts/chart-missing-manifest"
)
func TestLintChart(t *testing.T) {
@ -46,4 +47,8 @@ func TestLintChart(t *testing.T) {
if _, err := lintChart(invalidArchivedChartPath, values, namespace, strict); err == nil {
t.Errorf("Expected a chart parsing error")
}
if _, err := lintChart(chartMissingManifest, values, namespace, strict); err == nil {
t.Errorf("Expected a chart parsing error")
}
}

Loading…
Cancel
Save