Merge pull request #11973 from joejulian/quiet_lint

fail quiet linting when an error occurs
pull/11204/head
Matt Farina 2 years ago committed by GitHub
commit 9705369da6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -53,6 +53,11 @@ func TestLintCmdWithQuietFlag(t *testing.T) {
name: "lint chart with warning using --quiet flag", name: "lint chart with warning using --quiet flag",
cmd: "lint --quiet testdata/testcharts/chart-with-only-crds", cmd: "lint --quiet testdata/testcharts/chart-with-only-crds",
golden: "output/lint-quiet-with-warning.txt", golden: "output/lint-quiet-with-warning.txt",
}, {
name: "lint non-existent chart using --quiet flag",
cmd: "lint --quiet thischartdoesntexist/",
golden: "",
wantError: true,
}} }}
runTestCmd(t, tests) runTestCmd(t, tests)

@ -82,7 +82,7 @@ func HasWarningsOrErrors(result *LintResult) bool {
return true return true
} }
} }
return false return len(result.Errors) > 0
} }
func lintChart(path string, vals map[string]interface{}, namespace string, strict bool) (support.Linter, error) { func lintChart(path string, vals map[string]interface{}, namespace string, strict bool) (support.Linter, error) {

Loading…
Cancel
Save