Skip to content

Commit

Permalink
Fix #10 - wrong number of args for required
Browse files Browse the repository at this point in the history
Fixes issue reported at #10:
  • Loading branch information
codeclown committed Jan 21, 2024
1 parent ec528b4 commit 03935e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go/lib/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func GetYaml(templateYaml string, valuesYaml string) string {

// If the template contains `required`, we don't want to return an error which
// would prevent previewing the entire template. Simply pass the value through.
funcMap["required"] = func(val interface{}) (interface{}, error) {
funcMap["required"] = func(warn string, val interface{}) (interface{}, error) {
return val, nil
}

Expand Down
2 changes: 1 addition & 1 deletion go/lib/lib_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestGetYaml(t *testing.T) {
expectedReturnValue: `{"yaml":"name: \n first: 1\n second: 2","err":"","warning":""}`,
},
{
templateYaml: "name: {{ .Values.foobar | required }}",
templateYaml: "name: {{ .Values.foobar | required \".foobar must be set\" }}",
valuesYaml: "",
expectedReturnValue: `{"yaml":"name: \u003cno value\u003e","err":"","warning":""}`,
},
Expand Down

0 comments on commit 03935e5

Please sign in to comment.