Skip to content

Commit

Permalink
feat: add all sprig functions to templates (#2768)
Browse files Browse the repository at this point in the history
Signed-off-by: Ali Koyuncu <ali.koyuncu@iceye.fi>
  • Loading branch information
kync committed Sep 7, 2023
1 parent ee126b4 commit 09c27c4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
codegen:
name: Codegen
runs-on: ubuntu-latest
timeout-minutes: 5
timeout-minutes: 7
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down
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 09c27c4

Please sign in to comment.