From 7da1f35386dc0116ab51bcb2d6374356cf87e16a Mon Sep 17 00:00:00 2001 From: Vibhav Bobade Date: Sat, 17 Aug 2019 02:02:16 +0530 Subject: [PATCH] Clone the vals map for every path to avoid mutation Signed-off-by: Vibhav Bobade --- pkg/action/lint.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/action/lint.go b/pkg/action/lint.go index d7ca8cd03..6a0ec1488 100644 --- a/pkg/action/lint.go +++ b/pkg/action/lint.go @@ -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 }