Repository: kyverno/chainsaw
Pull request #279 (2023-10-30 22:55:41)

chore: bump kyverno
Bump kyverno.

codecov[bot]: We're currently processing your upload.  This comment will be updated when the results are available.

Patch:
diff --git a/go.mod b/go.mod
index a26dba67..4dcf758f 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ go 1.21.1
 require (
 	github.com/dustinkirkland/golang-petname v0.0.0-20231002161417-6a283f1aaaf2
 	github.com/kudobuilder/kuttl v0.15.0
-	github.com/kyverno/kyverno v1.5.0-rc1.0.20231029093939-32d16059beb4
+	github.com/kyverno/kyverno v1.5.0-rc1.0.20231030172702-fb530626ba01
 	github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
 	github.com/spf13/cobra v1.7.0
 	github.com/spf13/pflag v1.0.5
diff --git a/go.sum b/go.sum
index 5a50d863..2c6638e0 100644
--- a/go.sum
+++ b/go.sum
@@ -134,8 +134,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
 github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
 github.com/kudobuilder/kuttl v0.15.0 h1:OmCbpY3ebn+myJaatD+IT1AL1OTz34+Cv6ettiXd/hI=
 github.com/kudobuilder/kuttl v0.15.0/go.mod h1:UtAOt+GE8HQZFveEN8p1fk3j+H1Cp5Fk1eMdQkXPqH0=
-github.com/kyverno/kyverno v1.5.0-rc1.0.20231029093939-32d16059beb4 h1:uOiXbeGbqCmLCQURoDUCEMGz7TzKPth/oq1B3RK+L0k=
-github.com/kyverno/kyverno v1.5.0-rc1.0.20231029093939-32d16059beb4/go.mod h1:9Fdii26pII6fE5aQzJouIKL7vyzlAfSaCFaj+/UIoP8=
+github.com/kyverno/kyverno v1.5.0-rc1.0.20231030172702-fb530626ba01 h1:iT3OcLl6IheQF39GS7shfymQZWpPJN2g44U84O5Eg0o=
+github.com/kyverno/kyverno v1.5.0-rc1.0.20231030172702-fb530626ba01/go.mod h1:7xUP44fM7wqxoOzj42QejrGplnQewM5rB41SNkbfOfQ=
 github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
 github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
 github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
diff --git a/pkg/config/load.go b/pkg/config/load.go
index e33f00c5..1f81b3c2 100644
--- a/pkg/config/load.go
+++ b/pkg/config/load.go
@@ -8,8 +8,8 @@ import (
 
 	"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
 	"github.com/kyverno/chainsaw/pkg/data"
-	"github.com/kyverno/chainsaw/pkg/utils/loader"
 	"github.com/kyverno/kyverno/ext/resource/convert"
+	"github.com/kyverno/kyverno/ext/resource/loader"
 	"github.com/kyverno/kyverno/ext/yaml"
 	"sigs.k8s.io/kubectl-validate/pkg/openapiclient"
 )
diff --git a/pkg/step/load.go b/pkg/step/load.go
index 3a73e8d9..652191ce 100644
--- a/pkg/step/load.go
+++ b/pkg/step/load.go
@@ -7,8 +7,8 @@ import (
 
 	"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
 	"github.com/kyverno/chainsaw/pkg/data"
-	"github.com/kyverno/chainsaw/pkg/utils/loader"
 	"github.com/kyverno/kyverno/ext/resource/convert"
+	"github.com/kyverno/kyverno/ext/resource/loader"
 	"github.com/kyverno/kyverno/ext/yaml"
 	"sigs.k8s.io/kubectl-validate/pkg/openapiclient"
 )
diff --git a/pkg/utils/loader/loader.go b/pkg/utils/loader/loader.go
deleted file mode 100644
index 5784e8e0..00000000
--- a/pkg/utils/loader/loader.go
+++ /dev/null
@@ -1,39 +0,0 @@
-package loader
-
-import (
-	"fmt"
-
-	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
-	"k8s.io/apimachinery/pkg/runtime/schema"
-	"k8s.io/client-go/openapi"
-	"sigs.k8s.io/kubectl-validate/pkg/validator"
-)
-
-type Loader interface {
-	Load([]byte) (schema.GroupVersionKind, unstructured.Unstructured, error)
-}
-
-type loader struct {
-	validator *validator.Validator
-}
-
-func New(client openapi.Client) (Loader, error) {
-	factory, err := validator.New(client)
-	if err != nil {
-		return nil, err
-	}
-	return &loader{
-		validator: factory,
-	}, nil
-}
-
-func (l *loader) Load(document []byte) (schema.GroupVersionKind, unstructured.Unstructured, error) {
-	gvk, result, err := l.validator.Parse(document)
-	if err != nil {
-		return gvk, unstructured.Unstructured{}, fmt.Errorf("failed to parse document (%w)", err)
-	}
-	if err := l.validator.Validate(result); err != nil {
-		return gvk, unstructured.Unstructured{}, fmt.Errorf("failed to validate resource (%w)", err)
-	}
-	return gvk, *result, nil
-}


Test patch:
diff --git a/pkg/test/load.go b/pkg/test/load.go
index 81d9fcca..318188fc 100644
--- a/pkg/test/load.go
+++ b/pkg/test/load.go
@@ -7,8 +7,8 @@ import (
 
 	"github.com/kyverno/chainsaw/pkg/apis/v1alpha1"
 	"github.com/kyverno/chainsaw/pkg/data"
-	"github.com/kyverno/chainsaw/pkg/utils/loader"
 	"github.com/kyverno/kyverno/ext/resource/convert"
+	"github.com/kyverno/kyverno/ext/resource/loader"
 	"github.com/kyverno/kyverno/ext/yaml"
 	"sigs.k8s.io/kubectl-validate/pkg/openapiclient"
 )