mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-09 01:16:55 +00:00
* feat: add image_normalize filter Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * tests Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> --------- Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
17 lines
407 B
Go
17 lines
407 B
Go
package jmespath
|
|
|
|
import (
|
|
gojmespath "github.com/jmespath/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
|
|
}
|