diff --git a/cmd/cli/kubectl-kyverno/jp/parse/parse.go b/cmd/cli/kubectl-kyverno/jp/parse/parse.go index 1e567d385b..619db0642a 100644 --- a/cmd/cli/kubectl-kyverno/jp/parse/parse.go +++ b/cmd/cli/kubectl-kyverno/jp/parse/parse.go @@ -7,7 +7,7 @@ import ( "path/filepath" "strings" - gojmespath "github.com/jmespath/go-jmespath" + gojmespath "github.com/kyverno/go-jmespath" "github.com/spf13/cobra" ) diff --git a/cmd/cli/kubectl-kyverno/jp/query/query.go b/cmd/cli/kubectl-kyverno/jp/query/query.go index 2fc95ad7e6..90dff0bf46 100644 --- a/cmd/cli/kubectl-kyverno/jp/query/query.go +++ b/cmd/cli/kubectl-kyverno/jp/query/query.go @@ -9,7 +9,7 @@ import ( "path/filepath" "strings" - gojmespath "github.com/jmespath/go-jmespath" + gojmespath "github.com/kyverno/go-jmespath" "github.com/kyverno/kyverno/pkg/config" "github.com/kyverno/kyverno/pkg/engine/jmespath" "github.com/spf13/cobra" diff --git a/go.mod b/go.mod index bfac68f03a..487ca723a3 100644 --- a/go.mod +++ b/go.mod @@ -23,10 +23,10 @@ require ( github.com/google/go-containerregistry v0.14.1-0.20230425172351-b7c6e9dc3944 github.com/google/go-containerregistry/pkg/authn/kubernetes v0.0.0-20230403180904-b8d1c0a1df12 github.com/in-toto/in-toto-golang v0.6.0 - github.com/jmespath/go-jmespath v0.4.0 github.com/jmoiron/jsonq v0.0.0-20150511023944-e874b168d07e github.com/julienschmidt/httprouter v1.3.0 github.com/kataras/tablewriter v0.0.0-20180708051242-e063d29b7c23 + github.com/kyverno/go-jmespath v0.4.1-0.20230705123211-d067dc3d6613 github.com/lensesio/tableprinter v0.0.0-20201125135848-89e81fc956e7 github.com/notaryproject/notation-core-go v1.0.0-rc.4 github.com/notaryproject/notation-go v1.0.0-rc.6 @@ -226,6 +226,7 @@ require ( github.com/jedisct1/go-minisign v0.0.0-20230211184525-1f273d8dc776 // indirect github.com/jellydator/ttlcache/v2 v2.11.1 // indirect github.com/jinzhu/copier v0.3.5 // indirect + github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect @@ -334,5 +335,3 @@ require ( sigs.k8s.io/release-utils v0.7.3 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect ) - -replace github.com/jmespath/go-jmespath => github.com/kyverno/go-jmespath v0.4.1-0.20230204162932-3ee946b9433d diff --git a/go.sum b/go.sum index d8cd3e4680..da6426a71b 100644 --- a/go.sum +++ b/go.sum @@ -836,6 +836,9 @@ github.com/jingyugao/rowserrcheck v0.0.0-20210315055705-d907ca737bb1/go.mod h1:T github.com/jinzhu/copier v0.3.5 h1:GlvfUwHk62RokgqVNvYsku0TATCF7bAHVwEXoBh3iJg= github.com/jinzhu/copier v0.3.5/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmhodges/clock v1.2.0 h1:eq4kys+NI0PLngzaHEe7AmPT90XMGIEySD1JfV1PDIs= @@ -901,8 +904,10 @@ github.com/kunwardeep/paralleltest v1.0.2/go.mod h1:ZPqNm1fVHPllh5LPVujzbVz1JN2G github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/kyoh86/exportloopref v0.1.8/go.mod h1:1tUcJeiioIs7VWe5gcOObrux3lb66+sBqGZrRkMwPgg= -github.com/kyverno/go-jmespath v0.4.1-0.20230204162932-3ee946b9433d h1:g63VNwOo6yYRY1n3mgF2ou4cjnwyonsIKqnbBM9pTRA= -github.com/kyverno/go-jmespath v0.4.1-0.20230204162932-3ee946b9433d/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/kyverno/go-jmespath v0.4.1-0.20230705123211-d067dc3d6613 h1:M0uOLuCAZydi/vZy7uvNhwaIge0HFMdfqQYOKw7kgnQ= +github.com/kyverno/go-jmespath v0.4.1-0.20230705123211-d067dc3d6613/go.mod h1:yzDHaKovQy16rjN4kFnjF+IdNoN4p1ndw+va6+B8zUU= +github.com/kyverno/go-jmespath/internal/testify v1.5.2-0.20230630133209-945021c749d9 h1:lL311dF3a2aeNibJj8v+uhFU3XkvRHZmCtAdSPOrQYY= +github.com/kyverno/go-jmespath/internal/testify v1.5.2-0.20230630133209-945021c749d9/go.mod h1:XRxUGHIiCy1WYma1CdfdO1WOhIe8dLPTENaZr5D1ex4= github.com/ldez/gomoddirectives v0.2.1/go.mod h1:sGicqkRgBOg//JfpXwkB9Hj0X5RyJ7mlACM5B9f6Me4= github.com/ldez/tagliatelle v0.2.0/go.mod h1:8s6WJQwEYHbKZDsp/LjArytKOG8qaMrKQQ3mFukHs88= github.com/lensesio/tableprinter v0.0.0-20201125135848-89e81fc956e7 h1:k/1ku0yehLCPqERCHkIHMDqDg1R02AcCScRuHbamU3s= diff --git a/pkg/engine/engine.go b/pkg/engine/engine.go index 6449a46c37..3a16657c1d 100644 --- a/pkg/engine/engine.go +++ b/pkg/engine/engine.go @@ -6,7 +6,7 @@ import ( "time" "github.com/go-logr/logr" - gojmespath "github.com/jmespath/go-jmespath" + gojmespath "github.com/kyverno/go-jmespath" kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1" "github.com/kyverno/kyverno/pkg/config" engineapi "github.com/kyverno/kyverno/pkg/engine/api" diff --git a/pkg/engine/handlers/validation/validate_resource.go b/pkg/engine/handlers/validation/validate_resource.go index c46ab2f70f..af4a395538 100644 --- a/pkg/engine/handlers/validation/validate_resource.go +++ b/pkg/engine/handlers/validation/validate_resource.go @@ -7,7 +7,7 @@ import ( "strings" "github.com/go-logr/logr" - gojmespath "github.com/jmespath/go-jmespath" + gojmespath "github.com/kyverno/go-jmespath" kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1" engineapi "github.com/kyverno/kyverno/pkg/engine/api" "github.com/kyverno/kyverno/pkg/engine/handlers" diff --git a/pkg/engine/jmespath/functionentry.go b/pkg/engine/jmespath/functionentry.go index 27eea74d29..cb702fe15d 100644 --- a/pkg/engine/jmespath/functionentry.go +++ b/pkg/engine/jmespath/functionentry.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - gojmespath "github.com/jmespath/go-jmespath" + gojmespath "github.com/kyverno/go-jmespath" ) var ( diff --git a/pkg/engine/jmespath/functionentry_test.go b/pkg/engine/jmespath/functionentry_test.go index 364aff6bcb..b2651adb2d 100644 --- a/pkg/engine/jmespath/functionentry_test.go +++ b/pkg/engine/jmespath/functionentry_test.go @@ -3,7 +3,7 @@ package jmespath import ( "testing" - gojmespath "github.com/jmespath/go-jmespath" + gojmespath "github.com/kyverno/go-jmespath" ) func TestFunctionEntry_String(t *testing.T) { diff --git a/pkg/engine/jmespath/functions.go b/pkg/engine/jmespath/functions.go index d736aa2888..50e0c8dc3f 100644 --- a/pkg/engine/jmespath/functions.go +++ b/pkg/engine/jmespath/functions.go @@ -21,7 +21,7 @@ import ( trunc "github.com/aquilax/truncate" "github.com/blang/semver/v4" - gojmespath "github.com/jmespath/go-jmespath" + gojmespath "github.com/kyverno/go-jmespath" "github.com/kyverno/kyverno/pkg/config" imageutils "github.com/kyverno/kyverno/pkg/utils/image" wildcard "github.com/kyverno/kyverno/pkg/utils/wildcard" diff --git a/pkg/engine/jmespath/new.go b/pkg/engine/jmespath/new.go index cefec5896f..a954b539f3 100644 --- a/pkg/engine/jmespath/new.go +++ b/pkg/engine/jmespath/new.go @@ -1,7 +1,7 @@ package jmespath import ( - gojmespath "github.com/jmespath/go-jmespath" + gojmespath "github.com/kyverno/go-jmespath" "github.com/kyverno/kyverno/pkg/config" ) diff --git a/pkg/engine/variables/errs.go b/pkg/engine/variables/errs.go index 60641434e3..c19b540370 100644 --- a/pkg/engine/variables/errs.go +++ b/pkg/engine/variables/errs.go @@ -1,7 +1,7 @@ package variables import ( - "github.com/jmespath/go-jmespath" + "github.com/kyverno/go-jmespath" enginecontext "github.com/kyverno/kyverno/pkg/engine/context" ) diff --git a/pkg/engine/variables/vars.go b/pkg/engine/variables/vars.go index 67c1e4a10b..bfe33c24f0 100644 --- a/pkg/engine/variables/vars.go +++ b/pkg/engine/variables/vars.go @@ -8,7 +8,7 @@ import ( "strings" "github.com/go-logr/logr" - gojmespath "github.com/jmespath/go-jmespath" + gojmespath "github.com/kyverno/go-jmespath" kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1" "github.com/kyverno/kyverno/pkg/engine/anchor" "github.com/kyverno/kyverno/pkg/engine/context" diff --git a/pkg/validation/policy/validate.go b/pkg/validation/policy/validate.go index e26f8ce71c..049ffadff6 100644 --- a/pkg/validation/policy/validate.go +++ b/pkg/validation/policy/validate.go @@ -12,8 +12,8 @@ import ( "github.com/distribution/distribution/reference" jsonpatch "github.com/evanphx/json-patch/v5" - "github.com/jmespath/go-jmespath" "github.com/jmoiron/jsonq" + "github.com/kyverno/go-jmespath" "github.com/kyverno/kyverno/api/kyverno" kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1" "github.com/kyverno/kyverno/cmd/cli/kubectl-kyverno/utils/common"