diff --git a/cmd/verify.go b/cmd/verify.go index 829a10c4..6c152f2e 100644 --- a/cmd/verify.go +++ b/cmd/verify.go @@ -110,7 +110,7 @@ func convertToMap(values []string) map[string]interface{} { valueMap := make(map[string]interface{}) for _, val := range values { parts := strings.SplitN(val, "=", 2) - valueMap[strings.ToLower(parts[0])] = parts[1] + valueMap[parts[0]] = parts[1] } return valueMap } diff --git a/cmd/verify_test.go b/cmd/verify_test.go index 3439443d..2938a6fd 100644 --- a/cmd/verify_test.go +++ b/cmd/verify_test.go @@ -114,6 +114,28 @@ func TestCertify(t *testing.T) { require.Contains(t, output.String(), expected) }, }, + { + name: "Should succeed when the chart exists and a chart value is overridden", + args: []string{ + "-e", "helm-lint", + "-S", "replicaCount=2", + "-E", + "../internal/chartverifier/checks/chart-0.1.0-v3.with-additionalproperties-false.tgz", + }, + validateErrorFunc: func(err error) { + require.NoError(t, err) + }, + validateOutputFunc: func(output *bytes.Buffer) { + require.NotEmpty(t, output.String()) + + expected := "results:\n" + + " - check: v1.0/helm-lint\n" + + " type: Mandatory\n" + + " outcome: PASS\n" + + " reason: Helm lint successful\n" + require.Contains(t, output.String(), expected) + }, + }, { name: "Should display JSON certificate when option --output and argument values are given", args: []string{ diff --git a/internal/chartverifier/checks/chart-0.1.0-v3.with-additionalproperties-false.tgz b/internal/chartverifier/checks/chart-0.1.0-v3.with-additionalproperties-false.tgz new file mode 100644 index 00000000..d26bc639 Binary files /dev/null and b/internal/chartverifier/checks/chart-0.1.0-v3.with-additionalproperties-false.tgz differ