diff --git a/cmd/helm/lint.go b/cmd/helm/lint.go index 6e08f2747..e83026117 100644 --- a/cmd/helm/lint.go +++ b/cmd/helm/lint.go @@ -97,10 +97,14 @@ func (l *lintCmd) run() error { var total int var failures int + rc := 0 for _, path := range l.paths { if linter, err := lintChart(path, rvals, l.namespace, l.strict); err != nil { fmt.Println("==> Skipping", path) fmt.Println(err) + if err == errLintNoChart { + rc = 1 + } } else { fmt.Println("==> Linting", path) @@ -127,6 +131,10 @@ func (l *lintCmd) run() error { fmt.Fprintf(l.out, "%s, no failures\n", msg) + if rc != 0 { + os.Exit(rc) + } + return nil } diff --git a/cmd/helm/lint_test.go b/cmd/helm/lint_test.go index 7f045153c..973af9b63 100644 --- a/cmd/helm/lint_test.go +++ b/cmd/helm/lint_test.go @@ -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") + } }