mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-06 16:06:56 +00:00
* fix: remove jmespath replace directive Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * master Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> --------- Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> Co-authored-by: shuting <shuting@nirmata.com>
17 lines
406 B
Go
17 lines
406 B
Go
package jmespath
|
|
|
|
import (
|
|
gojmespath "github.com/kyverno/go-jmespath"
|
|
"github.com/kyverno/kyverno/pkg/config"
|
|
)
|
|
|
|
func newJMESPath(configuration config.Configuration, query string) (*gojmespath.JMESPath, error) {
|
|
jp, err := gojmespath.Compile(query)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
for _, function := range GetFunctions(configuration) {
|
|
jp.Register(function.FunctionEntry)
|
|
}
|
|
return jp, nil
|
|
}
|