1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-09 17:37:12 +00:00
kyverno/pkg/engine/jmespath/new.go

19 lines
303 B
Go
Raw Normal View History

package jmespath
import (
gojmespath "github.com/jmespath/go-jmespath"
)
func New(query string) (*gojmespath.JMESPath, error) {
jp, err := gojmespath.Compile(query)
if err != nil {
return nil, err
}
for _, function := range GetFunctions() {
jp.Register(function.Entry)
}
return jp, nil
}