Clone the vals map for every path to avoid mutation

Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
pull/6241/head
Vibhav Bobade 5 years ago
parent f73e3235c2
commit 7da1f35386

@ -77,6 +77,10 @@ func (l *Lint) Run(paths []string, vals map[string]interface{}) *LintResult {
func lintChart(path string, vals map[string]interface{}, namespace string, strict bool) (support.Linter, error) {
var chartPath string
linter := support.Linter{}
currentVals := make(map[string]interface{}, len(vals))
for key, value := range vals {
currentVals[key] = value
}
if strings.HasSuffix(path, ".tgz") {
tempDir, err := ioutil.TempDir("", "helm-lint")
@ -110,5 +114,5 @@ func lintChart(path string, vals map[string]interface{}, namespace string, stric
return linter, errLintNoChart
}
return lint.All(chartPath, vals, namespace, strict), nil
return lint.All(chartPath, currentVals, namespace, strict), nil
}

Loading…
Cancel
Save