Skip to content

Commit

Permalink
feat: add all sprig functions to templates
Browse files Browse the repository at this point in the history
  • Loading branch information
kync committed Sep 5, 2023
1 parent a760bfd commit 1f01bd3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sensors/dependencies/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ filterData:
}

if f.Template != "" {
tpl, tplErr := template.New("param").Funcs(sprig.HermeticTxtFuncMap()).Parse(f.Template)
tpl, tplErr := template.New("param").Funcs(sprig.FuncMap()).Parse(f.Template)
if tplErr != nil {
if operator == v1alpha1.OrLogicalOperator {
errMessages = append(errMessages, tplErr.Error())
Expand Down
2 changes: 1 addition & 1 deletion sensors/triggers/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ func ResolveParamValue(src *v1alpha1.TriggerParameterSource, events map[string]*
// the raw json bytes and then returns the result or any error
func getValueWithTemplate(value []byte, templString string) (string, error) {
res := gjson.ParseBytes(value)
tpl, err := template.New("param").Funcs(sprig.HermeticTxtFuncMap()).Parse(templString)
tpl, err := template.New("param").Funcs(sprig.FuncMap()).Parse(templString)
if err != nil {
return "", err
}
Expand Down

0 comments on commit 1f01bd3

Please sign in to comment.