mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-15 17:51:20 +00:00
d79d4a514f
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
16 lines
309 B
Go
16 lines
309 B
Go
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.FunctionEntry)
|
|
}
|
|
return jp, nil
|
|
}
|