Skip to content

Commit

Permalink
Case sensitive management for input options keys (#435)
Browse files Browse the repository at this point in the history
Signed-off-by: mrizzi <[email protected]>
  • Loading branch information
mrizzi authored Apr 24, 2024
1 parent 280c10a commit 8b6a364
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
22 changes: 22 additions & 0 deletions cmd/verify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
Binary file not shown.

0 comments on commit 8b6a364

Please sign in to comment.