From 89ecfdc1268e5b7fbb0a3c0af9d58b50358d9d71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Tue, 6 Feb 2024 22:09:23 +0100 Subject: [PATCH] feat: add api folder (#300) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- Makefile | 3 +-- pkg/apis/{ => policy}/v1alpha1/any.go | 0 pkg/apis/{ => policy}/v1alpha1/any_test.go | 0 pkg/apis/{ => policy}/v1alpha1/assert.go | 0 pkg/apis/{ => policy}/v1alpha1/assertion.go | 0 pkg/apis/{ => policy}/v1alpha1/context_entry.go | 0 pkg/apis/{ => policy}/v1alpha1/doc.go | 0 pkg/apis/{ => policy}/v1alpha1/match.go | 0 pkg/apis/{ => policy}/v1alpha1/validating_policy.go | 0 pkg/apis/{ => policy}/v1alpha1/validating_policy_spec.go | 0 pkg/apis/{ => policy}/v1alpha1/validating_rule.go | 0 pkg/apis/{ => policy}/v1alpha1/zz_generated.deepcopy.go | 0 pkg/apis/{ => policy}/v1alpha1/zz_generated.register.go | 0 pkg/binding/binding.go | 2 +- pkg/client/clientset/versioned/clientset.go | 2 +- .../clientset/versioned/fake/clientset_generated.go | 4 ++-- pkg/client/clientset/versioned/fake/register.go | 2 +- pkg/client/clientset/versioned/scheme/register.go | 2 +- .../versioned/typed/{apis => policy}/v1alpha1/doc.go | 0 .../versioned/typed/{apis => policy}/v1alpha1/fake/doc.go | 0 .../v1alpha1/fake/fake_policy_client.go} | 2 +- .../v1alpha1/fake/fake_validatingpolicy.go | 2 +- .../{apis => policy}/v1alpha1/generated_expansion.go | 0 .../apis_client.go => policy/v1alpha1/policy_client.go} | 2 +- .../typed/{apis => policy}/v1alpha1/validatingpolicy.go | 2 +- pkg/client/informers/externalversions/factory.go | 8 ++++---- pkg/client/informers/externalversions/generic.go | 2 +- .../externalversions/{apis => policy}/interface.go | 4 ++-- .../{apis => policy}/v1alpha1/interface.go | 0 .../{apis => policy}/v1alpha1/validatingpolicy.go | 8 ++++---- .../{apis => policy}/v1alpha1/expansion_generated.go | 0 .../listers/{apis => policy}/v1alpha1/validatingpolicy.go | 2 +- pkg/commands/scan/options.go | 2 +- pkg/commands/serve/provider.go | 2 +- pkg/json-engine/engine.go | 2 +- pkg/matching/match.go | 2 +- pkg/policy/load.go | 2 +- pkg/policy/load_test.go | 2 +- pkg/server/playground/handler.go | 2 +- pkg/server/scan/config.go | 2 +- pkg/server/scan/handler.go | 2 +- website/apis/config.yaml | 2 +- website/catalog/main.go | 2 +- 43 files changed, 34 insertions(+), 35 deletions(-) rename pkg/apis/{ => policy}/v1alpha1/any.go (100%) rename pkg/apis/{ => policy}/v1alpha1/any_test.go (100%) rename pkg/apis/{ => policy}/v1alpha1/assert.go (100%) rename pkg/apis/{ => policy}/v1alpha1/assertion.go (100%) rename pkg/apis/{ => policy}/v1alpha1/context_entry.go (100%) rename pkg/apis/{ => policy}/v1alpha1/doc.go (100%) rename pkg/apis/{ => policy}/v1alpha1/match.go (100%) rename pkg/apis/{ => policy}/v1alpha1/validating_policy.go (100%) rename pkg/apis/{ => policy}/v1alpha1/validating_policy_spec.go (100%) rename pkg/apis/{ => policy}/v1alpha1/validating_rule.go (100%) rename pkg/apis/{ => policy}/v1alpha1/zz_generated.deepcopy.go (100%) rename pkg/apis/{ => policy}/v1alpha1/zz_generated.register.go (100%) rename pkg/client/clientset/versioned/typed/{apis => policy}/v1alpha1/doc.go (100%) rename pkg/client/clientset/versioned/typed/{apis => policy}/v1alpha1/fake/doc.go (100%) rename pkg/client/clientset/versioned/typed/{apis/v1alpha1/fake/fake_apis_client.go => policy/v1alpha1/fake/fake_policy_client.go} (97%) rename pkg/client/clientset/versioned/typed/{apis => policy}/v1alpha1/fake/fake_validatingpolicy.go (98%) rename pkg/client/clientset/versioned/typed/{apis => policy}/v1alpha1/generated_expansion.go (100%) rename pkg/client/clientset/versioned/typed/{apis/v1alpha1/apis_client.go => policy/v1alpha1/policy_client.go} (97%) rename pkg/client/clientset/versioned/typed/{apis => policy}/v1alpha1/validatingpolicy.go (98%) rename pkg/client/informers/externalversions/{apis => policy}/interface.go (97%) rename pkg/client/informers/externalversions/{apis => policy}/v1alpha1/interface.go (100%) rename pkg/client/informers/externalversions/{apis => policy}/v1alpha1/validatingpolicy.go (92%) rename pkg/client/listers/{apis => policy}/v1alpha1/expansion_generated.go (100%) rename pkg/client/listers/{apis => policy}/v1alpha1/validatingpolicy.go (97%) diff --git a/Makefile b/Makefile index a00a7acc..63081002 100644 --- a/Makefile +++ b/Makefile @@ -148,9 +148,8 @@ ko-build: $(KO) ## Build image (with ko) GOPATH_SHIM := ${PWD}/.gopath PACKAGE_SHIM := $(GOPATH_SHIM)/src/$(PACKAGE) -INPUT_DIRS := $(PACKAGE)/pkg/apis/v1alpha1 +INPUT_DIRS := $(PACKAGE)/pkg/apis/policy/v1alpha1 CRDS_PATH := ${PWD}/.crds -INPUT_DIRS := $(PACKAGE)/pkg/apis/v1alpha1 OUT_PACKAGE := $(PACKAGE)/pkg/client CLIENTSET_PACKAGE := $(OUT_PACKAGE)/clientset LISTERS_PACKAGE := $(OUT_PACKAGE)/listers diff --git a/pkg/apis/v1alpha1/any.go b/pkg/apis/policy/v1alpha1/any.go similarity index 100% rename from pkg/apis/v1alpha1/any.go rename to pkg/apis/policy/v1alpha1/any.go diff --git a/pkg/apis/v1alpha1/any_test.go b/pkg/apis/policy/v1alpha1/any_test.go similarity index 100% rename from pkg/apis/v1alpha1/any_test.go rename to pkg/apis/policy/v1alpha1/any_test.go diff --git a/pkg/apis/v1alpha1/assert.go b/pkg/apis/policy/v1alpha1/assert.go similarity index 100% rename from pkg/apis/v1alpha1/assert.go rename to pkg/apis/policy/v1alpha1/assert.go diff --git a/pkg/apis/v1alpha1/assertion.go b/pkg/apis/policy/v1alpha1/assertion.go similarity index 100% rename from pkg/apis/v1alpha1/assertion.go rename to pkg/apis/policy/v1alpha1/assertion.go diff --git a/pkg/apis/v1alpha1/context_entry.go b/pkg/apis/policy/v1alpha1/context_entry.go similarity index 100% rename from pkg/apis/v1alpha1/context_entry.go rename to pkg/apis/policy/v1alpha1/context_entry.go diff --git a/pkg/apis/v1alpha1/doc.go b/pkg/apis/policy/v1alpha1/doc.go similarity index 100% rename from pkg/apis/v1alpha1/doc.go rename to pkg/apis/policy/v1alpha1/doc.go diff --git a/pkg/apis/v1alpha1/match.go b/pkg/apis/policy/v1alpha1/match.go similarity index 100% rename from pkg/apis/v1alpha1/match.go rename to pkg/apis/policy/v1alpha1/match.go diff --git a/pkg/apis/v1alpha1/validating_policy.go b/pkg/apis/policy/v1alpha1/validating_policy.go similarity index 100% rename from pkg/apis/v1alpha1/validating_policy.go rename to pkg/apis/policy/v1alpha1/validating_policy.go diff --git a/pkg/apis/v1alpha1/validating_policy_spec.go b/pkg/apis/policy/v1alpha1/validating_policy_spec.go similarity index 100% rename from pkg/apis/v1alpha1/validating_policy_spec.go rename to pkg/apis/policy/v1alpha1/validating_policy_spec.go diff --git a/pkg/apis/v1alpha1/validating_rule.go b/pkg/apis/policy/v1alpha1/validating_rule.go similarity index 100% rename from pkg/apis/v1alpha1/validating_rule.go rename to pkg/apis/policy/v1alpha1/validating_rule.go diff --git a/pkg/apis/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/policy/v1alpha1/zz_generated.deepcopy.go similarity index 100% rename from pkg/apis/v1alpha1/zz_generated.deepcopy.go rename to pkg/apis/policy/v1alpha1/zz_generated.deepcopy.go diff --git a/pkg/apis/v1alpha1/zz_generated.register.go b/pkg/apis/policy/v1alpha1/zz_generated.register.go similarity index 100% rename from pkg/apis/v1alpha1/zz_generated.register.go rename to pkg/apis/policy/v1alpha1/zz_generated.register.go diff --git a/pkg/binding/binding.go b/pkg/binding/binding.go index 5d638f7e..e9f3c5cd 100644 --- a/pkg/binding/binding.go +++ b/pkg/binding/binding.go @@ -2,7 +2,7 @@ package binding import ( "github.com/jmespath-community/go-jmespath/pkg/binding" - "github.com/kyverno/kyverno-json/pkg/apis/v1alpha1" + "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1" "github.com/kyverno/kyverno-json/pkg/engine/assert" "k8s.io/apimachinery/pkg/util/validation/field" ) diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 0fdd5991..b7f88b0b 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -22,7 +22,7 @@ import ( "fmt" "net/http" - jsonv1alpha1 "github.com/kyverno/kyverno-json/pkg/client/clientset/versioned/typed/apis/v1alpha1" + jsonv1alpha1 "github.com/kyverno/kyverno-json/pkg/client/clientset/versioned/typed/policy/v1alpha1" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index 84c4befb..b67670c8 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -20,8 +20,8 @@ package fake import ( clientset "github.com/kyverno/kyverno-json/pkg/client/clientset/versioned" - jsonv1alpha1 "github.com/kyverno/kyverno-json/pkg/client/clientset/versioned/typed/apis/v1alpha1" - fakejsonv1alpha1 "github.com/kyverno/kyverno-json/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake" + jsonv1alpha1 "github.com/kyverno/kyverno-json/pkg/client/clientset/versioned/typed/policy/v1alpha1" + fakejsonv1alpha1 "github.com/kyverno/kyverno-json/pkg/client/clientset/versioned/typed/policy/v1alpha1/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index 800173b1..61ab1ff4 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - jsonv1alpha1 "github.com/kyverno/kyverno-json/pkg/apis/v1alpha1" + jsonv1alpha1 "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index d92cd958..301457ea 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -19,7 +19,7 @@ limitations under the License. package scheme import ( - jsonv1alpha1 "github.com/kyverno/kyverno-json/pkg/apis/v1alpha1" + jsonv1alpha1 "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha1/doc.go b/pkg/client/clientset/versioned/typed/policy/v1alpha1/doc.go similarity index 100% rename from pkg/client/clientset/versioned/typed/apis/v1alpha1/doc.go rename to pkg/client/clientset/versioned/typed/policy/v1alpha1/doc.go diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/doc.go b/pkg/client/clientset/versioned/typed/policy/v1alpha1/fake/doc.go similarity index 100% rename from pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/doc.go rename to pkg/client/clientset/versioned/typed/policy/v1alpha1/fake/doc.go diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_apis_client.go b/pkg/client/clientset/versioned/typed/policy/v1alpha1/fake/fake_policy_client.go similarity index 97% rename from pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_apis_client.go rename to pkg/client/clientset/versioned/typed/policy/v1alpha1/fake/fake_policy_client.go index 510bb68f..f04aaede 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_apis_client.go +++ b/pkg/client/clientset/versioned/typed/policy/v1alpha1/fake/fake_policy_client.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - v1alpha1 "github.com/kyverno/kyverno-json/pkg/client/clientset/versioned/typed/apis/v1alpha1" + v1alpha1 "github.com/kyverno/kyverno-json/pkg/client/clientset/versioned/typed/policy/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_validatingpolicy.go b/pkg/client/clientset/versioned/typed/policy/v1alpha1/fake/fake_validatingpolicy.go similarity index 98% rename from pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_validatingpolicy.go rename to pkg/client/clientset/versioned/typed/policy/v1alpha1/fake/fake_validatingpolicy.go index 837362a7..a258a380 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha1/fake/fake_validatingpolicy.go +++ b/pkg/client/clientset/versioned/typed/policy/v1alpha1/fake/fake_validatingpolicy.go @@ -21,7 +21,7 @@ package fake import ( "context" - v1alpha1 "github.com/kyverno/kyverno-json/pkg/apis/v1alpha1" + v1alpha1 "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha1/generated_expansion.go b/pkg/client/clientset/versioned/typed/policy/v1alpha1/generated_expansion.go similarity index 100% rename from pkg/client/clientset/versioned/typed/apis/v1alpha1/generated_expansion.go rename to pkg/client/clientset/versioned/typed/policy/v1alpha1/generated_expansion.go diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha1/apis_client.go b/pkg/client/clientset/versioned/typed/policy/v1alpha1/policy_client.go similarity index 97% rename from pkg/client/clientset/versioned/typed/apis/v1alpha1/apis_client.go rename to pkg/client/clientset/versioned/typed/policy/v1alpha1/policy_client.go index 3bf3c4df..fa473fe5 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha1/apis_client.go +++ b/pkg/client/clientset/versioned/typed/policy/v1alpha1/policy_client.go @@ -21,7 +21,7 @@ package v1alpha1 import ( "net/http" - v1alpha1 "github.com/kyverno/kyverno-json/pkg/apis/v1alpha1" + v1alpha1 "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1" "github.com/kyverno/kyverno-json/pkg/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha1/validatingpolicy.go b/pkg/client/clientset/versioned/typed/policy/v1alpha1/validatingpolicy.go similarity index 98% rename from pkg/client/clientset/versioned/typed/apis/v1alpha1/validatingpolicy.go rename to pkg/client/clientset/versioned/typed/policy/v1alpha1/validatingpolicy.go index 77be4157..be691551 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha1/validatingpolicy.go +++ b/pkg/client/clientset/versioned/typed/policy/v1alpha1/validatingpolicy.go @@ -22,7 +22,7 @@ import ( "context" "time" - v1alpha1 "github.com/kyverno/kyverno-json/pkg/apis/v1alpha1" + v1alpha1 "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1" scheme "github.com/kyverno/kyverno-json/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index 22f8a677..5b77e063 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -24,8 +24,8 @@ import ( time "time" versioned "github.com/kyverno/kyverno-json/pkg/client/clientset/versioned" - apis "github.com/kyverno/kyverno-json/pkg/client/informers/externalversions/apis" internalinterfaces "github.com/kyverno/kyverno-json/pkg/client/informers/externalversions/internalinterfaces" + policy "github.com/kyverno/kyverno-json/pkg/client/informers/externalversions/policy" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -243,9 +243,9 @@ type SharedInformerFactory interface { // client. InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer - Json() apis.Interface + Json() policy.Interface } -func (f *sharedInformerFactory) Json() apis.Interface { - return apis.New(f, f.namespace, f.tweakListOptions) +func (f *sharedInformerFactory) Json() policy.Interface { + return policy.New(f, f.namespace, f.tweakListOptions) } diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index b72a7c1e..ccc84900 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -21,7 +21,7 @@ package externalversions import ( "fmt" - v1alpha1 "github.com/kyverno/kyverno-json/pkg/apis/v1alpha1" + v1alpha1 "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" ) diff --git a/pkg/client/informers/externalversions/apis/interface.go b/pkg/client/informers/externalversions/policy/interface.go similarity index 97% rename from pkg/client/informers/externalversions/apis/interface.go rename to pkg/client/informers/externalversions/policy/interface.go index d36004d6..94e203f5 100644 --- a/pkg/client/informers/externalversions/apis/interface.go +++ b/pkg/client/informers/externalversions/policy/interface.go @@ -16,11 +16,11 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package apis +package policy import ( - v1alpha1 "github.com/kyverno/kyverno-json/pkg/client/informers/externalversions/apis/v1alpha1" internalinterfaces "github.com/kyverno/kyverno-json/pkg/client/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/kyverno/kyverno-json/pkg/client/informers/externalversions/policy/v1alpha1" ) // Interface provides access to each of this group's versions. diff --git a/pkg/client/informers/externalversions/apis/v1alpha1/interface.go b/pkg/client/informers/externalversions/policy/v1alpha1/interface.go similarity index 100% rename from pkg/client/informers/externalversions/apis/v1alpha1/interface.go rename to pkg/client/informers/externalversions/policy/v1alpha1/interface.go diff --git a/pkg/client/informers/externalversions/apis/v1alpha1/validatingpolicy.go b/pkg/client/informers/externalversions/policy/v1alpha1/validatingpolicy.go similarity index 92% rename from pkg/client/informers/externalversions/apis/v1alpha1/validatingpolicy.go rename to pkg/client/informers/externalversions/policy/v1alpha1/validatingpolicy.go index 13063100..6423ee7c 100644 --- a/pkg/client/informers/externalversions/apis/v1alpha1/validatingpolicy.go +++ b/pkg/client/informers/externalversions/policy/v1alpha1/validatingpolicy.go @@ -22,10 +22,10 @@ import ( "context" time "time" - apisv1alpha1 "github.com/kyverno/kyverno-json/pkg/apis/v1alpha1" + policyv1alpha1 "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1" versioned "github.com/kyverno/kyverno-json/pkg/client/clientset/versioned" internalinterfaces "github.com/kyverno/kyverno-json/pkg/client/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/kyverno/kyverno-json/pkg/client/listers/apis/v1alpha1" + v1alpha1 "github.com/kyverno/kyverno-json/pkg/client/listers/policy/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -70,7 +70,7 @@ func NewFilteredValidatingPolicyInformer(client versioned.Interface, resyncPerio return client.JsonV1alpha1().ValidatingPolicies().Watch(context.TODO(), options) }, }, - &apisv1alpha1.ValidatingPolicy{}, + &policyv1alpha1.ValidatingPolicy{}, resyncPeriod, indexers, ) @@ -81,7 +81,7 @@ func (f *validatingPolicyInformer) defaultInformer(client versioned.Interface, r } func (f *validatingPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisv1alpha1.ValidatingPolicy{}, f.defaultInformer) + return f.factory.InformerFor(&policyv1alpha1.ValidatingPolicy{}, f.defaultInformer) } func (f *validatingPolicyInformer) Lister() v1alpha1.ValidatingPolicyLister { diff --git a/pkg/client/listers/apis/v1alpha1/expansion_generated.go b/pkg/client/listers/policy/v1alpha1/expansion_generated.go similarity index 100% rename from pkg/client/listers/apis/v1alpha1/expansion_generated.go rename to pkg/client/listers/policy/v1alpha1/expansion_generated.go diff --git a/pkg/client/listers/apis/v1alpha1/validatingpolicy.go b/pkg/client/listers/policy/v1alpha1/validatingpolicy.go similarity index 97% rename from pkg/client/listers/apis/v1alpha1/validatingpolicy.go rename to pkg/client/listers/policy/v1alpha1/validatingpolicy.go index d73d5d4a..291506ee 100644 --- a/pkg/client/listers/apis/v1alpha1/validatingpolicy.go +++ b/pkg/client/listers/policy/v1alpha1/validatingpolicy.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha1 import ( - v1alpha1 "github.com/kyverno/kyverno-json/pkg/apis/v1alpha1" + v1alpha1 "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/commands/scan/options.go b/pkg/commands/scan/options.go index 715c3d28..027d1258 100644 --- a/pkg/commands/scan/options.go +++ b/pkg/commands/scan/options.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "github.com/kyverno/kyverno-json/pkg/apis/v1alpha1" + "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1" "github.com/kyverno/kyverno-json/pkg/engine/template" jsonengine "github.com/kyverno/kyverno-json/pkg/json-engine" "github.com/kyverno/kyverno-json/pkg/payload" diff --git a/pkg/commands/serve/provider.go b/pkg/commands/serve/provider.go index 95b90303..4489a9ed 100644 --- a/pkg/commands/serve/provider.go +++ b/pkg/commands/serve/provider.go @@ -3,7 +3,7 @@ package serve import ( "context" - "github.com/kyverno/kyverno-json/pkg/apis/v1alpha1" + "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1" "github.com/kyverno/kyverno-json/pkg/client/clientset/versioned" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/pkg/json-engine/engine.go b/pkg/json-engine/engine.go index 3d5afb27..f5c70c0e 100644 --- a/pkg/json-engine/engine.go +++ b/pkg/json-engine/engine.go @@ -5,7 +5,7 @@ import ( "fmt" jpbinding "github.com/jmespath-community/go-jmespath/pkg/binding" - "github.com/kyverno/kyverno-json/pkg/apis/v1alpha1" + "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1" "github.com/kyverno/kyverno-json/pkg/binding" "github.com/kyverno/kyverno-json/pkg/engine" "github.com/kyverno/kyverno-json/pkg/engine/builder" diff --git a/pkg/matching/match.go b/pkg/matching/match.go index 19eb1306..de499cc3 100644 --- a/pkg/matching/match.go +++ b/pkg/matching/match.go @@ -5,7 +5,7 @@ import ( "errors" "github.com/jmespath-community/go-jmespath/pkg/binding" - "github.com/kyverno/kyverno-json/pkg/apis/v1alpha1" + "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1" "github.com/kyverno/kyverno-json/pkg/engine/assert" "github.com/kyverno/kyverno-json/pkg/engine/template" "k8s.io/apimachinery/pkg/util/validation/field" diff --git a/pkg/policy/load.go b/pkg/policy/load.go index 3d6c381d..6cdd8ecc 100644 --- a/pkg/policy/load.go +++ b/pkg/policy/load.go @@ -6,7 +6,7 @@ import ( "os" "path/filepath" - "github.com/kyverno/kyverno-json/pkg/apis/v1alpha1" + "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1" "github.com/kyverno/kyverno-json/pkg/data" fileinfo "github.com/kyverno/kyverno/ext/file-info" "github.com/kyverno/kyverno/ext/resource/convert" diff --git a/pkg/policy/load_test.go b/pkg/policy/load_test.go index 0193e242..a5eefa9d 100644 --- a/pkg/policy/load_test.go +++ b/pkg/policy/load_test.go @@ -4,7 +4,7 @@ import ( "path/filepath" "testing" - "github.com/kyverno/kyverno-json/pkg/apis/v1alpha1" + "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1" "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/pkg/server/playground/handler.go b/pkg/server/playground/handler.go index 773562a6..96adfcdf 100644 --- a/pkg/server/playground/handler.go +++ b/pkg/server/playground/handler.go @@ -7,7 +7,7 @@ import ( "net/http" "github.com/gin-gonic/gin" - "github.com/kyverno/kyverno-json/pkg/apis/v1alpha1" + "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1" "github.com/kyverno/kyverno-json/pkg/engine/template" jsonengine "github.com/kyverno/kyverno-json/pkg/json-engine" "github.com/kyverno/kyverno-json/pkg/server/model" diff --git a/pkg/server/scan/config.go b/pkg/server/scan/config.go index c9dbee31..36d53b7d 100644 --- a/pkg/server/scan/config.go +++ b/pkg/server/scan/config.go @@ -1,7 +1,7 @@ package scan import ( - "github.com/kyverno/kyverno-json/pkg/apis/v1alpha1" + "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1" ) type PolicyProvider interface { diff --git a/pkg/server/scan/handler.go b/pkg/server/scan/handler.go index 7c45e5dc..ef277012 100644 --- a/pkg/server/scan/handler.go +++ b/pkg/server/scan/handler.go @@ -7,7 +7,7 @@ import ( "net/http" "github.com/gin-gonic/gin" - "github.com/kyverno/kyverno-json/pkg/apis/v1alpha1" + "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1" "github.com/kyverno/kyverno-json/pkg/engine/template" jsonengine "github.com/kyverno/kyverno-json/pkg/json-engine" "github.com/kyverno/kyverno-json/pkg/server/model" diff --git a/website/apis/config.yaml b/website/apis/config.yaml index 053d90e0..f6cfcc6a 100644 --- a/website/apis/config.yaml +++ b/website/apis/config.yaml @@ -38,4 +38,4 @@ apis: - name: kyverno-json title: KyvernoJson (v1alpha1) package: github.com/kyverno/kyverno-json - path: pkg/apis/v1alpha1 + path: pkg/apis/policy/v1alpha1 diff --git a/website/catalog/main.go b/website/catalog/main.go index 4d150cd9..7a32429f 100644 --- a/website/catalog/main.go +++ b/website/catalog/main.go @@ -8,7 +8,7 @@ import ( "strings" "text/template" - "github.com/kyverno/kyverno-json/pkg/apis/v1alpha1" + "github.com/kyverno/kyverno-json/pkg/apis/policy/v1alpha1" "github.com/kyverno/kyverno-json/pkg/catalog" "github.com/kyverno/kyverno-json/pkg/policy" fileinfo "github.com/kyverno/kyverno/ext/file-info"