1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-09 01:16:55 +00:00
kyverno/pkg/engine/jmespath/new.go
Charles-Edouard Brétéché dbbdc1b96c
feat: add image_normalize filter (#6911)
* 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>
2023-04-13 16:13:40 +00:00

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
}