mirror of
https://github.com/netdata/netdata.git
synced 2025-04-24 13:14:11 +00:00
go.d sd fix sprig funcmap (#18658)
This commit is contained in:
parent
723a0a8c7a
commit
c75e5140a9
1 changed files with 4 additions and 4 deletions
|
@ -14,7 +14,9 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func newFuncMap() template.FuncMap {
|
func newFuncMap() template.FuncMap {
|
||||||
custom := map[string]any{
|
fm := sprig.TxtFuncMap()
|
||||||
|
|
||||||
|
extra := map[string]any{
|
||||||
"match": funcMatchAny,
|
"match": funcMatchAny,
|
||||||
"glob": func(value, pattern string, patterns ...string) bool {
|
"glob": func(value, pattern string, patterns ...string) bool {
|
||||||
return funcMatchAny("glob", value, pattern, patterns...)
|
return funcMatchAny("glob", value, pattern, patterns...)
|
||||||
|
@ -25,9 +27,7 @@ func newFuncMap() template.FuncMap {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
fm := sprig.HermeticTxtFuncMap()
|
for name, fn := range extra {
|
||||||
|
|
||||||
for name, fn := range custom {
|
|
||||||
fm[name] = fn
|
fm[name] = fn
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue