diff --git a/cmd/helm/lint.go b/cmd/helm/lint.go index d3e496cda..75a0f3082 100644 --- a/cmd/helm/lint.go +++ b/cmd/helm/lint.go @@ -47,7 +47,10 @@ var lintCommand = &cobra.Command{ RunE: lintCmd, } +var flagStrict bool + func init() { + lintCommand.Flags().BoolVarP(&flagStrict, "strict", "", false, "fail on lint warnings") RootCommand.AddCommand(lintCommand) } @@ -59,6 +62,13 @@ func lintCmd(cmd *cobra.Command, args []string) error { paths = args } + var lowestTolerance int + if flagStrict { + lowestTolerance = support.WarningSev + } else { + lowestTolerance = support.ErrorSev + } + var total int var failures int for _, path := range paths { @@ -77,7 +87,7 @@ func lintCmd(cmd *cobra.Command, args []string) error { } total = total + 1 - if linter.HighestSeverity >= support.ErrorSev { + if linter.HighestSeverity >= lowestTolerance { failures = failures + 1 } }