From 8cf9e82063642be63b798e0a6209fceb65d65d45 Mon Sep 17 00:00:00 2001 From: Danilo Patrucco Date: Fri, 5 Jul 2024 10:20:15 -0400 Subject: [PATCH] fixed issues in the lint action script Signed-off-by: Danilo Patrucco --- pkg/action/lint.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/action/lint.go b/pkg/action/lint.go index ca497f2b8..6af92afd7 100644 --- a/pkg/action/lint.go +++ b/pkg/action/lint.go @@ -37,8 +37,10 @@ type Lint struct { WithSubcharts bool Quiet bool KubeVersion *chartutil.KubeVersion + IgnoreFilePath string } + // LintResult is the result of Lint type LintResult struct { TotalChartsLinted int @@ -51,7 +53,6 @@ func NewLint() *Lint { return &Lint{} } -// Run executes 'helm Lint' against the given chart. func (l *Lint) Run(paths []string, vals map[string]interface{}) *LintResult { lowestTolerance := support.ErrorSev if l.Strict { @@ -59,7 +60,7 @@ func (l *Lint) Run(paths []string, vals map[string]interface{}) *LintResult { } result := &LintResult{} for _, path := range paths { - linter, err := lintChart(path, vals, l.Namespace, l.KubeVersion) + linter, err := lintChart(path, vals, l.Namespace, l.KubeVersion, l.IgnoreFilePath) if err != nil { result.Errors = append(result.Errors, err) continue @@ -76,7 +77,6 @@ func (l *Lint) Run(paths []string, vals map[string]interface{}) *LintResult { return result } -// HasWarningsOrErrors checks is LintResult has any warnings or errors func HasWarningsOrErrors(result *LintResult) bool { for _, msg := range result.Messages { if msg.Severity > support.InfoSev { @@ -86,7 +86,7 @@ func HasWarningsOrErrors(result *LintResult) bool { return len(result.Errors) > 0 } -func lintChart(path string, vals map[string]interface{}, namespace string, kubeVersion *chartutil.KubeVersion) (support.Linter, error) { +func lintChart(path string, vals map[string]interface{}, namespace string, kubeVersion *chartutil.KubeVersion, ignoreFilePath string) (support.Linter, error) { var chartPath string linter := support.Linter{} @@ -125,5 +125,5 @@ func lintChart(path string, vals map[string]interface{}, namespace string, kubeV return linter, errors.Wrap(err, "unable to check Chart.yaml file in chart") } - return lint.AllWithKubeVersion(chartPath, vals, namespace, kubeVersion), nil + return lint.AllWithKubeVersion(chartPath, vals, namespace, kubeVersion, ignoreFilePath), nil }