From 2c9f1228d4bfd67cd7dff6c271ed39e3cc77f97c Mon Sep 17 00:00:00 2001 From: Dave Protasowski Date: Tue, 4 Feb 2025 22:27:57 -0500 Subject: [PATCH 1/9] git add tools for generating clientset, informers, and listers Signed-off-by: Dave Protasowski --- tools/make/tools.mk | 40 ++++++---- tools/src/applyconfiguration-gen/go.mod | 27 +++++++ tools/src/applyconfiguration-gen/go.sum | 97 +++++++++++++++++++++++++ tools/src/applyconfiguration-gen/pin.go | 10 +++ tools/src/client-gen/go.mod | 16 ++++ tools/src/client-gen/go.sum | 20 +++++ tools/src/client-gen/pin.go | 10 +++ tools/src/informer-gen/go.mod | 15 ++++ tools/src/informer-gen/go.sum | 18 +++++ tools/src/informer-gen/pin.go | 10 +++ tools/src/lister-gen/go.mod | 15 ++++ tools/src/lister-gen/go.sum | 18 +++++ tools/src/lister-gen/pin.go | 10 +++ tools/src/openapi-gen/go.mod | 28 +++++++ tools/src/openapi-gen/go.sum | 80 ++++++++++++++++++++ tools/src/openapi-gen/pin.go | 10 +++ tools/src/register-gen/fix.patch | 69 ++++++++++++++++++ tools/src/register-gen/go.mod | 18 +++++ tools/src/register-gen/go.sum | 18 +++++ tools/src/register-gen/pin.go | 5 ++ 20 files changed, 521 insertions(+), 13 deletions(-) create mode 100644 tools/src/applyconfiguration-gen/go.mod create mode 100644 tools/src/applyconfiguration-gen/go.sum create mode 100644 tools/src/applyconfiguration-gen/pin.go create mode 100644 tools/src/client-gen/go.mod create mode 100644 tools/src/client-gen/go.sum create mode 100644 tools/src/client-gen/pin.go create mode 100644 tools/src/informer-gen/go.mod create mode 100644 tools/src/informer-gen/go.sum create mode 100644 tools/src/informer-gen/pin.go create mode 100644 tools/src/lister-gen/go.mod create mode 100644 tools/src/lister-gen/go.sum create mode 100644 tools/src/lister-gen/pin.go create mode 100644 tools/src/openapi-gen/go.mod create mode 100644 tools/src/openapi-gen/go.sum create mode 100644 tools/src/openapi-gen/pin.go create mode 100644 tools/src/register-gen/fix.patch create mode 100644 tools/src/register-gen/go.mod create mode 100644 tools/src/register-gen/go.sum create mode 100644 tools/src/register-gen/pin.go diff --git a/tools/make/tools.mk b/tools/make/tools.mk index 6fee3e59b73..689a62cf6aa 100644 --- a/tools/make/tools.mk +++ b/tools/make/tools.mk @@ -12,22 +12,36 @@ $(tools.bindir)/%: $(tools.srcdir)/%.sh # `go get`-able things # ==================== # -tools/controller-gen = $(tools.bindir)/controller-gen -tools/golangci-lint = $(tools.bindir)/golangci-lint -tools/gci = $(tools.bindir)/gci -tools/kustomize = $(tools.bindir)/kustomize -tools/kind = $(tools.bindir)/kind -tools/setup-envtest = $(tools.bindir)/setup-envtest -tools/crd-ref-docs = $(tools.bindir)/crd-ref-docs -tools/buf = $(tools.bindir)/buf -tools/protoc-gen-go = $(tools.bindir)/protoc-gen-go -tools/protoc-gen-go-grpc = $(tools.bindir)/protoc-gen-go-grpc -tools/helm-docs = $(tools.bindir)/helm-docs -tools/jsonnet = $(tools.bindir)/jsonnet -tools/jb = $(tools.bindir)/jb +tools/applyconfiguration-gen = $(tools.bindir)/applyconfiguration-gen +tools/buf = $(tools.bindir)/buf +tools/client-gen = $(tools.bindir)/client-gen +tools/controller-gen = $(tools.bindir)/controller-gen +tools/crd-ref-docs = $(tools.bindir)/crd-ref-docs +tools/gci = $(tools.bindir)/gci +tools/golangci-lint = $(tools.bindir)/golangci-lint +tools/helm-docs = $(tools.bindir)/helm-docs +tools/informer-gen = $(tools.bindir)/informer-gen +tools/jb = $(tools.bindir)/jb +tools/jsonnet = $(tools.bindir)/jsonnet +tools/kind = $(tools.bindir)/kind +tools/kustomize = $(tools.bindir)/kustomize +tools/lister-gen = $(tools.bindir)/lister-gen +tools/openapi-gen = $(tools.bindir)/openapi-gen +tools/protoc-gen-go = $(tools.bindir)/protoc-gen-go +tools/protoc-gen-go-grpc = $(tools.bindir)/protoc-gen-go-grpc +tools/register-gen = $(tools.bindir)/register-gen +# Override register-gen target with custom behavior +tools/setup-envtest = $(tools.bindir)/setup-envtest $(tools.bindir)/%: $(tools.srcdir)/%/pin.go $(tools.srcdir)/%/go.mod cd $( +Date: Thu, 19 Dec 2024 19:02:34 +0100 +Subject: [PATCH 1/3] Add missing imports in register-gen + +Due to a recent change in k8s.io/gengo/v2, the register-gen is +missing 2 imports.The imports were previously auto inserted during +the code generation by k8s.io/gengo/v2. +Now, instead, they are directly imported by the register-gen. + +An output_tests has been added to register-gen. This generates an +example, which would have been invalid with these changes. + +Signed-off-by: Lionel Jouin + +diff --git a/vendor/k8s.io/code-generator/cmd/register-gen/generators/register_external.go b/vendor/k8s.io/code-generator/cmd/register-gen/generators/register_external.go +index 7eb7793e40879..623d100758e46 100644 +--- a/vendor/k8s.io/code-generator/cmd/register-gen/generators/register_external.go ++++ b/vendor/k8s.io/code-generator/cmd/register-gen/generators/register_external.go +@@ -61,11 +61,15 @@ func (g *registerExternalGenerator) Finalize(context *generator.Context, w io.Wr + + sw := generator.NewSnippetWriter(w, context, "$", "$") + m := map[string]interface{}{ +- "groupName": g.gv.Group, +- "version": g.gv.Version, +- "types": typesToGenerateOnlyNames, +- "addToGroupVersion": context.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "AddToGroupVersion"}), +- "groupVersion": context.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "GroupVersion"}), ++ "groupName": g.gv.Group, ++ "version": g.gv.Version, ++ "types": typesToGenerateOnlyNames, ++ "addToGroupVersion": context.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "AddToGroupVersion"}), ++ "groupVersion": context.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "GroupVersion"}), ++ "schemaGroupVersion": context.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupVersion"}), ++ "schemaGroupResource": context.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupResource"}), ++ "scheme": context.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "Scheme"}), ++ "schemeBuilder": context.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "SchemeBuilder"}), + } + sw.Do(registerExternalTypesTemplate, m) + return sw.Error() +@@ -80,16 +84,16 @@ var GroupVersion = $.groupVersion|raw${Group: GroupName, Version: "$.version$"} + + // SchemeGroupVersion is group version used to register these objects + // Deprecated: use GroupVersion instead. +-var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "$.version$"} ++var SchemeGroupVersion = $.schemaGroupVersion|raw${Group: GroupName, Version: "$.version$"} + + // Resource takes an unqualified resource and returns a Group qualified GroupResource +-func Resource(resource string) schema.GroupResource { ++func Resource(resource string) $.schemaGroupResource|raw$ { + return SchemeGroupVersion.WithResource(resource).GroupResource() + } + + var ( + // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. +- SchemeBuilder runtime.SchemeBuilder ++ SchemeBuilder $.schemeBuilder|raw$ + localSchemeBuilder = &SchemeBuilder + // Deprecated: use Install instead + AddToScheme = localSchemeBuilder.AddToScheme +@@ -104,7 +108,7 @@ func init() { + } + + // Adds the list of known types to Scheme. +-func addKnownTypes(scheme *runtime.Scheme) error { ++func addKnownTypes(scheme *$.scheme|raw$) error { + scheme.AddKnownTypes(SchemeGroupVersion, + $range .types -$ + &$.${}, \ No newline at end of file diff --git a/tools/src/register-gen/go.mod b/tools/src/register-gen/go.mod new file mode 100644 index 00000000000..405a008d27d --- /dev/null +++ b/tools/src/register-gen/go.mod @@ -0,0 +1,18 @@ +module github.com/envoyproxy/gateway/tools/src/register-gen + +go 1.23.5 + +// this is pinned and a patch applied +// https://github.com/kubernetes/code-generator/issues/182 +// Drop patch when this merges https://github.com/kubernetes/kubernetes/pull/129307 +require k8s.io/code-generator v0.32.1 + +require ( + github.com/go-logr/logr v1.4.2 // indirect + github.com/spf13/pflag v1.0.5 // indirect + golang.org/x/mod v0.21.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/tools v0.26.0 // indirect + k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9 // indirect + k8s.io/klog/v2 v2.130.1 // indirect +) diff --git a/tools/src/register-gen/go.sum b/tools/src/register-gen/go.sum new file mode 100644 index 00000000000..2f5c0266168 --- /dev/null +++ b/tools/src/register-gen/go.sum @@ -0,0 +1,18 @@ +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= +golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= +k8s.io/code-generator v0.32.1 h1:4lw1kFNDuFYXquTkB7Sl5EwPMUP2yyW9hh6BnFfRZFY= +k8s.io/code-generator v0.32.1/go.mod h1:zaILfm00CVyP/6/pJMJ3zxRepXkxyDfUV5SNG4CjZI4= +k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9 h1:si3PfKm8dDYxgfbeA6orqrtLkvvIeH8UqffFJDl0bz4= +k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9/go.mod h1:EJykeLsmFC60UQbYJezXkEsG2FLrt0GPNkU5iK5GWxU= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= diff --git a/tools/src/register-gen/pin.go b/tools/src/register-gen/pin.go new file mode 100644 index 00000000000..85723bc7bf6 --- /dev/null +++ b/tools/src/register-gen/pin.go @@ -0,0 +1,5 @@ +//go:build pin + +package ignore + +import _ "k8s.io/code-generator/cmd/register-gen" From 5ed41fc552cfe805831d913169a8bebc6e9ac2a7 Mon Sep 17 00:00:00 2001 From: Dave Protasowski Date: Tue, 4 Feb 2025 22:29:18 -0500 Subject: [PATCH 2/9] drop manual registration and annotate k8s crds types Signed-off-by: Dave Protasowski --- api/v1alpha1/backend_types.go | 5 +---- api/v1alpha1/backendtrafficpolicy_types.go | 5 +---- api/v1alpha1/clienttrafficpolicy_types.go | 5 +---- api/v1alpha1/doc.go | 2 ++ api/v1alpha1/envoyextensionypolicy_types.go | 5 +---- api/v1alpha1/envoygateway_types.go | 6 ----- api/v1alpha1/envoypatchpolicy_types.go | 5 +---- api/v1alpha1/envoyproxy_types.go | 5 +---- api/v1alpha1/groupversion_info.go | 25 --------------------- api/v1alpha1/httproutefilter_types.go | 5 +---- api/v1alpha1/securitypolicy_types.go | 5 +---- 11 files changed, 10 insertions(+), 63 deletions(-) delete mode 100644 api/v1alpha1/groupversion_info.go diff --git a/api/v1alpha1/backend_types.go b/api/v1alpha1/backend_types.go index d3bfecb05ff..b44dafa9573 100644 --- a/api/v1alpha1/backend_types.go +++ b/api/v1alpha1/backend_types.go @@ -31,6 +31,7 @@ const ( // Backend allows the user to configure the endpoints of a backend and // the behavior of the connection from Envoy Proxy to the backend. // +// +genclient // +kubebuilder:object:root=true // +kubebuilder:resource:categories=envoy-gateway,shortName=be // +kubebuilder:subresource:status @@ -184,7 +185,3 @@ type BackendList struct { metav1.ListMeta `json:"metadata,omitempty"` Items []Backend `json:"items"` } - -func init() { - SchemeBuilder.Register(&Backend{}, &BackendList{}) -} diff --git a/api/v1alpha1/backendtrafficpolicy_types.go b/api/v1alpha1/backendtrafficpolicy_types.go index 79b0e5a540a..35104008779 100644 --- a/api/v1alpha1/backendtrafficpolicy_types.go +++ b/api/v1alpha1/backendtrafficpolicy_types.go @@ -15,6 +15,7 @@ const ( KindBackendTrafficPolicy = "BackendTrafficPolicy" ) +// +genclient // +kubebuilder:object:root=true // +kubebuilder:resource:categories=envoy-gateway,shortName=btp // +kubebuilder:subresource:status @@ -84,7 +85,3 @@ type BackendTrafficPolicyList struct { metav1.ListMeta `json:"metadata,omitempty"` Items []BackendTrafficPolicy `json:"items"` } - -func init() { - SchemeBuilder.Register(&BackendTrafficPolicy{}, &BackendTrafficPolicyList{}) -} diff --git a/api/v1alpha1/clienttrafficpolicy_types.go b/api/v1alpha1/clienttrafficpolicy_types.go index b172d5951fb..2babc9a2642 100644 --- a/api/v1alpha1/clienttrafficpolicy_types.go +++ b/api/v1alpha1/clienttrafficpolicy_types.go @@ -16,6 +16,7 @@ const ( KindClientTrafficPolicy = "ClientTrafficPolicy" ) +// +genclient // +kubebuilder:object:root=true // +kubebuilder:resource:categories=envoy-gateway,shortName=ctp // +kubebuilder:subresource:status @@ -340,7 +341,3 @@ type ClientTrafficPolicyList struct { metav1.ListMeta `json:"metadata,omitempty"` Items []ClientTrafficPolicy `json:"items"` } - -func init() { - SchemeBuilder.Register(&ClientTrafficPolicy{}, &ClientTrafficPolicyList{}) -} diff --git a/api/v1alpha1/doc.go b/api/v1alpha1/doc.go index 4e705afd0e9..da3bfb0e612 100644 --- a/api/v1alpha1/doc.go +++ b/api/v1alpha1/doc.go @@ -6,6 +6,8 @@ // Package v1alpha1 contains API schema definitions for the gateway.envoyproxy.io // API group. // +// +k8s:openapi-gen=true // +kubebuilder:object:generate=true // +groupName=gateway.envoyproxy.io +// +groupGoName=EnvoyGateway package v1alpha1 diff --git a/api/v1alpha1/envoyextensionypolicy_types.go b/api/v1alpha1/envoyextensionypolicy_types.go index b4fc751b80d..a2f64b5bbc5 100644 --- a/api/v1alpha1/envoyextensionypolicy_types.go +++ b/api/v1alpha1/envoyextensionypolicy_types.go @@ -15,6 +15,7 @@ const ( KindEnvoyExtensionPolicy = "EnvoyExtensionPolicy" ) +// +genclient // +kubebuilder:object:root=true // +kubebuilder:resource:shortName=eep // +kubebuilder:subresource:status @@ -76,7 +77,3 @@ type EnvoyExtensionPolicyList struct { metav1.ListMeta `json:"metadata,omitempty"` Items []EnvoyExtensionPolicy `json:"items"` } - -func init() { - SchemeBuilder.Register(&EnvoyExtensionPolicy{}, &EnvoyExtensionPolicyList{}) -} diff --git a/api/v1alpha1/envoygateway_types.go b/api/v1alpha1/envoygateway_types.go index 33893c85698..42d7e5609e4 100644 --- a/api/v1alpha1/envoygateway_types.go +++ b/api/v1alpha1/envoygateway_types.go @@ -26,8 +26,6 @@ const ( GatewayMetricsHost = "0.0.0.0" ) -// +kubebuilder:object:root=true - // EnvoyGateway is the schema for the envoygateways API. type EnvoyGateway struct { metav1.TypeMeta `json:",inline"` @@ -608,7 +606,3 @@ type ShutdownManager struct { // Image specifies the ShutdownManager container image to be used, instead of the default image. Image *string `json:"image,omitempty"` } - -func init() { - SchemeBuilder.Register(&EnvoyGateway{}) -} diff --git a/api/v1alpha1/envoypatchpolicy_types.go b/api/v1alpha1/envoypatchpolicy_types.go index a7ac8992dbc..9758471a994 100644 --- a/api/v1alpha1/envoypatchpolicy_types.go +++ b/api/v1alpha1/envoypatchpolicy_types.go @@ -16,6 +16,7 @@ const ( KindEnvoyPatchPolicy = "EnvoyPatchPolicy" ) +// +genclient // +kubebuilder:object:root=true // +kubebuilder:resource:categories=envoy-gateway,shortName=epp // +kubebuilder:subresource:status @@ -172,7 +173,3 @@ type EnvoyPatchPolicyList struct { metav1.ListMeta `json:"metadata,omitempty"` Items []EnvoyPatchPolicy `json:"items"` } - -func init() { - SchemeBuilder.Register(&EnvoyPatchPolicy{}, &EnvoyPatchPolicyList{}) -} diff --git a/api/v1alpha1/envoyproxy_types.go b/api/v1alpha1/envoyproxy_types.go index 8b9c83e17e3..0b4d732031c 100644 --- a/api/v1alpha1/envoyproxy_types.go +++ b/api/v1alpha1/envoyproxy_types.go @@ -15,6 +15,7 @@ const ( KindEnvoyProxy = "EnvoyProxy" ) +// +genclient // +kubebuilder:object:root=true // +kubebuilder:resource:categories=envoy-gateway,shortName=eproxy // +kubebuilder:subresource:status @@ -454,7 +455,3 @@ const ( // for incoming client traffic, enabling support for both IP protocol versions. DualStack IPFamily = "DualStack" ) - -func init() { - SchemeBuilder.Register(&EnvoyProxy{}, &EnvoyProxyList{}) -} diff --git a/api/v1alpha1/groupversion_info.go b/api/v1alpha1/groupversion_info.go deleted file mode 100644 index be4c68a538d..00000000000 --- a/api/v1alpha1/groupversion_info.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright Envoy Gateway Authors -// SPDX-License-Identifier: Apache-2.0 -// The full text of the Apache license is available in the LICENSE file at -// the root of the repo. - -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -const GroupName = "gateway.envoyproxy.io" - -var ( - - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme -) diff --git a/api/v1alpha1/httproutefilter_types.go b/api/v1alpha1/httproutefilter_types.go index 3259fabc8f4..97c2026436a 100644 --- a/api/v1alpha1/httproutefilter_types.go +++ b/api/v1alpha1/httproutefilter_types.go @@ -14,6 +14,7 @@ const ( KindHTTPRouteFilter = "HTTPRouteFilter" ) +// +genclient // +kubebuilder:object:root=true // +kubebuilder:resource:categories=envoy-gateway,shortName=hrf // +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` @@ -148,7 +149,3 @@ type HTTPRouteFilterList struct { metav1.ListMeta `json:"metadata,omitempty"` Items []HTTPRouteFilter `json:"items"` } - -func init() { - SchemeBuilder.Register(&HTTPRouteFilter{}, &HTTPRouteFilterList{}) -} diff --git a/api/v1alpha1/securitypolicy_types.go b/api/v1alpha1/securitypolicy_types.go index 6b80655d4e7..5124e6132b0 100644 --- a/api/v1alpha1/securitypolicy_types.go +++ b/api/v1alpha1/securitypolicy_types.go @@ -15,6 +15,7 @@ const ( KindSecurityPolicy = "SecurityPolicy" ) +// +genclient // +kubebuilder:object:root=true // +kubebuilder:resource:categories=envoy-gateway,shortName=sp // +kubebuilder:subresource:status @@ -91,7 +92,3 @@ type SecurityPolicyList struct { metav1.ListMeta `json:"metadata,omitempty"` Items []SecurityPolicy `json:"items"` } - -func init() { - SchemeBuilder.Register(&SecurityPolicy{}, &SecurityPolicyList{}) -} From d64c3dae6f0766e2d2db2c01b2bef7a093d80781 Mon Sep 17 00:00:00 2001 From: Dave Protasowski Date: Tue, 4 Feb 2025 22:29:41 -0500 Subject: [PATCH 3/9] add make targets to generate clients Signed-off-by: Dave Protasowski --- api/v1alpha1/zz_generated.register.go | 74 ++++++ pkg/clientset/versioned/clientset.go | 109 ++++++++ .../versioned/fake/clientset_generated.go | 78 ++++++ pkg/clientset/versioned/fake/doc.go | 9 + pkg/clientset/versioned/fake/register.go | 45 ++++ pkg/clientset/versioned/scheme/doc.go | 9 + pkg/clientset/versioned/scheme/register.go | 45 ++++ .../typed/api/v1alpha1/api_client.go | 131 +++++++++ .../versioned/typed/api/v1alpha1/backend.go | 59 ++++ .../api/v1alpha1/backendtrafficpolicy.go | 59 ++++ .../typed/api/v1alpha1/clienttrafficpolicy.go | 59 ++++ .../versioned/typed/api/v1alpha1/doc.go | 9 + .../api/v1alpha1/envoyextensionpolicy.go | 59 ++++ .../typed/api/v1alpha1/envoypatchpolicy.go | 59 ++++ .../typed/api/v1alpha1/envoyproxy.go | 59 ++++ .../versioned/typed/api/v1alpha1/fake/doc.go | 9 + .../api/v1alpha1/fake/fake_api_client.go | 57 ++++ .../typed/api/v1alpha1/fake/fake_backend.go | 39 +++ .../fake/fake_backendtrafficpolicy.go | 41 +++ .../v1alpha1/fake/fake_clienttrafficpolicy.go | 41 +++ .../fake/fake_envoyextensionpolicy.go | 41 +++ .../v1alpha1/fake/fake_envoypatchpolicy.go | 41 +++ .../api/v1alpha1/fake/fake_envoyproxy.go | 39 +++ .../api/v1alpha1/fake/fake_httproutefilter.go | 41 +++ .../api/v1alpha1/fake/fake_securitypolicy.go | 41 +++ .../typed/api/v1alpha1/generated_expansion.go | 24 ++ .../typed/api/v1alpha1/httproutefilter.go | 57 ++++ .../typed/api/v1alpha1/securitypolicy.go | 59 ++++ .../externalversions/api/interface.go | 35 +++ .../externalversions/api/v1alpha1/backend.go | 79 ++++++ .../api/v1alpha1/backendtrafficpolicy.go | 79 ++++++ .../api/v1alpha1/clienttrafficpolicy.go | 79 ++++++ .../api/v1alpha1/envoyextensionpolicy.go | 79 ++++++ .../api/v1alpha1/envoypatchpolicy.go | 79 ++++++ .../api/v1alpha1/envoyproxy.go | 79 ++++++ .../api/v1alpha1/httproutefilter.go | 79 ++++++ .../api/v1alpha1/interface.go | 83 ++++++ .../api/v1alpha1/securitypolicy.go | 79 ++++++ pkg/informers/externalversions/factory.go | 251 ++++++++++++++++++ pkg/informers/externalversions/generic.go | 65 +++++ .../internalinterfaces/factory_interfaces.go | 29 ++ pkg/listers/api/v1alpha1/backend.go | 59 ++++ .../api/v1alpha1/backendtrafficpolicy.go | 59 ++++ .../api/v1alpha1/clienttrafficpolicy.go | 59 ++++ .../api/v1alpha1/envoyextensionpolicy.go | 59 ++++ pkg/listers/api/v1alpha1/envoypatchpolicy.go | 59 ++++ pkg/listers/api/v1alpha1/envoyproxy.go | 59 ++++ .../api/v1alpha1/expansion_generated.go | 72 +++++ pkg/listers/api/v1alpha1/httproutefilter.go | 59 ++++ pkg/listers/api/v1alpha1/securitypolicy.go | 59 ++++ tools/make/kube.mk | 40 +++ 51 files changed, 3072 insertions(+) create mode 100644 api/v1alpha1/zz_generated.register.go create mode 100644 pkg/clientset/versioned/clientset.go create mode 100644 pkg/clientset/versioned/fake/clientset_generated.go create mode 100644 pkg/clientset/versioned/fake/doc.go create mode 100644 pkg/clientset/versioned/fake/register.go create mode 100644 pkg/clientset/versioned/scheme/doc.go create mode 100644 pkg/clientset/versioned/scheme/register.go create mode 100644 pkg/clientset/versioned/typed/api/v1alpha1/api_client.go create mode 100644 pkg/clientset/versioned/typed/api/v1alpha1/backend.go create mode 100644 pkg/clientset/versioned/typed/api/v1alpha1/backendtrafficpolicy.go create mode 100644 pkg/clientset/versioned/typed/api/v1alpha1/clienttrafficpolicy.go create mode 100644 pkg/clientset/versioned/typed/api/v1alpha1/doc.go create mode 100644 pkg/clientset/versioned/typed/api/v1alpha1/envoyextensionpolicy.go create mode 100644 pkg/clientset/versioned/typed/api/v1alpha1/envoypatchpolicy.go create mode 100644 pkg/clientset/versioned/typed/api/v1alpha1/envoyproxy.go create mode 100644 pkg/clientset/versioned/typed/api/v1alpha1/fake/doc.go create mode 100644 pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_api_client.go create mode 100644 pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_backend.go create mode 100644 pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_backendtrafficpolicy.go create mode 100644 pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_clienttrafficpolicy.go create mode 100644 pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_envoyextensionpolicy.go create mode 100644 pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_envoypatchpolicy.go create mode 100644 pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_envoyproxy.go create mode 100644 pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_httproutefilter.go create mode 100644 pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_securitypolicy.go create mode 100644 pkg/clientset/versioned/typed/api/v1alpha1/generated_expansion.go create mode 100644 pkg/clientset/versioned/typed/api/v1alpha1/httproutefilter.go create mode 100644 pkg/clientset/versioned/typed/api/v1alpha1/securitypolicy.go create mode 100644 pkg/informers/externalversions/api/interface.go create mode 100644 pkg/informers/externalversions/api/v1alpha1/backend.go create mode 100644 pkg/informers/externalversions/api/v1alpha1/backendtrafficpolicy.go create mode 100644 pkg/informers/externalversions/api/v1alpha1/clienttrafficpolicy.go create mode 100644 pkg/informers/externalversions/api/v1alpha1/envoyextensionpolicy.go create mode 100644 pkg/informers/externalversions/api/v1alpha1/envoypatchpolicy.go create mode 100644 pkg/informers/externalversions/api/v1alpha1/envoyproxy.go create mode 100644 pkg/informers/externalversions/api/v1alpha1/httproutefilter.go create mode 100644 pkg/informers/externalversions/api/v1alpha1/interface.go create mode 100644 pkg/informers/externalversions/api/v1alpha1/securitypolicy.go create mode 100644 pkg/informers/externalversions/factory.go create mode 100644 pkg/informers/externalversions/generic.go create mode 100644 pkg/informers/externalversions/internalinterfaces/factory_interfaces.go create mode 100644 pkg/listers/api/v1alpha1/backend.go create mode 100644 pkg/listers/api/v1alpha1/backendtrafficpolicy.go create mode 100644 pkg/listers/api/v1alpha1/clienttrafficpolicy.go create mode 100644 pkg/listers/api/v1alpha1/envoyextensionpolicy.go create mode 100644 pkg/listers/api/v1alpha1/envoypatchpolicy.go create mode 100644 pkg/listers/api/v1alpha1/envoyproxy.go create mode 100644 pkg/listers/api/v1alpha1/expansion_generated.go create mode 100644 pkg/listers/api/v1alpha1/httproutefilter.go create mode 100644 pkg/listers/api/v1alpha1/securitypolicy.go diff --git a/api/v1alpha1/zz_generated.register.go b/api/v1alpha1/zz_generated.register.go new file mode 100644 index 00000000000..4def46edc54 --- /dev/null +++ b/api/v1alpha1/zz_generated.register.go @@ -0,0 +1,74 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by register-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" +) + +// GroupName specifies the group name used to register the objects. +const GroupName = "gateway.envoyproxy.io" + +// GroupVersion specifies the group and the version used to register the objects. +var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v1alpha1"} + +// SchemeGroupVersion is group version used to register these objects +// Deprecated: use GroupVersion instead. +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. + SchemeBuilder runtime.SchemeBuilder + localSchemeBuilder = &SchemeBuilder + // Deprecated: use Install instead + AddToScheme = localSchemeBuilder.AddToScheme + Install = localSchemeBuilder.AddToScheme +) + +func init() { + // We only register manually written functions here. The registration of the + // generated functions takes place in the generated files. The separation + // makes the code compile even when the generated files are missing. + localSchemeBuilder.Register(addKnownTypes) +} + +// Adds the list of known types to Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &Backend{}, + &BackendList{}, + &BackendTrafficPolicy{}, + &BackendTrafficPolicyList{}, + &ClientTrafficPolicy{}, + &ClientTrafficPolicyList{}, + &EnvoyExtensionPolicy{}, + &EnvoyExtensionPolicyList{}, + &EnvoyGateway{}, + &EnvoyPatchPolicy{}, + &EnvoyPatchPolicyList{}, + &EnvoyProxy{}, + &EnvoyProxyList{}, + &HTTPRouteFilter{}, + &HTTPRouteFilterList{}, + &SecurityPolicy{}, + &SecurityPolicyList{}, + ) + // AddToGroupVersion allows the serialization of client types like ListOptions. + v1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/pkg/clientset/versioned/clientset.go b/pkg/clientset/versioned/clientset.go new file mode 100644 index 00000000000..e2fb8cc3a36 --- /dev/null +++ b/pkg/clientset/versioned/clientset.go @@ -0,0 +1,109 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +package versioned + +import ( + fmt "fmt" + http "net/http" + + envoygatewayv1alpha1 "github.com/envoyproxy/gateway/pkg/clientset/versioned/typed/api/v1alpha1" + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + EnvoyGatewayV1alpha1() envoygatewayv1alpha1.EnvoyGatewayV1alpha1Interface +} + +// Clientset contains the clients for groups. +type Clientset struct { + *discovery.DiscoveryClient + envoyGatewayV1alpha1 *envoygatewayv1alpha1.EnvoyGatewayV1alpha1Client +} + +// EnvoyGatewayV1alpha1 retrieves the EnvoyGatewayV1alpha1Client +func (c *Clientset) EnvoyGatewayV1alpha1() envoygatewayv1alpha1.EnvoyGatewayV1alpha1Interface { + return c.envoyGatewayV1alpha1 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + if c == nil { + return nil + } + return c.DiscoveryClient +} + +// NewForConfig creates a new Clientset for the given config. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfig will generate a rate-limiter in configShallowCopy. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*Clientset, error) { + configShallowCopy := *c + + if configShallowCopy.UserAgent == "" { + configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() + } + + // share the transport between all clients + httpClient, err := rest.HTTPClientFor(&configShallowCopy) + if err != nil { + return nil, err + } + + return NewForConfigAndClient(&configShallowCopy, httpClient) +} + +// NewForConfigAndClient creates a new Clientset for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. +func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { + configShallowCopy := *c + if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + if configShallowCopy.Burst <= 0 { + return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + } + configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) + } + + var cs Clientset + var err error + cs.envoyGatewayV1alpha1, err = envoygatewayv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + return &cs, nil +} + +// NewForConfigOrDie creates a new Clientset for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *Clientset { + cs, err := NewForConfig(c) + if err != nil { + panic(err) + } + return cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.envoyGatewayV1alpha1 = envoygatewayv1alpha1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/pkg/clientset/versioned/fake/clientset_generated.go b/pkg/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 00000000000..2ef2c5d1634 --- /dev/null +++ b/pkg/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,78 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + clientset "github.com/envoyproxy/gateway/pkg/clientset/versioned" + envoygatewayv1alpha1 "github.com/envoyproxy/gateway/pkg/clientset/versioned/typed/api/v1alpha1" + fakeenvoygatewayv1alpha1 "github.com/envoyproxy/gateway/pkg/clientset/versioned/typed/api/v1alpha1/fake" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" +) + +// NewSimpleClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +// +// DEPRECATED: NewClientset replaces this with support for field management, which significantly improves +// server side apply testing. NewClientset is only available when apply configurations are generated (e.g. +// via --with-applyconfig). +func NewSimpleClientset(objects ...runtime.Object) *Clientset { + o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +// Clientset implements clientset.Interface. Meant to be embedded into a +// struct to get a default implementation. This makes faking out just the method +// you want to test easier. +type Clientset struct { + testing.Fake + discovery *fakediscovery.FakeDiscovery + tracker testing.ObjectTracker +} + +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +var ( + _ clientset.Interface = &Clientset{} + _ testing.FakeClient = &Clientset{} +) + +// EnvoyGatewayV1alpha1 retrieves the EnvoyGatewayV1alpha1Client +func (c *Clientset) EnvoyGatewayV1alpha1() envoygatewayv1alpha1.EnvoyGatewayV1alpha1Interface { + return &fakeenvoygatewayv1alpha1.FakeEnvoyGatewayV1alpha1{Fake: &c.Fake} +} diff --git a/pkg/clientset/versioned/fake/doc.go b/pkg/clientset/versioned/fake/doc.go new file mode 100644 index 00000000000..e5dd1a58c16 --- /dev/null +++ b/pkg/clientset/versioned/fake/doc.go @@ -0,0 +1,9 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/pkg/clientset/versioned/fake/register.go b/pkg/clientset/versioned/fake/register.go new file mode 100644 index 00000000000..112af3967e3 --- /dev/null +++ b/pkg/clientset/versioned/fake/register.go @@ -0,0 +1,45 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + envoygatewayv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +var localSchemeBuilder = runtime.SchemeBuilder{ + envoygatewayv1alpha1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(scheme)) +} diff --git a/pkg/clientset/versioned/scheme/doc.go b/pkg/clientset/versioned/scheme/doc.go new file mode 100644 index 00000000000..5a49ce71d25 --- /dev/null +++ b/pkg/clientset/versioned/scheme/doc.go @@ -0,0 +1,9 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/pkg/clientset/versioned/scheme/register.go b/pkg/clientset/versioned/scheme/register.go new file mode 100644 index 00000000000..c2c560408c5 --- /dev/null +++ b/pkg/clientset/versioned/scheme/register.go @@ -0,0 +1,45 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +package scheme + +import ( + envoygatewayv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + envoygatewayv1alpha1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(Scheme)) +} diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/api_client.go b/pkg/clientset/versioned/typed/api/v1alpha1/api_client.go new file mode 100644 index 00000000000..7a891470014 --- /dev/null +++ b/pkg/clientset/versioned/typed/api/v1alpha1/api_client.go @@ -0,0 +1,131 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + http "net/http" + + apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + scheme "github.com/envoyproxy/gateway/pkg/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type EnvoyGatewayV1alpha1Interface interface { + RESTClient() rest.Interface + BackendsGetter + BackendTrafficPoliciesGetter + ClientTrafficPoliciesGetter + EnvoyExtensionPoliciesGetter + EnvoyPatchPoliciesGetter + EnvoyProxiesGetter + HTTPRouteFiltersGetter + SecurityPoliciesGetter +} + +// EnvoyGatewayV1alpha1Client is used to interact with features provided by the gateway.envoyproxy.io group. +type EnvoyGatewayV1alpha1Client struct { + restClient rest.Interface +} + +func (c *EnvoyGatewayV1alpha1Client) Backends(namespace string) BackendInterface { + return newBackends(c, namespace) +} + +func (c *EnvoyGatewayV1alpha1Client) BackendTrafficPolicies(namespace string) BackendTrafficPolicyInterface { + return newBackendTrafficPolicies(c, namespace) +} + +func (c *EnvoyGatewayV1alpha1Client) ClientTrafficPolicies(namespace string) ClientTrafficPolicyInterface { + return newClientTrafficPolicies(c, namespace) +} + +func (c *EnvoyGatewayV1alpha1Client) EnvoyExtensionPolicies(namespace string) EnvoyExtensionPolicyInterface { + return newEnvoyExtensionPolicies(c, namespace) +} + +func (c *EnvoyGatewayV1alpha1Client) EnvoyPatchPolicies(namespace string) EnvoyPatchPolicyInterface { + return newEnvoyPatchPolicies(c, namespace) +} + +func (c *EnvoyGatewayV1alpha1Client) EnvoyProxies(namespace string) EnvoyProxyInterface { + return newEnvoyProxies(c, namespace) +} + +func (c *EnvoyGatewayV1alpha1Client) HTTPRouteFilters(namespace string) HTTPRouteFilterInterface { + return newHTTPRouteFilters(c, namespace) +} + +func (c *EnvoyGatewayV1alpha1Client) SecurityPolicies(namespace string) SecurityPolicyInterface { + return newSecurityPolicies(c, namespace) +} + +// NewForConfig creates a new EnvoyGatewayV1alpha1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*EnvoyGatewayV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new EnvoyGatewayV1alpha1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*EnvoyGatewayV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &EnvoyGatewayV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new EnvoyGatewayV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *EnvoyGatewayV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new EnvoyGatewayV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *EnvoyGatewayV1alpha1Client { + return &EnvoyGatewayV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := apiv1alpha1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *EnvoyGatewayV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/backend.go b/pkg/clientset/versioned/typed/api/v1alpha1/backend.go new file mode 100644 index 00000000000..6025192d444 --- /dev/null +++ b/pkg/clientset/versioned/typed/api/v1alpha1/backend.go @@ -0,0 +1,59 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + + apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + scheme "github.com/envoyproxy/gateway/pkg/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// BackendsGetter has a method to return a BackendInterface. +// A group's client should implement this interface. +type BackendsGetter interface { + Backends(namespace string) BackendInterface +} + +// BackendInterface has methods to work with Backend resources. +type BackendInterface interface { + Create(ctx context.Context, backend *apiv1alpha1.Backend, opts v1.CreateOptions) (*apiv1alpha1.Backend, error) + Update(ctx context.Context, backend *apiv1alpha1.Backend, opts v1.UpdateOptions) (*apiv1alpha1.Backend, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, backend *apiv1alpha1.Backend, opts v1.UpdateOptions) (*apiv1alpha1.Backend, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*apiv1alpha1.Backend, error) + List(ctx context.Context, opts v1.ListOptions) (*apiv1alpha1.BackendList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *apiv1alpha1.Backend, err error) + BackendExpansion +} + +// backends implements BackendInterface +type backends struct { + *gentype.ClientWithList[*apiv1alpha1.Backend, *apiv1alpha1.BackendList] +} + +// newBackends returns a Backends +func newBackends(c *EnvoyGatewayV1alpha1Client, namespace string) *backends { + return &backends{ + gentype.NewClientWithList[*apiv1alpha1.Backend, *apiv1alpha1.BackendList]( + "backends", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *apiv1alpha1.Backend { return &apiv1alpha1.Backend{} }, + func() *apiv1alpha1.BackendList { return &apiv1alpha1.BackendList{} }, + ), + } +} diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/backendtrafficpolicy.go b/pkg/clientset/versioned/typed/api/v1alpha1/backendtrafficpolicy.go new file mode 100644 index 00000000000..90b30ee64b6 --- /dev/null +++ b/pkg/clientset/versioned/typed/api/v1alpha1/backendtrafficpolicy.go @@ -0,0 +1,59 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + + apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + scheme "github.com/envoyproxy/gateway/pkg/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// BackendTrafficPoliciesGetter has a method to return a BackendTrafficPolicyInterface. +// A group's client should implement this interface. +type BackendTrafficPoliciesGetter interface { + BackendTrafficPolicies(namespace string) BackendTrafficPolicyInterface +} + +// BackendTrafficPolicyInterface has methods to work with BackendTrafficPolicy resources. +type BackendTrafficPolicyInterface interface { + Create(ctx context.Context, backendTrafficPolicy *apiv1alpha1.BackendTrafficPolicy, opts v1.CreateOptions) (*apiv1alpha1.BackendTrafficPolicy, error) + Update(ctx context.Context, backendTrafficPolicy *apiv1alpha1.BackendTrafficPolicy, opts v1.UpdateOptions) (*apiv1alpha1.BackendTrafficPolicy, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, backendTrafficPolicy *apiv1alpha1.BackendTrafficPolicy, opts v1.UpdateOptions) (*apiv1alpha1.BackendTrafficPolicy, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*apiv1alpha1.BackendTrafficPolicy, error) + List(ctx context.Context, opts v1.ListOptions) (*apiv1alpha1.BackendTrafficPolicyList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *apiv1alpha1.BackendTrafficPolicy, err error) + BackendTrafficPolicyExpansion +} + +// backendTrafficPolicies implements BackendTrafficPolicyInterface +type backendTrafficPolicies struct { + *gentype.ClientWithList[*apiv1alpha1.BackendTrafficPolicy, *apiv1alpha1.BackendTrafficPolicyList] +} + +// newBackendTrafficPolicies returns a BackendTrafficPolicies +func newBackendTrafficPolicies(c *EnvoyGatewayV1alpha1Client, namespace string) *backendTrafficPolicies { + return &backendTrafficPolicies{ + gentype.NewClientWithList[*apiv1alpha1.BackendTrafficPolicy, *apiv1alpha1.BackendTrafficPolicyList]( + "backendtrafficpolicies", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *apiv1alpha1.BackendTrafficPolicy { return &apiv1alpha1.BackendTrafficPolicy{} }, + func() *apiv1alpha1.BackendTrafficPolicyList { return &apiv1alpha1.BackendTrafficPolicyList{} }, + ), + } +} diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/clienttrafficpolicy.go b/pkg/clientset/versioned/typed/api/v1alpha1/clienttrafficpolicy.go new file mode 100644 index 00000000000..9d713048b20 --- /dev/null +++ b/pkg/clientset/versioned/typed/api/v1alpha1/clienttrafficpolicy.go @@ -0,0 +1,59 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + + apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + scheme "github.com/envoyproxy/gateway/pkg/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// ClientTrafficPoliciesGetter has a method to return a ClientTrafficPolicyInterface. +// A group's client should implement this interface. +type ClientTrafficPoliciesGetter interface { + ClientTrafficPolicies(namespace string) ClientTrafficPolicyInterface +} + +// ClientTrafficPolicyInterface has methods to work with ClientTrafficPolicy resources. +type ClientTrafficPolicyInterface interface { + Create(ctx context.Context, clientTrafficPolicy *apiv1alpha1.ClientTrafficPolicy, opts v1.CreateOptions) (*apiv1alpha1.ClientTrafficPolicy, error) + Update(ctx context.Context, clientTrafficPolicy *apiv1alpha1.ClientTrafficPolicy, opts v1.UpdateOptions) (*apiv1alpha1.ClientTrafficPolicy, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, clientTrafficPolicy *apiv1alpha1.ClientTrafficPolicy, opts v1.UpdateOptions) (*apiv1alpha1.ClientTrafficPolicy, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*apiv1alpha1.ClientTrafficPolicy, error) + List(ctx context.Context, opts v1.ListOptions) (*apiv1alpha1.ClientTrafficPolicyList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *apiv1alpha1.ClientTrafficPolicy, err error) + ClientTrafficPolicyExpansion +} + +// clientTrafficPolicies implements ClientTrafficPolicyInterface +type clientTrafficPolicies struct { + *gentype.ClientWithList[*apiv1alpha1.ClientTrafficPolicy, *apiv1alpha1.ClientTrafficPolicyList] +} + +// newClientTrafficPolicies returns a ClientTrafficPolicies +func newClientTrafficPolicies(c *EnvoyGatewayV1alpha1Client, namespace string) *clientTrafficPolicies { + return &clientTrafficPolicies{ + gentype.NewClientWithList[*apiv1alpha1.ClientTrafficPolicy, *apiv1alpha1.ClientTrafficPolicyList]( + "clienttrafficpolicies", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *apiv1alpha1.ClientTrafficPolicy { return &apiv1alpha1.ClientTrafficPolicy{} }, + func() *apiv1alpha1.ClientTrafficPolicyList { return &apiv1alpha1.ClientTrafficPolicyList{} }, + ), + } +} diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/doc.go b/pkg/clientset/versioned/typed/api/v1alpha1/doc.go new file mode 100644 index 00000000000..a641105ed19 --- /dev/null +++ b/pkg/clientset/versioned/typed/api/v1alpha1/doc.go @@ -0,0 +1,9 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha1 diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/envoyextensionpolicy.go b/pkg/clientset/versioned/typed/api/v1alpha1/envoyextensionpolicy.go new file mode 100644 index 00000000000..e3f97545354 --- /dev/null +++ b/pkg/clientset/versioned/typed/api/v1alpha1/envoyextensionpolicy.go @@ -0,0 +1,59 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + + apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + scheme "github.com/envoyproxy/gateway/pkg/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// EnvoyExtensionPoliciesGetter has a method to return a EnvoyExtensionPolicyInterface. +// A group's client should implement this interface. +type EnvoyExtensionPoliciesGetter interface { + EnvoyExtensionPolicies(namespace string) EnvoyExtensionPolicyInterface +} + +// EnvoyExtensionPolicyInterface has methods to work with EnvoyExtensionPolicy resources. +type EnvoyExtensionPolicyInterface interface { + Create(ctx context.Context, envoyExtensionPolicy *apiv1alpha1.EnvoyExtensionPolicy, opts v1.CreateOptions) (*apiv1alpha1.EnvoyExtensionPolicy, error) + Update(ctx context.Context, envoyExtensionPolicy *apiv1alpha1.EnvoyExtensionPolicy, opts v1.UpdateOptions) (*apiv1alpha1.EnvoyExtensionPolicy, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, envoyExtensionPolicy *apiv1alpha1.EnvoyExtensionPolicy, opts v1.UpdateOptions) (*apiv1alpha1.EnvoyExtensionPolicy, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*apiv1alpha1.EnvoyExtensionPolicy, error) + List(ctx context.Context, opts v1.ListOptions) (*apiv1alpha1.EnvoyExtensionPolicyList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *apiv1alpha1.EnvoyExtensionPolicy, err error) + EnvoyExtensionPolicyExpansion +} + +// envoyExtensionPolicies implements EnvoyExtensionPolicyInterface +type envoyExtensionPolicies struct { + *gentype.ClientWithList[*apiv1alpha1.EnvoyExtensionPolicy, *apiv1alpha1.EnvoyExtensionPolicyList] +} + +// newEnvoyExtensionPolicies returns a EnvoyExtensionPolicies +func newEnvoyExtensionPolicies(c *EnvoyGatewayV1alpha1Client, namespace string) *envoyExtensionPolicies { + return &envoyExtensionPolicies{ + gentype.NewClientWithList[*apiv1alpha1.EnvoyExtensionPolicy, *apiv1alpha1.EnvoyExtensionPolicyList]( + "envoyextensionpolicies", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *apiv1alpha1.EnvoyExtensionPolicy { return &apiv1alpha1.EnvoyExtensionPolicy{} }, + func() *apiv1alpha1.EnvoyExtensionPolicyList { return &apiv1alpha1.EnvoyExtensionPolicyList{} }, + ), + } +} diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/envoypatchpolicy.go b/pkg/clientset/versioned/typed/api/v1alpha1/envoypatchpolicy.go new file mode 100644 index 00000000000..c910c75922a --- /dev/null +++ b/pkg/clientset/versioned/typed/api/v1alpha1/envoypatchpolicy.go @@ -0,0 +1,59 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + + apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + scheme "github.com/envoyproxy/gateway/pkg/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// EnvoyPatchPoliciesGetter has a method to return a EnvoyPatchPolicyInterface. +// A group's client should implement this interface. +type EnvoyPatchPoliciesGetter interface { + EnvoyPatchPolicies(namespace string) EnvoyPatchPolicyInterface +} + +// EnvoyPatchPolicyInterface has methods to work with EnvoyPatchPolicy resources. +type EnvoyPatchPolicyInterface interface { + Create(ctx context.Context, envoyPatchPolicy *apiv1alpha1.EnvoyPatchPolicy, opts v1.CreateOptions) (*apiv1alpha1.EnvoyPatchPolicy, error) + Update(ctx context.Context, envoyPatchPolicy *apiv1alpha1.EnvoyPatchPolicy, opts v1.UpdateOptions) (*apiv1alpha1.EnvoyPatchPolicy, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, envoyPatchPolicy *apiv1alpha1.EnvoyPatchPolicy, opts v1.UpdateOptions) (*apiv1alpha1.EnvoyPatchPolicy, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*apiv1alpha1.EnvoyPatchPolicy, error) + List(ctx context.Context, opts v1.ListOptions) (*apiv1alpha1.EnvoyPatchPolicyList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *apiv1alpha1.EnvoyPatchPolicy, err error) + EnvoyPatchPolicyExpansion +} + +// envoyPatchPolicies implements EnvoyPatchPolicyInterface +type envoyPatchPolicies struct { + *gentype.ClientWithList[*apiv1alpha1.EnvoyPatchPolicy, *apiv1alpha1.EnvoyPatchPolicyList] +} + +// newEnvoyPatchPolicies returns a EnvoyPatchPolicies +func newEnvoyPatchPolicies(c *EnvoyGatewayV1alpha1Client, namespace string) *envoyPatchPolicies { + return &envoyPatchPolicies{ + gentype.NewClientWithList[*apiv1alpha1.EnvoyPatchPolicy, *apiv1alpha1.EnvoyPatchPolicyList]( + "envoypatchpolicies", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *apiv1alpha1.EnvoyPatchPolicy { return &apiv1alpha1.EnvoyPatchPolicy{} }, + func() *apiv1alpha1.EnvoyPatchPolicyList { return &apiv1alpha1.EnvoyPatchPolicyList{} }, + ), + } +} diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/envoyproxy.go b/pkg/clientset/versioned/typed/api/v1alpha1/envoyproxy.go new file mode 100644 index 00000000000..af683f224f1 --- /dev/null +++ b/pkg/clientset/versioned/typed/api/v1alpha1/envoyproxy.go @@ -0,0 +1,59 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + + apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + scheme "github.com/envoyproxy/gateway/pkg/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// EnvoyProxiesGetter has a method to return a EnvoyProxyInterface. +// A group's client should implement this interface. +type EnvoyProxiesGetter interface { + EnvoyProxies(namespace string) EnvoyProxyInterface +} + +// EnvoyProxyInterface has methods to work with EnvoyProxy resources. +type EnvoyProxyInterface interface { + Create(ctx context.Context, envoyProxy *apiv1alpha1.EnvoyProxy, opts v1.CreateOptions) (*apiv1alpha1.EnvoyProxy, error) + Update(ctx context.Context, envoyProxy *apiv1alpha1.EnvoyProxy, opts v1.UpdateOptions) (*apiv1alpha1.EnvoyProxy, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, envoyProxy *apiv1alpha1.EnvoyProxy, opts v1.UpdateOptions) (*apiv1alpha1.EnvoyProxy, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*apiv1alpha1.EnvoyProxy, error) + List(ctx context.Context, opts v1.ListOptions) (*apiv1alpha1.EnvoyProxyList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *apiv1alpha1.EnvoyProxy, err error) + EnvoyProxyExpansion +} + +// envoyProxies implements EnvoyProxyInterface +type envoyProxies struct { + *gentype.ClientWithList[*apiv1alpha1.EnvoyProxy, *apiv1alpha1.EnvoyProxyList] +} + +// newEnvoyProxies returns a EnvoyProxies +func newEnvoyProxies(c *EnvoyGatewayV1alpha1Client, namespace string) *envoyProxies { + return &envoyProxies{ + gentype.NewClientWithList[*apiv1alpha1.EnvoyProxy, *apiv1alpha1.EnvoyProxyList]( + "envoyproxies", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *apiv1alpha1.EnvoyProxy { return &apiv1alpha1.EnvoyProxy{} }, + func() *apiv1alpha1.EnvoyProxyList { return &apiv1alpha1.EnvoyProxyList{} }, + ), + } +} diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/fake/doc.go b/pkg/clientset/versioned/typed/api/v1alpha1/fake/doc.go new file mode 100644 index 00000000000..42f80d64ea1 --- /dev/null +++ b/pkg/clientset/versioned/typed/api/v1alpha1/fake/doc.go @@ -0,0 +1,9 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_api_client.go b/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_api_client.go new file mode 100644 index 00000000000..997373e3f75 --- /dev/null +++ b/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_api_client.go @@ -0,0 +1,57 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/envoyproxy/gateway/pkg/clientset/versioned/typed/api/v1alpha1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeEnvoyGatewayV1alpha1 struct { + *testing.Fake +} + +func (c *FakeEnvoyGatewayV1alpha1) Backends(namespace string) v1alpha1.BackendInterface { + return newFakeBackends(c, namespace) +} + +func (c *FakeEnvoyGatewayV1alpha1) BackendTrafficPolicies(namespace string) v1alpha1.BackendTrafficPolicyInterface { + return newFakeBackendTrafficPolicies(c, namespace) +} + +func (c *FakeEnvoyGatewayV1alpha1) ClientTrafficPolicies(namespace string) v1alpha1.ClientTrafficPolicyInterface { + return newFakeClientTrafficPolicies(c, namespace) +} + +func (c *FakeEnvoyGatewayV1alpha1) EnvoyExtensionPolicies(namespace string) v1alpha1.EnvoyExtensionPolicyInterface { + return newFakeEnvoyExtensionPolicies(c, namespace) +} + +func (c *FakeEnvoyGatewayV1alpha1) EnvoyPatchPolicies(namespace string) v1alpha1.EnvoyPatchPolicyInterface { + return newFakeEnvoyPatchPolicies(c, namespace) +} + +func (c *FakeEnvoyGatewayV1alpha1) EnvoyProxies(namespace string) v1alpha1.EnvoyProxyInterface { + return newFakeEnvoyProxies(c, namespace) +} + +func (c *FakeEnvoyGatewayV1alpha1) HTTPRouteFilters(namespace string) v1alpha1.HTTPRouteFilterInterface { + return newFakeHTTPRouteFilters(c, namespace) +} + +func (c *FakeEnvoyGatewayV1alpha1) SecurityPolicies(namespace string) v1alpha1.SecurityPolicyInterface { + return newFakeSecurityPolicies(c, namespace) +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeEnvoyGatewayV1alpha1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_backend.go b/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_backend.go new file mode 100644 index 00000000000..5bf7179f1cd --- /dev/null +++ b/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_backend.go @@ -0,0 +1,39 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/clientset/versioned/typed/api/v1alpha1" + gentype "k8s.io/client-go/gentype" +) + +// fakeBackends implements BackendInterface +type fakeBackends struct { + *gentype.FakeClientWithList[*v1alpha1.Backend, *v1alpha1.BackendList] + Fake *FakeEnvoyGatewayV1alpha1 +} + +func newFakeBackends(fake *FakeEnvoyGatewayV1alpha1, namespace string) apiv1alpha1.BackendInterface { + return &fakeBackends{ + gentype.NewFakeClientWithList[*v1alpha1.Backend, *v1alpha1.BackendList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("backends"), + v1alpha1.SchemeGroupVersion.WithKind("Backend"), + func() *v1alpha1.Backend { return &v1alpha1.Backend{} }, + func() *v1alpha1.BackendList { return &v1alpha1.BackendList{} }, + func(dst, src *v1alpha1.BackendList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.BackendList) []*v1alpha1.Backend { return gentype.ToPointerSlice(list.Items) }, + func(list *v1alpha1.BackendList, items []*v1alpha1.Backend) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_backendtrafficpolicy.go b/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_backendtrafficpolicy.go new file mode 100644 index 00000000000..f320e5b4f98 --- /dev/null +++ b/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_backendtrafficpolicy.go @@ -0,0 +1,41 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/clientset/versioned/typed/api/v1alpha1" + gentype "k8s.io/client-go/gentype" +) + +// fakeBackendTrafficPolicies implements BackendTrafficPolicyInterface +type fakeBackendTrafficPolicies struct { + *gentype.FakeClientWithList[*v1alpha1.BackendTrafficPolicy, *v1alpha1.BackendTrafficPolicyList] + Fake *FakeEnvoyGatewayV1alpha1 +} + +func newFakeBackendTrafficPolicies(fake *FakeEnvoyGatewayV1alpha1, namespace string) apiv1alpha1.BackendTrafficPolicyInterface { + return &fakeBackendTrafficPolicies{ + gentype.NewFakeClientWithList[*v1alpha1.BackendTrafficPolicy, *v1alpha1.BackendTrafficPolicyList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("backendtrafficpolicies"), + v1alpha1.SchemeGroupVersion.WithKind("BackendTrafficPolicy"), + func() *v1alpha1.BackendTrafficPolicy { return &v1alpha1.BackendTrafficPolicy{} }, + func() *v1alpha1.BackendTrafficPolicyList { return &v1alpha1.BackendTrafficPolicyList{} }, + func(dst, src *v1alpha1.BackendTrafficPolicyList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.BackendTrafficPolicyList) []*v1alpha1.BackendTrafficPolicy { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.BackendTrafficPolicyList, items []*v1alpha1.BackendTrafficPolicy) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_clienttrafficpolicy.go b/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_clienttrafficpolicy.go new file mode 100644 index 00000000000..86af01f3dac --- /dev/null +++ b/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_clienttrafficpolicy.go @@ -0,0 +1,41 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/clientset/versioned/typed/api/v1alpha1" + gentype "k8s.io/client-go/gentype" +) + +// fakeClientTrafficPolicies implements ClientTrafficPolicyInterface +type fakeClientTrafficPolicies struct { + *gentype.FakeClientWithList[*v1alpha1.ClientTrafficPolicy, *v1alpha1.ClientTrafficPolicyList] + Fake *FakeEnvoyGatewayV1alpha1 +} + +func newFakeClientTrafficPolicies(fake *FakeEnvoyGatewayV1alpha1, namespace string) apiv1alpha1.ClientTrafficPolicyInterface { + return &fakeClientTrafficPolicies{ + gentype.NewFakeClientWithList[*v1alpha1.ClientTrafficPolicy, *v1alpha1.ClientTrafficPolicyList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("clienttrafficpolicies"), + v1alpha1.SchemeGroupVersion.WithKind("ClientTrafficPolicy"), + func() *v1alpha1.ClientTrafficPolicy { return &v1alpha1.ClientTrafficPolicy{} }, + func() *v1alpha1.ClientTrafficPolicyList { return &v1alpha1.ClientTrafficPolicyList{} }, + func(dst, src *v1alpha1.ClientTrafficPolicyList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.ClientTrafficPolicyList) []*v1alpha1.ClientTrafficPolicy { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.ClientTrafficPolicyList, items []*v1alpha1.ClientTrafficPolicy) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_envoyextensionpolicy.go b/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_envoyextensionpolicy.go new file mode 100644 index 00000000000..eb82558c123 --- /dev/null +++ b/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_envoyextensionpolicy.go @@ -0,0 +1,41 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/clientset/versioned/typed/api/v1alpha1" + gentype "k8s.io/client-go/gentype" +) + +// fakeEnvoyExtensionPolicies implements EnvoyExtensionPolicyInterface +type fakeEnvoyExtensionPolicies struct { + *gentype.FakeClientWithList[*v1alpha1.EnvoyExtensionPolicy, *v1alpha1.EnvoyExtensionPolicyList] + Fake *FakeEnvoyGatewayV1alpha1 +} + +func newFakeEnvoyExtensionPolicies(fake *FakeEnvoyGatewayV1alpha1, namespace string) apiv1alpha1.EnvoyExtensionPolicyInterface { + return &fakeEnvoyExtensionPolicies{ + gentype.NewFakeClientWithList[*v1alpha1.EnvoyExtensionPolicy, *v1alpha1.EnvoyExtensionPolicyList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("envoyextensionpolicies"), + v1alpha1.SchemeGroupVersion.WithKind("EnvoyExtensionPolicy"), + func() *v1alpha1.EnvoyExtensionPolicy { return &v1alpha1.EnvoyExtensionPolicy{} }, + func() *v1alpha1.EnvoyExtensionPolicyList { return &v1alpha1.EnvoyExtensionPolicyList{} }, + func(dst, src *v1alpha1.EnvoyExtensionPolicyList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.EnvoyExtensionPolicyList) []*v1alpha1.EnvoyExtensionPolicy { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.EnvoyExtensionPolicyList, items []*v1alpha1.EnvoyExtensionPolicy) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_envoypatchpolicy.go b/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_envoypatchpolicy.go new file mode 100644 index 00000000000..51310126b6a --- /dev/null +++ b/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_envoypatchpolicy.go @@ -0,0 +1,41 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/clientset/versioned/typed/api/v1alpha1" + gentype "k8s.io/client-go/gentype" +) + +// fakeEnvoyPatchPolicies implements EnvoyPatchPolicyInterface +type fakeEnvoyPatchPolicies struct { + *gentype.FakeClientWithList[*v1alpha1.EnvoyPatchPolicy, *v1alpha1.EnvoyPatchPolicyList] + Fake *FakeEnvoyGatewayV1alpha1 +} + +func newFakeEnvoyPatchPolicies(fake *FakeEnvoyGatewayV1alpha1, namespace string) apiv1alpha1.EnvoyPatchPolicyInterface { + return &fakeEnvoyPatchPolicies{ + gentype.NewFakeClientWithList[*v1alpha1.EnvoyPatchPolicy, *v1alpha1.EnvoyPatchPolicyList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("envoypatchpolicies"), + v1alpha1.SchemeGroupVersion.WithKind("EnvoyPatchPolicy"), + func() *v1alpha1.EnvoyPatchPolicy { return &v1alpha1.EnvoyPatchPolicy{} }, + func() *v1alpha1.EnvoyPatchPolicyList { return &v1alpha1.EnvoyPatchPolicyList{} }, + func(dst, src *v1alpha1.EnvoyPatchPolicyList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.EnvoyPatchPolicyList) []*v1alpha1.EnvoyPatchPolicy { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.EnvoyPatchPolicyList, items []*v1alpha1.EnvoyPatchPolicy) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_envoyproxy.go b/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_envoyproxy.go new file mode 100644 index 00000000000..fa0227d2116 --- /dev/null +++ b/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_envoyproxy.go @@ -0,0 +1,39 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/clientset/versioned/typed/api/v1alpha1" + gentype "k8s.io/client-go/gentype" +) + +// fakeEnvoyProxies implements EnvoyProxyInterface +type fakeEnvoyProxies struct { + *gentype.FakeClientWithList[*v1alpha1.EnvoyProxy, *v1alpha1.EnvoyProxyList] + Fake *FakeEnvoyGatewayV1alpha1 +} + +func newFakeEnvoyProxies(fake *FakeEnvoyGatewayV1alpha1, namespace string) apiv1alpha1.EnvoyProxyInterface { + return &fakeEnvoyProxies{ + gentype.NewFakeClientWithList[*v1alpha1.EnvoyProxy, *v1alpha1.EnvoyProxyList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("envoyproxies"), + v1alpha1.SchemeGroupVersion.WithKind("EnvoyProxy"), + func() *v1alpha1.EnvoyProxy { return &v1alpha1.EnvoyProxy{} }, + func() *v1alpha1.EnvoyProxyList { return &v1alpha1.EnvoyProxyList{} }, + func(dst, src *v1alpha1.EnvoyProxyList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.EnvoyProxyList) []*v1alpha1.EnvoyProxy { return gentype.ToPointerSlice(list.Items) }, + func(list *v1alpha1.EnvoyProxyList, items []*v1alpha1.EnvoyProxy) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_httproutefilter.go b/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_httproutefilter.go new file mode 100644 index 00000000000..345381173bb --- /dev/null +++ b/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_httproutefilter.go @@ -0,0 +1,41 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/clientset/versioned/typed/api/v1alpha1" + gentype "k8s.io/client-go/gentype" +) + +// fakeHTTPRouteFilters implements HTTPRouteFilterInterface +type fakeHTTPRouteFilters struct { + *gentype.FakeClientWithList[*v1alpha1.HTTPRouteFilter, *v1alpha1.HTTPRouteFilterList] + Fake *FakeEnvoyGatewayV1alpha1 +} + +func newFakeHTTPRouteFilters(fake *FakeEnvoyGatewayV1alpha1, namespace string) apiv1alpha1.HTTPRouteFilterInterface { + return &fakeHTTPRouteFilters{ + gentype.NewFakeClientWithList[*v1alpha1.HTTPRouteFilter, *v1alpha1.HTTPRouteFilterList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("httproutefilters"), + v1alpha1.SchemeGroupVersion.WithKind("HTTPRouteFilter"), + func() *v1alpha1.HTTPRouteFilter { return &v1alpha1.HTTPRouteFilter{} }, + func() *v1alpha1.HTTPRouteFilterList { return &v1alpha1.HTTPRouteFilterList{} }, + func(dst, src *v1alpha1.HTTPRouteFilterList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.HTTPRouteFilterList) []*v1alpha1.HTTPRouteFilter { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.HTTPRouteFilterList, items []*v1alpha1.HTTPRouteFilter) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_securitypolicy.go b/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_securitypolicy.go new file mode 100644 index 00000000000..3944495546f --- /dev/null +++ b/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_securitypolicy.go @@ -0,0 +1,41 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/clientset/versioned/typed/api/v1alpha1" + gentype "k8s.io/client-go/gentype" +) + +// fakeSecurityPolicies implements SecurityPolicyInterface +type fakeSecurityPolicies struct { + *gentype.FakeClientWithList[*v1alpha1.SecurityPolicy, *v1alpha1.SecurityPolicyList] + Fake *FakeEnvoyGatewayV1alpha1 +} + +func newFakeSecurityPolicies(fake *FakeEnvoyGatewayV1alpha1, namespace string) apiv1alpha1.SecurityPolicyInterface { + return &fakeSecurityPolicies{ + gentype.NewFakeClientWithList[*v1alpha1.SecurityPolicy, *v1alpha1.SecurityPolicyList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("securitypolicies"), + v1alpha1.SchemeGroupVersion.WithKind("SecurityPolicy"), + func() *v1alpha1.SecurityPolicy { return &v1alpha1.SecurityPolicy{} }, + func() *v1alpha1.SecurityPolicyList { return &v1alpha1.SecurityPolicyList{} }, + func(dst, src *v1alpha1.SecurityPolicyList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.SecurityPolicyList) []*v1alpha1.SecurityPolicy { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.SecurityPolicyList, items []*v1alpha1.SecurityPolicy) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/generated_expansion.go b/pkg/clientset/versioned/typed/api/v1alpha1/generated_expansion.go new file mode 100644 index 00000000000..f404d8a949a --- /dev/null +++ b/pkg/clientset/versioned/typed/api/v1alpha1/generated_expansion.go @@ -0,0 +1,24 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +type BackendExpansion interface{} + +type BackendTrafficPolicyExpansion interface{} + +type ClientTrafficPolicyExpansion interface{} + +type EnvoyExtensionPolicyExpansion interface{} + +type EnvoyPatchPolicyExpansion interface{} + +type EnvoyProxyExpansion interface{} + +type HTTPRouteFilterExpansion interface{} + +type SecurityPolicyExpansion interface{} diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/httproutefilter.go b/pkg/clientset/versioned/typed/api/v1alpha1/httproutefilter.go new file mode 100644 index 00000000000..07a25525410 --- /dev/null +++ b/pkg/clientset/versioned/typed/api/v1alpha1/httproutefilter.go @@ -0,0 +1,57 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + + apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + scheme "github.com/envoyproxy/gateway/pkg/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// HTTPRouteFiltersGetter has a method to return a HTTPRouteFilterInterface. +// A group's client should implement this interface. +type HTTPRouteFiltersGetter interface { + HTTPRouteFilters(namespace string) HTTPRouteFilterInterface +} + +// HTTPRouteFilterInterface has methods to work with HTTPRouteFilter resources. +type HTTPRouteFilterInterface interface { + Create(ctx context.Context, hTTPRouteFilter *apiv1alpha1.HTTPRouteFilter, opts v1.CreateOptions) (*apiv1alpha1.HTTPRouteFilter, error) + Update(ctx context.Context, hTTPRouteFilter *apiv1alpha1.HTTPRouteFilter, opts v1.UpdateOptions) (*apiv1alpha1.HTTPRouteFilter, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*apiv1alpha1.HTTPRouteFilter, error) + List(ctx context.Context, opts v1.ListOptions) (*apiv1alpha1.HTTPRouteFilterList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *apiv1alpha1.HTTPRouteFilter, err error) + HTTPRouteFilterExpansion +} + +// hTTPRouteFilters implements HTTPRouteFilterInterface +type hTTPRouteFilters struct { + *gentype.ClientWithList[*apiv1alpha1.HTTPRouteFilter, *apiv1alpha1.HTTPRouteFilterList] +} + +// newHTTPRouteFilters returns a HTTPRouteFilters +func newHTTPRouteFilters(c *EnvoyGatewayV1alpha1Client, namespace string) *hTTPRouteFilters { + return &hTTPRouteFilters{ + gentype.NewClientWithList[*apiv1alpha1.HTTPRouteFilter, *apiv1alpha1.HTTPRouteFilterList]( + "httproutefilters", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *apiv1alpha1.HTTPRouteFilter { return &apiv1alpha1.HTTPRouteFilter{} }, + func() *apiv1alpha1.HTTPRouteFilterList { return &apiv1alpha1.HTTPRouteFilterList{} }, + ), + } +} diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/securitypolicy.go b/pkg/clientset/versioned/typed/api/v1alpha1/securitypolicy.go new file mode 100644 index 00000000000..fee6b7b6ea4 --- /dev/null +++ b/pkg/clientset/versioned/typed/api/v1alpha1/securitypolicy.go @@ -0,0 +1,59 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + + apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + scheme "github.com/envoyproxy/gateway/pkg/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// SecurityPoliciesGetter has a method to return a SecurityPolicyInterface. +// A group's client should implement this interface. +type SecurityPoliciesGetter interface { + SecurityPolicies(namespace string) SecurityPolicyInterface +} + +// SecurityPolicyInterface has methods to work with SecurityPolicy resources. +type SecurityPolicyInterface interface { + Create(ctx context.Context, securityPolicy *apiv1alpha1.SecurityPolicy, opts v1.CreateOptions) (*apiv1alpha1.SecurityPolicy, error) + Update(ctx context.Context, securityPolicy *apiv1alpha1.SecurityPolicy, opts v1.UpdateOptions) (*apiv1alpha1.SecurityPolicy, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, securityPolicy *apiv1alpha1.SecurityPolicy, opts v1.UpdateOptions) (*apiv1alpha1.SecurityPolicy, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*apiv1alpha1.SecurityPolicy, error) + List(ctx context.Context, opts v1.ListOptions) (*apiv1alpha1.SecurityPolicyList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *apiv1alpha1.SecurityPolicy, err error) + SecurityPolicyExpansion +} + +// securityPolicies implements SecurityPolicyInterface +type securityPolicies struct { + *gentype.ClientWithList[*apiv1alpha1.SecurityPolicy, *apiv1alpha1.SecurityPolicyList] +} + +// newSecurityPolicies returns a SecurityPolicies +func newSecurityPolicies(c *EnvoyGatewayV1alpha1Client, namespace string) *securityPolicies { + return &securityPolicies{ + gentype.NewClientWithList[*apiv1alpha1.SecurityPolicy, *apiv1alpha1.SecurityPolicyList]( + "securitypolicies", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *apiv1alpha1.SecurityPolicy { return &apiv1alpha1.SecurityPolicy{} }, + func() *apiv1alpha1.SecurityPolicyList { return &apiv1alpha1.SecurityPolicyList{} }, + ), + } +} diff --git a/pkg/informers/externalversions/api/interface.go b/pkg/informers/externalversions/api/interface.go new file mode 100644 index 00000000000..d2964be889c --- /dev/null +++ b/pkg/informers/externalversions/api/interface.go @@ -0,0 +1,35 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by informer-gen. DO NOT EDIT. + +package api + +import ( + v1alpha1 "github.com/envoyproxy/gateway/pkg/informers/externalversions/api/v1alpha1" + internalinterfaces "github.com/envoyproxy/gateway/pkg/informers/externalversions/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1alpha1 provides access to shared informers for resources in V1alpha1. + V1alpha1() v1alpha1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1alpha1 returns a new v1alpha1.Interface. +func (g *group) V1alpha1() v1alpha1.Interface { + return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/pkg/informers/externalversions/api/v1alpha1/backend.go b/pkg/informers/externalversions/api/v1alpha1/backend.go new file mode 100644 index 00000000000..8041d74b4c5 --- /dev/null +++ b/pkg/informers/externalversions/api/v1alpha1/backend.go @@ -0,0 +1,79 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + time "time" + + gatewayapiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + versioned "github.com/envoyproxy/gateway/pkg/clientset/versioned" + internalinterfaces "github.com/envoyproxy/gateway/pkg/informers/externalversions/internalinterfaces" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/listers/api/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// BackendInformer provides access to a shared informer and lister for +// Backends. +type BackendInformer interface { + Informer() cache.SharedIndexInformer + Lister() apiv1alpha1.BackendLister +} + +type backendInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewBackendInformer constructs a new informer for Backend type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewBackendInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredBackendInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredBackendInformer constructs a new informer for Backend type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredBackendInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.EnvoyGatewayV1alpha1().Backends(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.EnvoyGatewayV1alpha1().Backends(namespace).Watch(context.TODO(), options) + }, + }, + &gatewayapiv1alpha1.Backend{}, + resyncPeriod, + indexers, + ) +} + +func (f *backendInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredBackendInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *backendInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&gatewayapiv1alpha1.Backend{}, f.defaultInformer) +} + +func (f *backendInformer) Lister() apiv1alpha1.BackendLister { + return apiv1alpha1.NewBackendLister(f.Informer().GetIndexer()) +} diff --git a/pkg/informers/externalversions/api/v1alpha1/backendtrafficpolicy.go b/pkg/informers/externalversions/api/v1alpha1/backendtrafficpolicy.go new file mode 100644 index 00000000000..c170a6ee404 --- /dev/null +++ b/pkg/informers/externalversions/api/v1alpha1/backendtrafficpolicy.go @@ -0,0 +1,79 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + time "time" + + gatewayapiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + versioned "github.com/envoyproxy/gateway/pkg/clientset/versioned" + internalinterfaces "github.com/envoyproxy/gateway/pkg/informers/externalversions/internalinterfaces" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/listers/api/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// BackendTrafficPolicyInformer provides access to a shared informer and lister for +// BackendTrafficPolicies. +type BackendTrafficPolicyInformer interface { + Informer() cache.SharedIndexInformer + Lister() apiv1alpha1.BackendTrafficPolicyLister +} + +type backendTrafficPolicyInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewBackendTrafficPolicyInformer constructs a new informer for BackendTrafficPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewBackendTrafficPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredBackendTrafficPolicyInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredBackendTrafficPolicyInformer constructs a new informer for BackendTrafficPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredBackendTrafficPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.EnvoyGatewayV1alpha1().BackendTrafficPolicies(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.EnvoyGatewayV1alpha1().BackendTrafficPolicies(namespace).Watch(context.TODO(), options) + }, + }, + &gatewayapiv1alpha1.BackendTrafficPolicy{}, + resyncPeriod, + indexers, + ) +} + +func (f *backendTrafficPolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredBackendTrafficPolicyInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *backendTrafficPolicyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&gatewayapiv1alpha1.BackendTrafficPolicy{}, f.defaultInformer) +} + +func (f *backendTrafficPolicyInformer) Lister() apiv1alpha1.BackendTrafficPolicyLister { + return apiv1alpha1.NewBackendTrafficPolicyLister(f.Informer().GetIndexer()) +} diff --git a/pkg/informers/externalversions/api/v1alpha1/clienttrafficpolicy.go b/pkg/informers/externalversions/api/v1alpha1/clienttrafficpolicy.go new file mode 100644 index 00000000000..34657c52dcf --- /dev/null +++ b/pkg/informers/externalversions/api/v1alpha1/clienttrafficpolicy.go @@ -0,0 +1,79 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + time "time" + + gatewayapiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + versioned "github.com/envoyproxy/gateway/pkg/clientset/versioned" + internalinterfaces "github.com/envoyproxy/gateway/pkg/informers/externalversions/internalinterfaces" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/listers/api/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ClientTrafficPolicyInformer provides access to a shared informer and lister for +// ClientTrafficPolicies. +type ClientTrafficPolicyInformer interface { + Informer() cache.SharedIndexInformer + Lister() apiv1alpha1.ClientTrafficPolicyLister +} + +type clientTrafficPolicyInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewClientTrafficPolicyInformer constructs a new informer for ClientTrafficPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewClientTrafficPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredClientTrafficPolicyInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredClientTrafficPolicyInformer constructs a new informer for ClientTrafficPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredClientTrafficPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.EnvoyGatewayV1alpha1().ClientTrafficPolicies(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.EnvoyGatewayV1alpha1().ClientTrafficPolicies(namespace).Watch(context.TODO(), options) + }, + }, + &gatewayapiv1alpha1.ClientTrafficPolicy{}, + resyncPeriod, + indexers, + ) +} + +func (f *clientTrafficPolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredClientTrafficPolicyInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *clientTrafficPolicyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&gatewayapiv1alpha1.ClientTrafficPolicy{}, f.defaultInformer) +} + +func (f *clientTrafficPolicyInformer) Lister() apiv1alpha1.ClientTrafficPolicyLister { + return apiv1alpha1.NewClientTrafficPolicyLister(f.Informer().GetIndexer()) +} diff --git a/pkg/informers/externalversions/api/v1alpha1/envoyextensionpolicy.go b/pkg/informers/externalversions/api/v1alpha1/envoyextensionpolicy.go new file mode 100644 index 00000000000..88877398a99 --- /dev/null +++ b/pkg/informers/externalversions/api/v1alpha1/envoyextensionpolicy.go @@ -0,0 +1,79 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + time "time" + + gatewayapiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + versioned "github.com/envoyproxy/gateway/pkg/clientset/versioned" + internalinterfaces "github.com/envoyproxy/gateway/pkg/informers/externalversions/internalinterfaces" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/listers/api/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// EnvoyExtensionPolicyInformer provides access to a shared informer and lister for +// EnvoyExtensionPolicies. +type EnvoyExtensionPolicyInformer interface { + Informer() cache.SharedIndexInformer + Lister() apiv1alpha1.EnvoyExtensionPolicyLister +} + +type envoyExtensionPolicyInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewEnvoyExtensionPolicyInformer constructs a new informer for EnvoyExtensionPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewEnvoyExtensionPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredEnvoyExtensionPolicyInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredEnvoyExtensionPolicyInformer constructs a new informer for EnvoyExtensionPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredEnvoyExtensionPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.EnvoyGatewayV1alpha1().EnvoyExtensionPolicies(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.EnvoyGatewayV1alpha1().EnvoyExtensionPolicies(namespace).Watch(context.TODO(), options) + }, + }, + &gatewayapiv1alpha1.EnvoyExtensionPolicy{}, + resyncPeriod, + indexers, + ) +} + +func (f *envoyExtensionPolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredEnvoyExtensionPolicyInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *envoyExtensionPolicyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&gatewayapiv1alpha1.EnvoyExtensionPolicy{}, f.defaultInformer) +} + +func (f *envoyExtensionPolicyInformer) Lister() apiv1alpha1.EnvoyExtensionPolicyLister { + return apiv1alpha1.NewEnvoyExtensionPolicyLister(f.Informer().GetIndexer()) +} diff --git a/pkg/informers/externalversions/api/v1alpha1/envoypatchpolicy.go b/pkg/informers/externalversions/api/v1alpha1/envoypatchpolicy.go new file mode 100644 index 00000000000..07ebbf7a92d --- /dev/null +++ b/pkg/informers/externalversions/api/v1alpha1/envoypatchpolicy.go @@ -0,0 +1,79 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + time "time" + + gatewayapiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + versioned "github.com/envoyproxy/gateway/pkg/clientset/versioned" + internalinterfaces "github.com/envoyproxy/gateway/pkg/informers/externalversions/internalinterfaces" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/listers/api/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// EnvoyPatchPolicyInformer provides access to a shared informer and lister for +// EnvoyPatchPolicies. +type EnvoyPatchPolicyInformer interface { + Informer() cache.SharedIndexInformer + Lister() apiv1alpha1.EnvoyPatchPolicyLister +} + +type envoyPatchPolicyInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewEnvoyPatchPolicyInformer constructs a new informer for EnvoyPatchPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewEnvoyPatchPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredEnvoyPatchPolicyInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredEnvoyPatchPolicyInformer constructs a new informer for EnvoyPatchPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredEnvoyPatchPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.EnvoyGatewayV1alpha1().EnvoyPatchPolicies(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.EnvoyGatewayV1alpha1().EnvoyPatchPolicies(namespace).Watch(context.TODO(), options) + }, + }, + &gatewayapiv1alpha1.EnvoyPatchPolicy{}, + resyncPeriod, + indexers, + ) +} + +func (f *envoyPatchPolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredEnvoyPatchPolicyInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *envoyPatchPolicyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&gatewayapiv1alpha1.EnvoyPatchPolicy{}, f.defaultInformer) +} + +func (f *envoyPatchPolicyInformer) Lister() apiv1alpha1.EnvoyPatchPolicyLister { + return apiv1alpha1.NewEnvoyPatchPolicyLister(f.Informer().GetIndexer()) +} diff --git a/pkg/informers/externalversions/api/v1alpha1/envoyproxy.go b/pkg/informers/externalversions/api/v1alpha1/envoyproxy.go new file mode 100644 index 00000000000..3208169318a --- /dev/null +++ b/pkg/informers/externalversions/api/v1alpha1/envoyproxy.go @@ -0,0 +1,79 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + time "time" + + gatewayapiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + versioned "github.com/envoyproxy/gateway/pkg/clientset/versioned" + internalinterfaces "github.com/envoyproxy/gateway/pkg/informers/externalversions/internalinterfaces" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/listers/api/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// EnvoyProxyInformer provides access to a shared informer and lister for +// EnvoyProxies. +type EnvoyProxyInformer interface { + Informer() cache.SharedIndexInformer + Lister() apiv1alpha1.EnvoyProxyLister +} + +type envoyProxyInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewEnvoyProxyInformer constructs a new informer for EnvoyProxy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewEnvoyProxyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredEnvoyProxyInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredEnvoyProxyInformer constructs a new informer for EnvoyProxy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredEnvoyProxyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.EnvoyGatewayV1alpha1().EnvoyProxies(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.EnvoyGatewayV1alpha1().EnvoyProxies(namespace).Watch(context.TODO(), options) + }, + }, + &gatewayapiv1alpha1.EnvoyProxy{}, + resyncPeriod, + indexers, + ) +} + +func (f *envoyProxyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredEnvoyProxyInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *envoyProxyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&gatewayapiv1alpha1.EnvoyProxy{}, f.defaultInformer) +} + +func (f *envoyProxyInformer) Lister() apiv1alpha1.EnvoyProxyLister { + return apiv1alpha1.NewEnvoyProxyLister(f.Informer().GetIndexer()) +} diff --git a/pkg/informers/externalversions/api/v1alpha1/httproutefilter.go b/pkg/informers/externalversions/api/v1alpha1/httproutefilter.go new file mode 100644 index 00000000000..f5b6bfb50be --- /dev/null +++ b/pkg/informers/externalversions/api/v1alpha1/httproutefilter.go @@ -0,0 +1,79 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + time "time" + + gatewayapiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + versioned "github.com/envoyproxy/gateway/pkg/clientset/versioned" + internalinterfaces "github.com/envoyproxy/gateway/pkg/informers/externalversions/internalinterfaces" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/listers/api/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// HTTPRouteFilterInformer provides access to a shared informer and lister for +// HTTPRouteFilters. +type HTTPRouteFilterInformer interface { + Informer() cache.SharedIndexInformer + Lister() apiv1alpha1.HTTPRouteFilterLister +} + +type hTTPRouteFilterInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewHTTPRouteFilterInformer constructs a new informer for HTTPRouteFilter type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewHTTPRouteFilterInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredHTTPRouteFilterInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredHTTPRouteFilterInformer constructs a new informer for HTTPRouteFilter type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredHTTPRouteFilterInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.EnvoyGatewayV1alpha1().HTTPRouteFilters(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.EnvoyGatewayV1alpha1().HTTPRouteFilters(namespace).Watch(context.TODO(), options) + }, + }, + &gatewayapiv1alpha1.HTTPRouteFilter{}, + resyncPeriod, + indexers, + ) +} + +func (f *hTTPRouteFilterInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredHTTPRouteFilterInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *hTTPRouteFilterInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&gatewayapiv1alpha1.HTTPRouteFilter{}, f.defaultInformer) +} + +func (f *hTTPRouteFilterInformer) Lister() apiv1alpha1.HTTPRouteFilterLister { + return apiv1alpha1.NewHTTPRouteFilterLister(f.Informer().GetIndexer()) +} diff --git a/pkg/informers/externalversions/api/v1alpha1/interface.go b/pkg/informers/externalversions/api/v1alpha1/interface.go new file mode 100644 index 00000000000..7a5150534d6 --- /dev/null +++ b/pkg/informers/externalversions/api/v1alpha1/interface.go @@ -0,0 +1,83 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + internalinterfaces "github.com/envoyproxy/gateway/pkg/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // Backends returns a BackendInformer. + Backends() BackendInformer + // BackendTrafficPolicies returns a BackendTrafficPolicyInformer. + BackendTrafficPolicies() BackendTrafficPolicyInformer + // ClientTrafficPolicies returns a ClientTrafficPolicyInformer. + ClientTrafficPolicies() ClientTrafficPolicyInformer + // EnvoyExtensionPolicies returns a EnvoyExtensionPolicyInformer. + EnvoyExtensionPolicies() EnvoyExtensionPolicyInformer + // EnvoyPatchPolicies returns a EnvoyPatchPolicyInformer. + EnvoyPatchPolicies() EnvoyPatchPolicyInformer + // EnvoyProxies returns a EnvoyProxyInformer. + EnvoyProxies() EnvoyProxyInformer + // HTTPRouteFilters returns a HTTPRouteFilterInformer. + HTTPRouteFilters() HTTPRouteFilterInformer + // SecurityPolicies returns a SecurityPolicyInformer. + SecurityPolicies() SecurityPolicyInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// Backends returns a BackendInformer. +func (v *version) Backends() BackendInformer { + return &backendInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// BackendTrafficPolicies returns a BackendTrafficPolicyInformer. +func (v *version) BackendTrafficPolicies() BackendTrafficPolicyInformer { + return &backendTrafficPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// ClientTrafficPolicies returns a ClientTrafficPolicyInformer. +func (v *version) ClientTrafficPolicies() ClientTrafficPolicyInformer { + return &clientTrafficPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// EnvoyExtensionPolicies returns a EnvoyExtensionPolicyInformer. +func (v *version) EnvoyExtensionPolicies() EnvoyExtensionPolicyInformer { + return &envoyExtensionPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// EnvoyPatchPolicies returns a EnvoyPatchPolicyInformer. +func (v *version) EnvoyPatchPolicies() EnvoyPatchPolicyInformer { + return &envoyPatchPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// EnvoyProxies returns a EnvoyProxyInformer. +func (v *version) EnvoyProxies() EnvoyProxyInformer { + return &envoyProxyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// HTTPRouteFilters returns a HTTPRouteFilterInformer. +func (v *version) HTTPRouteFilters() HTTPRouteFilterInformer { + return &hTTPRouteFilterInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// SecurityPolicies returns a SecurityPolicyInformer. +func (v *version) SecurityPolicies() SecurityPolicyInformer { + return &securityPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/pkg/informers/externalversions/api/v1alpha1/securitypolicy.go b/pkg/informers/externalversions/api/v1alpha1/securitypolicy.go new file mode 100644 index 00000000000..9a3b5deb991 --- /dev/null +++ b/pkg/informers/externalversions/api/v1alpha1/securitypolicy.go @@ -0,0 +1,79 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + time "time" + + gatewayapiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + versioned "github.com/envoyproxy/gateway/pkg/clientset/versioned" + internalinterfaces "github.com/envoyproxy/gateway/pkg/informers/externalversions/internalinterfaces" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/listers/api/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// SecurityPolicyInformer provides access to a shared informer and lister for +// SecurityPolicies. +type SecurityPolicyInformer interface { + Informer() cache.SharedIndexInformer + Lister() apiv1alpha1.SecurityPolicyLister +} + +type securityPolicyInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewSecurityPolicyInformer constructs a new informer for SecurityPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewSecurityPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredSecurityPolicyInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredSecurityPolicyInformer constructs a new informer for SecurityPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredSecurityPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.EnvoyGatewayV1alpha1().SecurityPolicies(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.EnvoyGatewayV1alpha1().SecurityPolicies(namespace).Watch(context.TODO(), options) + }, + }, + &gatewayapiv1alpha1.SecurityPolicy{}, + resyncPeriod, + indexers, + ) +} + +func (f *securityPolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredSecurityPolicyInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *securityPolicyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&gatewayapiv1alpha1.SecurityPolicy{}, f.defaultInformer) +} + +func (f *securityPolicyInformer) Lister() apiv1alpha1.SecurityPolicyLister { + return apiv1alpha1.NewSecurityPolicyLister(f.Informer().GetIndexer()) +} diff --git a/pkg/informers/externalversions/factory.go b/pkg/informers/externalversions/factory.go new file mode 100644 index 00000000000..c0c41bfe4e3 --- /dev/null +++ b/pkg/informers/externalversions/factory.go @@ -0,0 +1,251 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + reflect "reflect" + sync "sync" + time "time" + + versioned "github.com/envoyproxy/gateway/pkg/clientset/versioned" + api "github.com/envoyproxy/gateway/pkg/informers/externalversions/api" + internalinterfaces "github.com/envoyproxy/gateway/pkg/informers/externalversions/internalinterfaces" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" +) + +// SharedInformerOption defines the functional option type for SharedInformerFactory. +type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory + +type sharedInformerFactory struct { + client versioned.Interface + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc + lock sync.Mutex + defaultResync time.Duration + customResync map[reflect.Type]time.Duration + transform cache.TransformFunc + + informers map[reflect.Type]cache.SharedIndexInformer + // startedInformers is used for tracking which informers have been started. + // This allows Start() to be called multiple times safely. + startedInformers map[reflect.Type]bool + // wg tracks how many goroutines were started. + wg sync.WaitGroup + // shuttingDown is true when Shutdown has been called. It may still be running + // because it needs to wait for goroutines. + shuttingDown bool +} + +// WithCustomResyncConfig sets a custom resync period for the specified informer types. +func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + for k, v := range resyncConfig { + factory.customResync[reflect.TypeOf(k)] = v + } + return factory + } +} + +// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. +func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.tweakListOptions = tweakListOptions + return factory + } +} + +// WithNamespace limits the SharedInformerFactory to the specified namespace. +func WithNamespace(namespace string) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.namespace = namespace + return factory + } +} + +// WithTransform sets a transform on all informers. +func WithTransform(transform cache.TransformFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.transform = transform + return factory + } +} + +// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. +func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync) +} + +// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. +// Listers obtained via this SharedInformerFactory will be subject to the same filters +// as specified here. +// Deprecated: Please use NewSharedInformerFactoryWithOptions instead +func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) +} + +// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. +func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { + factory := &sharedInformerFactory{ + client: client, + namespace: v1.NamespaceAll, + defaultResync: defaultResync, + informers: make(map[reflect.Type]cache.SharedIndexInformer), + startedInformers: make(map[reflect.Type]bool), + customResync: make(map[reflect.Type]time.Duration), + } + + // Apply all options + for _, opt := range options { + factory = opt(factory) + } + + return factory +} + +func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { + f.lock.Lock() + defer f.lock.Unlock() + + if f.shuttingDown { + return + } + + for informerType, informer := range f.informers { + if !f.startedInformers[informerType] { + f.wg.Add(1) + // We need a new variable in each loop iteration, + // otherwise the goroutine would use the loop variable + // and that keeps changing. + informer := informer + go func() { + defer f.wg.Done() + informer.Run(stopCh) + }() + f.startedInformers[informerType] = true + } + } +} + +func (f *sharedInformerFactory) Shutdown() { + f.lock.Lock() + f.shuttingDown = true + f.lock.Unlock() + + // Will return immediately if there is nothing to wait for. + f.wg.Wait() +} + +func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { + informers := func() map[reflect.Type]cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informers := map[reflect.Type]cache.SharedIndexInformer{} + for informerType, informer := range f.informers { + if f.startedInformers[informerType] { + informers[informerType] = informer + } + } + return informers + }() + + res := map[reflect.Type]bool{} + for informType, informer := range informers { + res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) + } + return res +} + +// InformerFor returns the SharedIndexInformer for obj using an internal +// client. +func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informerType := reflect.TypeOf(obj) + informer, exists := f.informers[informerType] + if exists { + return informer + } + + resyncPeriod, exists := f.customResync[informerType] + if !exists { + resyncPeriod = f.defaultResync + } + + informer = newFunc(f.client, resyncPeriod) + informer.SetTransform(f.transform) + f.informers[informerType] = informer + + return informer +} + +// SharedInformerFactory provides shared informers for resources in all known +// API group versions. +// +// It is typically used like this: +// +// ctx, cancel := context.Background() +// defer cancel() +// factory := NewSharedInformerFactory(client, resyncPeriod) +// defer factory.WaitForStop() // Returns immediately if nothing was started. +// genericInformer := factory.ForResource(resource) +// typedInformer := factory.SomeAPIGroup().V1().SomeType() +// factory.Start(ctx.Done()) // Start processing these informers. +// synced := factory.WaitForCacheSync(ctx.Done()) +// for v, ok := range synced { +// if !ok { +// fmt.Fprintf(os.Stderr, "caches failed to sync: %v", v) +// return +// } +// } +// +// // Creating informers can also be created after Start, but then +// // Start must be called again: +// anotherGenericInformer := factory.ForResource(resource) +// factory.Start(ctx.Done()) +type SharedInformerFactory interface { + internalinterfaces.SharedInformerFactory + + // Start initializes all requested informers. They are handled in goroutines + // which run until the stop channel gets closed. + // Warning: Start does not block. When run in a go-routine, it will race with a later WaitForCacheSync. + Start(stopCh <-chan struct{}) + + // Shutdown marks a factory as shutting down. At that point no new + // informers can be started anymore and Start will return without + // doing anything. + // + // In addition, Shutdown blocks until all goroutines have terminated. For that + // to happen, the close channel(s) that they were started with must be closed, + // either before Shutdown gets called or while it is waiting. + // + // Shutdown may be called multiple times, even concurrently. All such calls will + // block until all goroutines have terminated. + Shutdown() + + // WaitForCacheSync blocks until all started informers' caches were synced + // or the stop channel gets closed. + WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + + // ForResource gives generic access to a shared informer of the matching type. + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + + // InformerFor returns the SharedIndexInformer for obj using an internal + // client. + InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer + + EnvoyGateway() api.Interface +} + +func (f *sharedInformerFactory) EnvoyGateway() api.Interface { + return api.New(f, f.namespace, f.tweakListOptions) +} diff --git a/pkg/informers/externalversions/generic.go b/pkg/informers/externalversions/generic.go new file mode 100644 index 00000000000..214583899d0 --- /dev/null +++ b/pkg/informers/externalversions/generic.go @@ -0,0 +1,65 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + fmt "fmt" + + v1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" +) + +// GenericInformer is type of SharedIndexInformer which will locate and delegate to other +// sharedInformers based on type +type GenericInformer interface { + Informer() cache.SharedIndexInformer + Lister() cache.GenericLister +} + +type genericInformer struct { + informer cache.SharedIndexInformer + resource schema.GroupResource +} + +// Informer returns the SharedIndexInformer. +func (f *genericInformer) Informer() cache.SharedIndexInformer { + return f.informer +} + +// Lister returns the GenericLister. +func (f *genericInformer) Lister() cache.GenericLister { + return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) +} + +// ForResource gives generic access to a shared informer of the matching type +// TODO extend this to unknown resources with a client pool +func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { + switch resource { + // Group=gateway.envoyproxy.io, Version=v1alpha1 + case v1alpha1.SchemeGroupVersion.WithResource("backends"): + return &genericInformer{resource: resource.GroupResource(), informer: f.EnvoyGateway().V1alpha1().Backends().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("backendtrafficpolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.EnvoyGateway().V1alpha1().BackendTrafficPolicies().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("clienttrafficpolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.EnvoyGateway().V1alpha1().ClientTrafficPolicies().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("envoyextensionpolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.EnvoyGateway().V1alpha1().EnvoyExtensionPolicies().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("envoypatchpolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.EnvoyGateway().V1alpha1().EnvoyPatchPolicies().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("envoyproxies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.EnvoyGateway().V1alpha1().EnvoyProxies().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("httproutefilters"): + return &genericInformer{resource: resource.GroupResource(), informer: f.EnvoyGateway().V1alpha1().HTTPRouteFilters().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("securitypolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.EnvoyGateway().V1alpha1().SecurityPolicies().Informer()}, nil + + } + + return nil, fmt.Errorf("no informer found for %v", resource) +} diff --git a/pkg/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/informers/externalversions/internalinterfaces/factory_interfaces.go new file mode 100644 index 00000000000..247fe26fc40 --- /dev/null +++ b/pkg/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -0,0 +1,29 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by informer-gen. DO NOT EDIT. + +package internalinterfaces + +import ( + time "time" + + versioned "github.com/envoyproxy/gateway/pkg/clientset/versioned" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + cache "k8s.io/client-go/tools/cache" +) + +// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. +type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer + +// SharedInformerFactory a small interface to allow for adding an informer without an import cycle +type SharedInformerFactory interface { + Start(stopCh <-chan struct{}) + InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer +} + +// TweakListOptionsFunc is a function that transforms a v1.ListOptions. +type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/pkg/listers/api/v1alpha1/backend.go b/pkg/listers/api/v1alpha1/backend.go new file mode 100644 index 00000000000..69251b8e6a2 --- /dev/null +++ b/pkg/listers/api/v1alpha1/backend.go @@ -0,0 +1,59 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// BackendLister helps list Backends. +// All objects returned here must be treated as read-only. +type BackendLister interface { + // List lists all Backends in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*apiv1alpha1.Backend, err error) + // Backends returns an object that can list and get Backends. + Backends(namespace string) BackendNamespaceLister + BackendListerExpansion +} + +// backendLister implements the BackendLister interface. +type backendLister struct { + listers.ResourceIndexer[*apiv1alpha1.Backend] +} + +// NewBackendLister returns a new BackendLister. +func NewBackendLister(indexer cache.Indexer) BackendLister { + return &backendLister{listers.New[*apiv1alpha1.Backend](indexer, apiv1alpha1.Resource("backend"))} +} + +// Backends returns an object that can list and get Backends. +func (s *backendLister) Backends(namespace string) BackendNamespaceLister { + return backendNamespaceLister{listers.NewNamespaced[*apiv1alpha1.Backend](s.ResourceIndexer, namespace)} +} + +// BackendNamespaceLister helps list and get Backends. +// All objects returned here must be treated as read-only. +type BackendNamespaceLister interface { + // List lists all Backends in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*apiv1alpha1.Backend, err error) + // Get retrieves the Backend from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*apiv1alpha1.Backend, error) + BackendNamespaceListerExpansion +} + +// backendNamespaceLister implements the BackendNamespaceLister +// interface. +type backendNamespaceLister struct { + listers.ResourceIndexer[*apiv1alpha1.Backend] +} diff --git a/pkg/listers/api/v1alpha1/backendtrafficpolicy.go b/pkg/listers/api/v1alpha1/backendtrafficpolicy.go new file mode 100644 index 00000000000..3037a25cf72 --- /dev/null +++ b/pkg/listers/api/v1alpha1/backendtrafficpolicy.go @@ -0,0 +1,59 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// BackendTrafficPolicyLister helps list BackendTrafficPolicies. +// All objects returned here must be treated as read-only. +type BackendTrafficPolicyLister interface { + // List lists all BackendTrafficPolicies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*apiv1alpha1.BackendTrafficPolicy, err error) + // BackendTrafficPolicies returns an object that can list and get BackendTrafficPolicies. + BackendTrafficPolicies(namespace string) BackendTrafficPolicyNamespaceLister + BackendTrafficPolicyListerExpansion +} + +// backendTrafficPolicyLister implements the BackendTrafficPolicyLister interface. +type backendTrafficPolicyLister struct { + listers.ResourceIndexer[*apiv1alpha1.BackendTrafficPolicy] +} + +// NewBackendTrafficPolicyLister returns a new BackendTrafficPolicyLister. +func NewBackendTrafficPolicyLister(indexer cache.Indexer) BackendTrafficPolicyLister { + return &backendTrafficPolicyLister{listers.New[*apiv1alpha1.BackendTrafficPolicy](indexer, apiv1alpha1.Resource("backendtrafficpolicy"))} +} + +// BackendTrafficPolicies returns an object that can list and get BackendTrafficPolicies. +func (s *backendTrafficPolicyLister) BackendTrafficPolicies(namespace string) BackendTrafficPolicyNamespaceLister { + return backendTrafficPolicyNamespaceLister{listers.NewNamespaced[*apiv1alpha1.BackendTrafficPolicy](s.ResourceIndexer, namespace)} +} + +// BackendTrafficPolicyNamespaceLister helps list and get BackendTrafficPolicies. +// All objects returned here must be treated as read-only. +type BackendTrafficPolicyNamespaceLister interface { + // List lists all BackendTrafficPolicies in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*apiv1alpha1.BackendTrafficPolicy, err error) + // Get retrieves the BackendTrafficPolicy from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*apiv1alpha1.BackendTrafficPolicy, error) + BackendTrafficPolicyNamespaceListerExpansion +} + +// backendTrafficPolicyNamespaceLister implements the BackendTrafficPolicyNamespaceLister +// interface. +type backendTrafficPolicyNamespaceLister struct { + listers.ResourceIndexer[*apiv1alpha1.BackendTrafficPolicy] +} diff --git a/pkg/listers/api/v1alpha1/clienttrafficpolicy.go b/pkg/listers/api/v1alpha1/clienttrafficpolicy.go new file mode 100644 index 00000000000..8d787f9f0bb --- /dev/null +++ b/pkg/listers/api/v1alpha1/clienttrafficpolicy.go @@ -0,0 +1,59 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// ClientTrafficPolicyLister helps list ClientTrafficPolicies. +// All objects returned here must be treated as read-only. +type ClientTrafficPolicyLister interface { + // List lists all ClientTrafficPolicies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*apiv1alpha1.ClientTrafficPolicy, err error) + // ClientTrafficPolicies returns an object that can list and get ClientTrafficPolicies. + ClientTrafficPolicies(namespace string) ClientTrafficPolicyNamespaceLister + ClientTrafficPolicyListerExpansion +} + +// clientTrafficPolicyLister implements the ClientTrafficPolicyLister interface. +type clientTrafficPolicyLister struct { + listers.ResourceIndexer[*apiv1alpha1.ClientTrafficPolicy] +} + +// NewClientTrafficPolicyLister returns a new ClientTrafficPolicyLister. +func NewClientTrafficPolicyLister(indexer cache.Indexer) ClientTrafficPolicyLister { + return &clientTrafficPolicyLister{listers.New[*apiv1alpha1.ClientTrafficPolicy](indexer, apiv1alpha1.Resource("clienttrafficpolicy"))} +} + +// ClientTrafficPolicies returns an object that can list and get ClientTrafficPolicies. +func (s *clientTrafficPolicyLister) ClientTrafficPolicies(namespace string) ClientTrafficPolicyNamespaceLister { + return clientTrafficPolicyNamespaceLister{listers.NewNamespaced[*apiv1alpha1.ClientTrafficPolicy](s.ResourceIndexer, namespace)} +} + +// ClientTrafficPolicyNamespaceLister helps list and get ClientTrafficPolicies. +// All objects returned here must be treated as read-only. +type ClientTrafficPolicyNamespaceLister interface { + // List lists all ClientTrafficPolicies in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*apiv1alpha1.ClientTrafficPolicy, err error) + // Get retrieves the ClientTrafficPolicy from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*apiv1alpha1.ClientTrafficPolicy, error) + ClientTrafficPolicyNamespaceListerExpansion +} + +// clientTrafficPolicyNamespaceLister implements the ClientTrafficPolicyNamespaceLister +// interface. +type clientTrafficPolicyNamespaceLister struct { + listers.ResourceIndexer[*apiv1alpha1.ClientTrafficPolicy] +} diff --git a/pkg/listers/api/v1alpha1/envoyextensionpolicy.go b/pkg/listers/api/v1alpha1/envoyextensionpolicy.go new file mode 100644 index 00000000000..e1d834fb83b --- /dev/null +++ b/pkg/listers/api/v1alpha1/envoyextensionpolicy.go @@ -0,0 +1,59 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// EnvoyExtensionPolicyLister helps list EnvoyExtensionPolicies. +// All objects returned here must be treated as read-only. +type EnvoyExtensionPolicyLister interface { + // List lists all EnvoyExtensionPolicies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*apiv1alpha1.EnvoyExtensionPolicy, err error) + // EnvoyExtensionPolicies returns an object that can list and get EnvoyExtensionPolicies. + EnvoyExtensionPolicies(namespace string) EnvoyExtensionPolicyNamespaceLister + EnvoyExtensionPolicyListerExpansion +} + +// envoyExtensionPolicyLister implements the EnvoyExtensionPolicyLister interface. +type envoyExtensionPolicyLister struct { + listers.ResourceIndexer[*apiv1alpha1.EnvoyExtensionPolicy] +} + +// NewEnvoyExtensionPolicyLister returns a new EnvoyExtensionPolicyLister. +func NewEnvoyExtensionPolicyLister(indexer cache.Indexer) EnvoyExtensionPolicyLister { + return &envoyExtensionPolicyLister{listers.New[*apiv1alpha1.EnvoyExtensionPolicy](indexer, apiv1alpha1.Resource("envoyextensionpolicy"))} +} + +// EnvoyExtensionPolicies returns an object that can list and get EnvoyExtensionPolicies. +func (s *envoyExtensionPolicyLister) EnvoyExtensionPolicies(namespace string) EnvoyExtensionPolicyNamespaceLister { + return envoyExtensionPolicyNamespaceLister{listers.NewNamespaced[*apiv1alpha1.EnvoyExtensionPolicy](s.ResourceIndexer, namespace)} +} + +// EnvoyExtensionPolicyNamespaceLister helps list and get EnvoyExtensionPolicies. +// All objects returned here must be treated as read-only. +type EnvoyExtensionPolicyNamespaceLister interface { + // List lists all EnvoyExtensionPolicies in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*apiv1alpha1.EnvoyExtensionPolicy, err error) + // Get retrieves the EnvoyExtensionPolicy from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*apiv1alpha1.EnvoyExtensionPolicy, error) + EnvoyExtensionPolicyNamespaceListerExpansion +} + +// envoyExtensionPolicyNamespaceLister implements the EnvoyExtensionPolicyNamespaceLister +// interface. +type envoyExtensionPolicyNamespaceLister struct { + listers.ResourceIndexer[*apiv1alpha1.EnvoyExtensionPolicy] +} diff --git a/pkg/listers/api/v1alpha1/envoypatchpolicy.go b/pkg/listers/api/v1alpha1/envoypatchpolicy.go new file mode 100644 index 00000000000..f2d2311644c --- /dev/null +++ b/pkg/listers/api/v1alpha1/envoypatchpolicy.go @@ -0,0 +1,59 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// EnvoyPatchPolicyLister helps list EnvoyPatchPolicies. +// All objects returned here must be treated as read-only. +type EnvoyPatchPolicyLister interface { + // List lists all EnvoyPatchPolicies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*apiv1alpha1.EnvoyPatchPolicy, err error) + // EnvoyPatchPolicies returns an object that can list and get EnvoyPatchPolicies. + EnvoyPatchPolicies(namespace string) EnvoyPatchPolicyNamespaceLister + EnvoyPatchPolicyListerExpansion +} + +// envoyPatchPolicyLister implements the EnvoyPatchPolicyLister interface. +type envoyPatchPolicyLister struct { + listers.ResourceIndexer[*apiv1alpha1.EnvoyPatchPolicy] +} + +// NewEnvoyPatchPolicyLister returns a new EnvoyPatchPolicyLister. +func NewEnvoyPatchPolicyLister(indexer cache.Indexer) EnvoyPatchPolicyLister { + return &envoyPatchPolicyLister{listers.New[*apiv1alpha1.EnvoyPatchPolicy](indexer, apiv1alpha1.Resource("envoypatchpolicy"))} +} + +// EnvoyPatchPolicies returns an object that can list and get EnvoyPatchPolicies. +func (s *envoyPatchPolicyLister) EnvoyPatchPolicies(namespace string) EnvoyPatchPolicyNamespaceLister { + return envoyPatchPolicyNamespaceLister{listers.NewNamespaced[*apiv1alpha1.EnvoyPatchPolicy](s.ResourceIndexer, namespace)} +} + +// EnvoyPatchPolicyNamespaceLister helps list and get EnvoyPatchPolicies. +// All objects returned here must be treated as read-only. +type EnvoyPatchPolicyNamespaceLister interface { + // List lists all EnvoyPatchPolicies in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*apiv1alpha1.EnvoyPatchPolicy, err error) + // Get retrieves the EnvoyPatchPolicy from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*apiv1alpha1.EnvoyPatchPolicy, error) + EnvoyPatchPolicyNamespaceListerExpansion +} + +// envoyPatchPolicyNamespaceLister implements the EnvoyPatchPolicyNamespaceLister +// interface. +type envoyPatchPolicyNamespaceLister struct { + listers.ResourceIndexer[*apiv1alpha1.EnvoyPatchPolicy] +} diff --git a/pkg/listers/api/v1alpha1/envoyproxy.go b/pkg/listers/api/v1alpha1/envoyproxy.go new file mode 100644 index 00000000000..b8ab7e92d4d --- /dev/null +++ b/pkg/listers/api/v1alpha1/envoyproxy.go @@ -0,0 +1,59 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// EnvoyProxyLister helps list EnvoyProxies. +// All objects returned here must be treated as read-only. +type EnvoyProxyLister interface { + // List lists all EnvoyProxies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*apiv1alpha1.EnvoyProxy, err error) + // EnvoyProxies returns an object that can list and get EnvoyProxies. + EnvoyProxies(namespace string) EnvoyProxyNamespaceLister + EnvoyProxyListerExpansion +} + +// envoyProxyLister implements the EnvoyProxyLister interface. +type envoyProxyLister struct { + listers.ResourceIndexer[*apiv1alpha1.EnvoyProxy] +} + +// NewEnvoyProxyLister returns a new EnvoyProxyLister. +func NewEnvoyProxyLister(indexer cache.Indexer) EnvoyProxyLister { + return &envoyProxyLister{listers.New[*apiv1alpha1.EnvoyProxy](indexer, apiv1alpha1.Resource("envoyproxy"))} +} + +// EnvoyProxies returns an object that can list and get EnvoyProxies. +func (s *envoyProxyLister) EnvoyProxies(namespace string) EnvoyProxyNamespaceLister { + return envoyProxyNamespaceLister{listers.NewNamespaced[*apiv1alpha1.EnvoyProxy](s.ResourceIndexer, namespace)} +} + +// EnvoyProxyNamespaceLister helps list and get EnvoyProxies. +// All objects returned here must be treated as read-only. +type EnvoyProxyNamespaceLister interface { + // List lists all EnvoyProxies in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*apiv1alpha1.EnvoyProxy, err error) + // Get retrieves the EnvoyProxy from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*apiv1alpha1.EnvoyProxy, error) + EnvoyProxyNamespaceListerExpansion +} + +// envoyProxyNamespaceLister implements the EnvoyProxyNamespaceLister +// interface. +type envoyProxyNamespaceLister struct { + listers.ResourceIndexer[*apiv1alpha1.EnvoyProxy] +} diff --git a/pkg/listers/api/v1alpha1/expansion_generated.go b/pkg/listers/api/v1alpha1/expansion_generated.go new file mode 100644 index 00000000000..e7f8e5e99d1 --- /dev/null +++ b/pkg/listers/api/v1alpha1/expansion_generated.go @@ -0,0 +1,72 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +// BackendListerExpansion allows custom methods to be added to +// BackendLister. +type BackendListerExpansion interface{} + +// BackendNamespaceListerExpansion allows custom methods to be added to +// BackendNamespaceLister. +type BackendNamespaceListerExpansion interface{} + +// BackendTrafficPolicyListerExpansion allows custom methods to be added to +// BackendTrafficPolicyLister. +type BackendTrafficPolicyListerExpansion interface{} + +// BackendTrafficPolicyNamespaceListerExpansion allows custom methods to be added to +// BackendTrafficPolicyNamespaceLister. +type BackendTrafficPolicyNamespaceListerExpansion interface{} + +// ClientTrafficPolicyListerExpansion allows custom methods to be added to +// ClientTrafficPolicyLister. +type ClientTrafficPolicyListerExpansion interface{} + +// ClientTrafficPolicyNamespaceListerExpansion allows custom methods to be added to +// ClientTrafficPolicyNamespaceLister. +type ClientTrafficPolicyNamespaceListerExpansion interface{} + +// EnvoyExtensionPolicyListerExpansion allows custom methods to be added to +// EnvoyExtensionPolicyLister. +type EnvoyExtensionPolicyListerExpansion interface{} + +// EnvoyExtensionPolicyNamespaceListerExpansion allows custom methods to be added to +// EnvoyExtensionPolicyNamespaceLister. +type EnvoyExtensionPolicyNamespaceListerExpansion interface{} + +// EnvoyPatchPolicyListerExpansion allows custom methods to be added to +// EnvoyPatchPolicyLister. +type EnvoyPatchPolicyListerExpansion interface{} + +// EnvoyPatchPolicyNamespaceListerExpansion allows custom methods to be added to +// EnvoyPatchPolicyNamespaceLister. +type EnvoyPatchPolicyNamespaceListerExpansion interface{} + +// EnvoyProxyListerExpansion allows custom methods to be added to +// EnvoyProxyLister. +type EnvoyProxyListerExpansion interface{} + +// EnvoyProxyNamespaceListerExpansion allows custom methods to be added to +// EnvoyProxyNamespaceLister. +type EnvoyProxyNamespaceListerExpansion interface{} + +// HTTPRouteFilterListerExpansion allows custom methods to be added to +// HTTPRouteFilterLister. +type HTTPRouteFilterListerExpansion interface{} + +// HTTPRouteFilterNamespaceListerExpansion allows custom methods to be added to +// HTTPRouteFilterNamespaceLister. +type HTTPRouteFilterNamespaceListerExpansion interface{} + +// SecurityPolicyListerExpansion allows custom methods to be added to +// SecurityPolicyLister. +type SecurityPolicyListerExpansion interface{} + +// SecurityPolicyNamespaceListerExpansion allows custom methods to be added to +// SecurityPolicyNamespaceLister. +type SecurityPolicyNamespaceListerExpansion interface{} diff --git a/pkg/listers/api/v1alpha1/httproutefilter.go b/pkg/listers/api/v1alpha1/httproutefilter.go new file mode 100644 index 00000000000..584d6774879 --- /dev/null +++ b/pkg/listers/api/v1alpha1/httproutefilter.go @@ -0,0 +1,59 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// HTTPRouteFilterLister helps list HTTPRouteFilters. +// All objects returned here must be treated as read-only. +type HTTPRouteFilterLister interface { + // List lists all HTTPRouteFilters in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*apiv1alpha1.HTTPRouteFilter, err error) + // HTTPRouteFilters returns an object that can list and get HTTPRouteFilters. + HTTPRouteFilters(namespace string) HTTPRouteFilterNamespaceLister + HTTPRouteFilterListerExpansion +} + +// hTTPRouteFilterLister implements the HTTPRouteFilterLister interface. +type hTTPRouteFilterLister struct { + listers.ResourceIndexer[*apiv1alpha1.HTTPRouteFilter] +} + +// NewHTTPRouteFilterLister returns a new HTTPRouteFilterLister. +func NewHTTPRouteFilterLister(indexer cache.Indexer) HTTPRouteFilterLister { + return &hTTPRouteFilterLister{listers.New[*apiv1alpha1.HTTPRouteFilter](indexer, apiv1alpha1.Resource("httproutefilter"))} +} + +// HTTPRouteFilters returns an object that can list and get HTTPRouteFilters. +func (s *hTTPRouteFilterLister) HTTPRouteFilters(namespace string) HTTPRouteFilterNamespaceLister { + return hTTPRouteFilterNamespaceLister{listers.NewNamespaced[*apiv1alpha1.HTTPRouteFilter](s.ResourceIndexer, namespace)} +} + +// HTTPRouteFilterNamespaceLister helps list and get HTTPRouteFilters. +// All objects returned here must be treated as read-only. +type HTTPRouteFilterNamespaceLister interface { + // List lists all HTTPRouteFilters in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*apiv1alpha1.HTTPRouteFilter, err error) + // Get retrieves the HTTPRouteFilter from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*apiv1alpha1.HTTPRouteFilter, error) + HTTPRouteFilterNamespaceListerExpansion +} + +// hTTPRouteFilterNamespaceLister implements the HTTPRouteFilterNamespaceLister +// interface. +type hTTPRouteFilterNamespaceLister struct { + listers.ResourceIndexer[*apiv1alpha1.HTTPRouteFilter] +} diff --git a/pkg/listers/api/v1alpha1/securitypolicy.go b/pkg/listers/api/v1alpha1/securitypolicy.go new file mode 100644 index 00000000000..734ca383b15 --- /dev/null +++ b/pkg/listers/api/v1alpha1/securitypolicy.go @@ -0,0 +1,59 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// SecurityPolicyLister helps list SecurityPolicies. +// All objects returned here must be treated as read-only. +type SecurityPolicyLister interface { + // List lists all SecurityPolicies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*apiv1alpha1.SecurityPolicy, err error) + // SecurityPolicies returns an object that can list and get SecurityPolicies. + SecurityPolicies(namespace string) SecurityPolicyNamespaceLister + SecurityPolicyListerExpansion +} + +// securityPolicyLister implements the SecurityPolicyLister interface. +type securityPolicyLister struct { + listers.ResourceIndexer[*apiv1alpha1.SecurityPolicy] +} + +// NewSecurityPolicyLister returns a new SecurityPolicyLister. +func NewSecurityPolicyLister(indexer cache.Indexer) SecurityPolicyLister { + return &securityPolicyLister{listers.New[*apiv1alpha1.SecurityPolicy](indexer, apiv1alpha1.Resource("securitypolicy"))} +} + +// SecurityPolicies returns an object that can list and get SecurityPolicies. +func (s *securityPolicyLister) SecurityPolicies(namespace string) SecurityPolicyNamespaceLister { + return securityPolicyNamespaceLister{listers.NewNamespaced[*apiv1alpha1.SecurityPolicy](s.ResourceIndexer, namespace)} +} + +// SecurityPolicyNamespaceLister helps list and get SecurityPolicies. +// All objects returned here must be treated as read-only. +type SecurityPolicyNamespaceLister interface { + // List lists all SecurityPolicies in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*apiv1alpha1.SecurityPolicy, err error) + // Get retrieves the SecurityPolicy from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*apiv1alpha1.SecurityPolicy, error) + SecurityPolicyNamespaceListerExpansion +} + +// securityPolicyNamespaceLister implements the SecurityPolicyNamespaceLister +// interface. +type securityPolicyNamespaceLister struct { + listers.ResourceIndexer[*apiv1alpha1.SecurityPolicy] +} diff --git a/tools/make/kube.mk b/tools/make/kube.mk index 37a1c67ec15..0cb49884ef2 100644 --- a/tools/make/kube.mk +++ b/tools/make/kube.mk @@ -84,6 +84,46 @@ kube-test: manifests generate $(tools/setup-envtest) ## Run Kubernetes provider @$(LOG_TARGET) KUBEBUILDER_ASSETS="$(shell $(tools/setup-envtest) use $(ENVTEST_K8S_VERSION) -p path)" go test --tags=integration,celvalidation ./... -coverprofile cover.out +.PHONY: kube-generate-register-gen +kube-generate-register-gen: $(tools/register-gen) ## Generate register code for the API group. + @$(LOG_TARGET) + $(tools/register-gen) \ + --output-file zz_generated.register.go \ + --go-header-file ${ROOT_DIR}/tools/boilerplate/boilerplate.go.txt \ + ${ROOT_PACKAGE}/api/v1alpha1 + +.PHONY: kube-generate-client +kube-generate-client: $(tools/client-gen) kube-generate-register-gen ## Generate client code for the API group. + @$(LOG_TARGET) + $(tools/client-gen) \ + --clientset-name versioned \ + --input-base ${ROOT_PACKAGE} \ + --input "api/v1alpha1" \ + --output-dir $(ROOT_DIR)/pkg/clientset \ + --output-pkg ${ROOT_PACKAGE}/pkg/clientset \ + --go-header-file ${ROOT_DIR}/tools/boilerplate/boilerplate.go.txt + + +.PHONY: kube-generate-listers +kube-generate-listers: $(tools/lister-gen) kube-generate-client ## Generate lister code for the API group. + @$(LOG_TARGET) + $(tools/lister-gen) \ + --output-dir $(ROOT_DIR)/pkg/listers \ + --output-pkg ${ROOT_PACKAGE}/pkg/listers \ + --go-header-file ${ROOT_DIR}/tools/boilerplate/boilerplate.go.txt \ + ${ROOT_PACKAGE}/api/v1alpha1 + +.PHONY: kube-generate-informers +kube-generate-informers: $(tools/informer-gen) kube-generate-listers ## Generate informer code for the API group. + @$(LOG_TARGET) + $(tools/informer-gen) \ + --versioned-clientset-package ${ROOT_PACKAGE}/pkg/clientset/versioned \ + --listers-package ${ROOT_PACKAGE}/pkg/listers \ + --output-dir $(ROOT_DIR)/pkg/informers \ + --output-pkg ${ROOT_PACKAGE}/pkg/informers \ + --go-header-file ${ROOT_DIR}/tools/boilerplate/boilerplate.go.txt \ + ${ROOT_PACKAGE}/api/v1alpha1 + ##@ Kubernetes Deployment ifndef ignore-not-found From 291ba35fd661682893633b3dcb378e1c5c0b5692 Mon Sep 17 00:00:00 2001 From: Dave Protasowski Date: Tue, 4 Feb 2025 22:33:56 -0500 Subject: [PATCH 4/9] wire client gen into make generate call Signed-off-by: Dave Protasowski --- tools/make/kube.mk | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/make/kube.mk b/tools/make/kube.mk index 0cb49884ef2..7e34d069515 100644 --- a/tools/make/kube.mk +++ b/tools/make/kube.mk @@ -74,8 +74,12 @@ generate-gwapi-manifests: ## Generate GWAPI manifests and make it consistent wit mv $(OUTPUT_DIR)/gatewayapi-crds.yaml charts/gateway-helm/crds/gatewayapi-crds.yaml .PHONY: kube-generate -kube-generate: $(tools/controller-gen) ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. +kube-generate: kube-generate-informers + +## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. # Note that the paths can't just be "./..." with the header file, or the tool will panic on run. Sorry. +.PHONY: kube-generate-deep-copy +kube-generate-deep-copy: $(tools/controller-gen) @$(LOG_TARGET) $(tools/controller-gen) $(CONTROLLERGEN_OBJECT_FLAGS) paths="{$(ROOT_DIR)/api/...,$(ROOT_DIR)/internal/ir/...,$(ROOT_DIR)/internal/gatewayapi/...}" @@ -85,7 +89,7 @@ kube-test: manifests generate $(tools/setup-envtest) ## Run Kubernetes provider KUBEBUILDER_ASSETS="$(shell $(tools/setup-envtest) use $(ENVTEST_K8S_VERSION) -p path)" go test --tags=integration,celvalidation ./... -coverprofile cover.out .PHONY: kube-generate-register-gen -kube-generate-register-gen: $(tools/register-gen) ## Generate register code for the API group. +kube-generate-register-gen: $(tools/register-gen) kube-generate-deep-copy ## Generate register code for the API group. @$(LOG_TARGET) $(tools/register-gen) \ --output-file zz_generated.register.go \ From f6b0d863e862ea131e78186bb9b5e69ef7257047 Mon Sep 17 00:00:00 2001 From: Dave Protasowski Date: Tue, 4 Feb 2025 23:03:46 -0500 Subject: [PATCH 5/9] annotate EnvoyGateway Signed-off-by: Dave Protasowski --- api/v1alpha1/envoygateway_types.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/v1alpha1/envoygateway_types.go b/api/v1alpha1/envoygateway_types.go index 42d7e5609e4..59091b629d5 100644 --- a/api/v1alpha1/envoygateway_types.go +++ b/api/v1alpha1/envoygateway_types.go @@ -26,7 +26,12 @@ const ( GatewayMetricsHost = "0.0.0.0" ) +// Note: EnvoyGateway is not a CRD, it's a schema for a configuration in a config map. +// Hence there is no Go client for this resource. + // EnvoyGateway is the schema for the envoygateways API. +// +// +kubebuilder:object:root=true type EnvoyGateway struct { metav1.TypeMeta `json:",inline"` From 0c62f3da902d2dbbea1f32e2201e8a072497e81a Mon Sep 17 00:00:00 2001 From: Dave Protasowski Date: Wed, 5 Feb 2025 10:32:40 -0500 Subject: [PATCH 6/9] ignore codecov for generated clients Signed-off-by: Dave Protasowski --- .github/codecov.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/codecov.yml b/.github/codecov.yml index 0b409847f63..ec50e27df48 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -15,3 +15,6 @@ ignore: - "test" - "**/*.pb.go" - "**/zz_generated.*.go" + - "pkg/clientset" + - "pkg/informers" + - "pkg/listers" From 54a26d3234891de2e33e6cea61030c1619b17a85 Mon Sep 17 00:00:00 2001 From: Dave Protasowski Date: Wed, 5 Feb 2025 10:33:55 -0500 Subject: [PATCH 7/9] fix license header in register-gen pin.go Signed-off-by: Dave Protasowski --- tools/src/register-gen/pin.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/src/register-gen/pin.go b/tools/src/register-gen/pin.go index 85723bc7bf6..eb6ad839651 100644 --- a/tools/src/register-gen/pin.go +++ b/tools/src/register-gen/pin.go @@ -1,3 +1,8 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + //go:build pin package ignore From a642d999c230357f96e69e2ebe5bc1a8ea086580 Mon Sep 17 00:00:00 2001 From: Dave Protasowski Date: Wed, 5 Feb 2025 13:30:49 -0500 Subject: [PATCH 8/9] move generated code under pkg/client Signed-off-by: Dave Protasowski --- .github/codecov.yml | 4 +--- .../clientset/versioned/clientset.go | 2 +- .../versioned/fake/clientset_generated.go | 6 +++--- pkg/{ => client}/clientset/versioned/fake/doc.go | 0 .../clientset/versioned/fake/register.go | 0 .../clientset/versioned/scheme/doc.go | 0 .../clientset/versioned/scheme/register.go | 0 .../versioned/typed/api/v1alpha1/api_client.go | 2 +- .../versioned/typed/api/v1alpha1/backend.go | 2 +- .../typed/api/v1alpha1/backendtrafficpolicy.go | 2 +- .../typed/api/v1alpha1/clienttrafficpolicy.go | 2 +- .../versioned/typed/api/v1alpha1/doc.go | 0 .../typed/api/v1alpha1/envoyextensionpolicy.go | 2 +- .../typed/api/v1alpha1/envoypatchpolicy.go | 2 +- .../versioned/typed/api/v1alpha1/envoyproxy.go | 2 +- .../versioned/typed/api/v1alpha1/fake/doc.go | 0 .../typed/api/v1alpha1/fake/fake_api_client.go | 2 +- .../typed/api/v1alpha1/fake/fake_backend.go | 2 +- .../v1alpha1/fake/fake_backendtrafficpolicy.go | 2 +- .../v1alpha1/fake/fake_clienttrafficpolicy.go | 2 +- .../v1alpha1/fake/fake_envoyextensionpolicy.go | 2 +- .../api/v1alpha1/fake/fake_envoypatchpolicy.go | 2 +- .../typed/api/v1alpha1/fake/fake_envoyproxy.go | 2 +- .../api/v1alpha1/fake/fake_httproutefilter.go | 2 +- .../api/v1alpha1/fake/fake_securitypolicy.go | 2 +- .../typed/api/v1alpha1/generated_expansion.go | 0 .../typed/api/v1alpha1/httproutefilter.go | 2 +- .../typed/api/v1alpha1/securitypolicy.go | 2 +- .../informers/externalversions/api/interface.go | 4 ++-- .../externalversions/api/v1alpha1/backend.go | 6 +++--- .../api/v1alpha1/backendtrafficpolicy.go | 6 +++--- .../api/v1alpha1/clienttrafficpolicy.go | 6 +++--- .../api/v1alpha1/envoyextensionpolicy.go | 6 +++--- .../api/v1alpha1/envoypatchpolicy.go | 6 +++--- .../externalversions/api/v1alpha1/envoyproxy.go | 6 +++--- .../api/v1alpha1/httproutefilter.go | 6 +++--- .../externalversions/api/v1alpha1/interface.go | 2 +- .../api/v1alpha1/securitypolicy.go | 6 +++--- .../informers/externalversions/factory.go | 6 +++--- .../informers/externalversions/generic.go | 0 .../internalinterfaces/factory_interfaces.go | 2 +- pkg/{ => client}/listers/api/v1alpha1/backend.go | 0 .../listers/api/v1alpha1/backendtrafficpolicy.go | 0 .../listers/api/v1alpha1/clienttrafficpolicy.go | 0 .../listers/api/v1alpha1/envoyextensionpolicy.go | 0 .../listers/api/v1alpha1/envoypatchpolicy.go | 0 .../listers/api/v1alpha1/envoyproxy.go | 0 .../listers/api/v1alpha1/expansion_generated.go | 0 .../listers/api/v1alpha1/httproutefilter.go | 0 .../listers/api/v1alpha1/securitypolicy.go | 0 tools/make/kube.mk | 16 ++++++++-------- 51 files changed, 62 insertions(+), 64 deletions(-) rename pkg/{ => client}/clientset/versioned/clientset.go (97%) rename pkg/{ => client}/clientset/versioned/fake/clientset_generated.go (91%) rename pkg/{ => client}/clientset/versioned/fake/doc.go (100%) rename pkg/{ => client}/clientset/versioned/fake/register.go (100%) rename pkg/{ => client}/clientset/versioned/scheme/doc.go (100%) rename pkg/{ => client}/clientset/versioned/scheme/register.go (100%) rename pkg/{ => client}/clientset/versioned/typed/api/v1alpha1/api_client.go (98%) rename pkg/{ => client}/clientset/versioned/typed/api/v1alpha1/backend.go (96%) rename pkg/{ => client}/clientset/versioned/typed/api/v1alpha1/backendtrafficpolicy.go (97%) rename pkg/{ => client}/clientset/versioned/typed/api/v1alpha1/clienttrafficpolicy.go (97%) rename pkg/{ => client}/clientset/versioned/typed/api/v1alpha1/doc.go (100%) rename pkg/{ => client}/clientset/versioned/typed/api/v1alpha1/envoyextensionpolicy.go (97%) rename pkg/{ => client}/clientset/versioned/typed/api/v1alpha1/envoypatchpolicy.go (97%) rename pkg/{ => client}/clientset/versioned/typed/api/v1alpha1/envoyproxy.go (96%) rename pkg/{ => client}/clientset/versioned/typed/api/v1alpha1/fake/doc.go (100%) rename pkg/{ => client}/clientset/versioned/typed/api/v1alpha1/fake/fake_api_client.go (95%) rename pkg/{ => client}/clientset/versioned/typed/api/v1alpha1/fake/fake_backend.go (93%) rename pkg/{ => client}/clientset/versioned/typed/api/v1alpha1/fake/fake_backendtrafficpolicy.go (94%) rename pkg/{ => client}/clientset/versioned/typed/api/v1alpha1/fake/fake_clienttrafficpolicy.go (94%) rename pkg/{ => client}/clientset/versioned/typed/api/v1alpha1/fake/fake_envoyextensionpolicy.go (94%) rename pkg/{ => client}/clientset/versioned/typed/api/v1alpha1/fake/fake_envoypatchpolicy.go (94%) rename pkg/{ => client}/clientset/versioned/typed/api/v1alpha1/fake/fake_envoyproxy.go (93%) rename pkg/{ => client}/clientset/versioned/typed/api/v1alpha1/fake/fake_httproutefilter.go (93%) rename pkg/{ => client}/clientset/versioned/typed/api/v1alpha1/fake/fake_securitypolicy.go (93%) rename pkg/{ => client}/clientset/versioned/typed/api/v1alpha1/generated_expansion.go (100%) rename pkg/{ => client}/clientset/versioned/typed/api/v1alpha1/httproutefilter.go (96%) rename pkg/{ => client}/clientset/versioned/typed/api/v1alpha1/securitypolicy.go (97%) rename pkg/{ => client}/informers/externalversions/api/interface.go (83%) rename pkg/{ => client}/informers/externalversions/api/v1alpha1/backend.go (92%) rename pkg/{ => client}/informers/externalversions/api/v1alpha1/backendtrafficpolicy.go (92%) rename pkg/{ => client}/informers/externalversions/api/v1alpha1/clienttrafficpolicy.go (92%) rename pkg/{ => client}/informers/externalversions/api/v1alpha1/envoyextensionpolicy.go (92%) rename pkg/{ => client}/informers/externalversions/api/v1alpha1/envoypatchpolicy.go (92%) rename pkg/{ => client}/informers/externalversions/api/v1alpha1/envoyproxy.go (92%) rename pkg/{ => client}/informers/externalversions/api/v1alpha1/httproutefilter.go (92%) rename pkg/{ => client}/informers/externalversions/api/v1alpha1/interface.go (96%) rename pkg/{ => client}/informers/externalversions/api/v1alpha1/securitypolicy.go (92%) rename pkg/{ => client}/informers/externalversions/factory.go (97%) rename pkg/{ => client}/informers/externalversions/generic.go (100%) rename pkg/{ => client}/informers/externalversions/internalinterfaces/factory_interfaces.go (92%) rename pkg/{ => client}/listers/api/v1alpha1/backend.go (100%) rename pkg/{ => client}/listers/api/v1alpha1/backendtrafficpolicy.go (100%) rename pkg/{ => client}/listers/api/v1alpha1/clienttrafficpolicy.go (100%) rename pkg/{ => client}/listers/api/v1alpha1/envoyextensionpolicy.go (100%) rename pkg/{ => client}/listers/api/v1alpha1/envoypatchpolicy.go (100%) rename pkg/{ => client}/listers/api/v1alpha1/envoyproxy.go (100%) rename pkg/{ => client}/listers/api/v1alpha1/expansion_generated.go (100%) rename pkg/{ => client}/listers/api/v1alpha1/httproutefilter.go (100%) rename pkg/{ => client}/listers/api/v1alpha1/securitypolicy.go (100%) diff --git a/.github/codecov.yml b/.github/codecov.yml index ec50e27df48..2fd4df50a42 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -15,6 +15,4 @@ ignore: - "test" - "**/*.pb.go" - "**/zz_generated.*.go" - - "pkg/clientset" - - "pkg/informers" - - "pkg/listers" + - "pkg/client" diff --git a/pkg/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go similarity index 97% rename from pkg/clientset/versioned/clientset.go rename to pkg/client/clientset/versioned/clientset.go index e2fb8cc3a36..80a0ec795fd 100644 --- a/pkg/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -11,7 +11,7 @@ import ( fmt "fmt" http "net/http" - envoygatewayv1alpha1 "github.com/envoyproxy/gateway/pkg/clientset/versioned/typed/api/v1alpha1" + envoygatewayv1alpha1 "github.com/envoyproxy/gateway/pkg/client/clientset/versioned/typed/api/v1alpha1" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" diff --git a/pkg/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go similarity index 91% rename from pkg/clientset/versioned/fake/clientset_generated.go rename to pkg/client/clientset/versioned/fake/clientset_generated.go index 2ef2c5d1634..99008706ef9 100644 --- a/pkg/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -8,9 +8,9 @@ package fake import ( - clientset "github.com/envoyproxy/gateway/pkg/clientset/versioned" - envoygatewayv1alpha1 "github.com/envoyproxy/gateway/pkg/clientset/versioned/typed/api/v1alpha1" - fakeenvoygatewayv1alpha1 "github.com/envoyproxy/gateway/pkg/clientset/versioned/typed/api/v1alpha1/fake" + clientset "github.com/envoyproxy/gateway/pkg/client/clientset/versioned" + envoygatewayv1alpha1 "github.com/envoyproxy/gateway/pkg/client/clientset/versioned/typed/api/v1alpha1" + fakeenvoygatewayv1alpha1 "github.com/envoyproxy/gateway/pkg/client/clientset/versioned/typed/api/v1alpha1/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" diff --git a/pkg/clientset/versioned/fake/doc.go b/pkg/client/clientset/versioned/fake/doc.go similarity index 100% rename from pkg/clientset/versioned/fake/doc.go rename to pkg/client/clientset/versioned/fake/doc.go diff --git a/pkg/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go similarity index 100% rename from pkg/clientset/versioned/fake/register.go rename to pkg/client/clientset/versioned/fake/register.go diff --git a/pkg/clientset/versioned/scheme/doc.go b/pkg/client/clientset/versioned/scheme/doc.go similarity index 100% rename from pkg/clientset/versioned/scheme/doc.go rename to pkg/client/clientset/versioned/scheme/doc.go diff --git a/pkg/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go similarity index 100% rename from pkg/clientset/versioned/scheme/register.go rename to pkg/client/clientset/versioned/scheme/register.go diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/api_client.go b/pkg/client/clientset/versioned/typed/api/v1alpha1/api_client.go similarity index 98% rename from pkg/clientset/versioned/typed/api/v1alpha1/api_client.go rename to pkg/client/clientset/versioned/typed/api/v1alpha1/api_client.go index 7a891470014..7852aae5937 100644 --- a/pkg/clientset/versioned/typed/api/v1alpha1/api_client.go +++ b/pkg/client/clientset/versioned/typed/api/v1alpha1/api_client.go @@ -11,7 +11,7 @@ import ( http "net/http" apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - scheme "github.com/envoyproxy/gateway/pkg/clientset/versioned/scheme" + scheme "github.com/envoyproxy/gateway/pkg/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/backend.go b/pkg/client/clientset/versioned/typed/api/v1alpha1/backend.go similarity index 96% rename from pkg/clientset/versioned/typed/api/v1alpha1/backend.go rename to pkg/client/clientset/versioned/typed/api/v1alpha1/backend.go index 6025192d444..5c605a735be 100644 --- a/pkg/clientset/versioned/typed/api/v1alpha1/backend.go +++ b/pkg/client/clientset/versioned/typed/api/v1alpha1/backend.go @@ -11,7 +11,7 @@ import ( context "context" apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - scheme "github.com/envoyproxy/gateway/pkg/clientset/versioned/scheme" + scheme "github.com/envoyproxy/gateway/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/backendtrafficpolicy.go b/pkg/client/clientset/versioned/typed/api/v1alpha1/backendtrafficpolicy.go similarity index 97% rename from pkg/clientset/versioned/typed/api/v1alpha1/backendtrafficpolicy.go rename to pkg/client/clientset/versioned/typed/api/v1alpha1/backendtrafficpolicy.go index 90b30ee64b6..9c154fe55a5 100644 --- a/pkg/clientset/versioned/typed/api/v1alpha1/backendtrafficpolicy.go +++ b/pkg/client/clientset/versioned/typed/api/v1alpha1/backendtrafficpolicy.go @@ -11,7 +11,7 @@ import ( context "context" apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - scheme "github.com/envoyproxy/gateway/pkg/clientset/versioned/scheme" + scheme "github.com/envoyproxy/gateway/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/clienttrafficpolicy.go b/pkg/client/clientset/versioned/typed/api/v1alpha1/clienttrafficpolicy.go similarity index 97% rename from pkg/clientset/versioned/typed/api/v1alpha1/clienttrafficpolicy.go rename to pkg/client/clientset/versioned/typed/api/v1alpha1/clienttrafficpolicy.go index 9d713048b20..3b9fad9c2c4 100644 --- a/pkg/clientset/versioned/typed/api/v1alpha1/clienttrafficpolicy.go +++ b/pkg/client/clientset/versioned/typed/api/v1alpha1/clienttrafficpolicy.go @@ -11,7 +11,7 @@ import ( context "context" apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - scheme "github.com/envoyproxy/gateway/pkg/clientset/versioned/scheme" + scheme "github.com/envoyproxy/gateway/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/doc.go b/pkg/client/clientset/versioned/typed/api/v1alpha1/doc.go similarity index 100% rename from pkg/clientset/versioned/typed/api/v1alpha1/doc.go rename to pkg/client/clientset/versioned/typed/api/v1alpha1/doc.go diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/envoyextensionpolicy.go b/pkg/client/clientset/versioned/typed/api/v1alpha1/envoyextensionpolicy.go similarity index 97% rename from pkg/clientset/versioned/typed/api/v1alpha1/envoyextensionpolicy.go rename to pkg/client/clientset/versioned/typed/api/v1alpha1/envoyextensionpolicy.go index e3f97545354..afe3fb1228d 100644 --- a/pkg/clientset/versioned/typed/api/v1alpha1/envoyextensionpolicy.go +++ b/pkg/client/clientset/versioned/typed/api/v1alpha1/envoyextensionpolicy.go @@ -11,7 +11,7 @@ import ( context "context" apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - scheme "github.com/envoyproxy/gateway/pkg/clientset/versioned/scheme" + scheme "github.com/envoyproxy/gateway/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/envoypatchpolicy.go b/pkg/client/clientset/versioned/typed/api/v1alpha1/envoypatchpolicy.go similarity index 97% rename from pkg/clientset/versioned/typed/api/v1alpha1/envoypatchpolicy.go rename to pkg/client/clientset/versioned/typed/api/v1alpha1/envoypatchpolicy.go index c910c75922a..a172bc00107 100644 --- a/pkg/clientset/versioned/typed/api/v1alpha1/envoypatchpolicy.go +++ b/pkg/client/clientset/versioned/typed/api/v1alpha1/envoypatchpolicy.go @@ -11,7 +11,7 @@ import ( context "context" apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - scheme "github.com/envoyproxy/gateway/pkg/clientset/versioned/scheme" + scheme "github.com/envoyproxy/gateway/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/envoyproxy.go b/pkg/client/clientset/versioned/typed/api/v1alpha1/envoyproxy.go similarity index 96% rename from pkg/clientset/versioned/typed/api/v1alpha1/envoyproxy.go rename to pkg/client/clientset/versioned/typed/api/v1alpha1/envoyproxy.go index af683f224f1..51d8d66640c 100644 --- a/pkg/clientset/versioned/typed/api/v1alpha1/envoyproxy.go +++ b/pkg/client/clientset/versioned/typed/api/v1alpha1/envoyproxy.go @@ -11,7 +11,7 @@ import ( context "context" apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - scheme "github.com/envoyproxy/gateway/pkg/clientset/versioned/scheme" + scheme "github.com/envoyproxy/gateway/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/fake/doc.go b/pkg/client/clientset/versioned/typed/api/v1alpha1/fake/doc.go similarity index 100% rename from pkg/clientset/versioned/typed/api/v1alpha1/fake/doc.go rename to pkg/client/clientset/versioned/typed/api/v1alpha1/fake/doc.go diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_api_client.go b/pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_api_client.go similarity index 95% rename from pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_api_client.go rename to pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_api_client.go index 997373e3f75..ff945aae662 100644 --- a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_api_client.go +++ b/pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_api_client.go @@ -8,7 +8,7 @@ package fake import ( - v1alpha1 "github.com/envoyproxy/gateway/pkg/clientset/versioned/typed/api/v1alpha1" + v1alpha1 "github.com/envoyproxy/gateway/pkg/client/clientset/versioned/typed/api/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_backend.go b/pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_backend.go similarity index 93% rename from pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_backend.go rename to pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_backend.go index 5bf7179f1cd..b629a17ec6f 100644 --- a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_backend.go +++ b/pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_backend.go @@ -9,7 +9,7 @@ package fake import ( v1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - apiv1alpha1 "github.com/envoyproxy/gateway/pkg/clientset/versioned/typed/api/v1alpha1" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/client/clientset/versioned/typed/api/v1alpha1" gentype "k8s.io/client-go/gentype" ) diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_backendtrafficpolicy.go b/pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_backendtrafficpolicy.go similarity index 94% rename from pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_backendtrafficpolicy.go rename to pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_backendtrafficpolicy.go index f320e5b4f98..7c1a330950e 100644 --- a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_backendtrafficpolicy.go +++ b/pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_backendtrafficpolicy.go @@ -9,7 +9,7 @@ package fake import ( v1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - apiv1alpha1 "github.com/envoyproxy/gateway/pkg/clientset/versioned/typed/api/v1alpha1" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/client/clientset/versioned/typed/api/v1alpha1" gentype "k8s.io/client-go/gentype" ) diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_clienttrafficpolicy.go b/pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_clienttrafficpolicy.go similarity index 94% rename from pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_clienttrafficpolicy.go rename to pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_clienttrafficpolicy.go index 86af01f3dac..847cb5242ca 100644 --- a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_clienttrafficpolicy.go +++ b/pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_clienttrafficpolicy.go @@ -9,7 +9,7 @@ package fake import ( v1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - apiv1alpha1 "github.com/envoyproxy/gateway/pkg/clientset/versioned/typed/api/v1alpha1" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/client/clientset/versioned/typed/api/v1alpha1" gentype "k8s.io/client-go/gentype" ) diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_envoyextensionpolicy.go b/pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_envoyextensionpolicy.go similarity index 94% rename from pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_envoyextensionpolicy.go rename to pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_envoyextensionpolicy.go index eb82558c123..1685b8f596f 100644 --- a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_envoyextensionpolicy.go +++ b/pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_envoyextensionpolicy.go @@ -9,7 +9,7 @@ package fake import ( v1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - apiv1alpha1 "github.com/envoyproxy/gateway/pkg/clientset/versioned/typed/api/v1alpha1" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/client/clientset/versioned/typed/api/v1alpha1" gentype "k8s.io/client-go/gentype" ) diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_envoypatchpolicy.go b/pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_envoypatchpolicy.go similarity index 94% rename from pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_envoypatchpolicy.go rename to pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_envoypatchpolicy.go index 51310126b6a..af8a1790ba3 100644 --- a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_envoypatchpolicy.go +++ b/pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_envoypatchpolicy.go @@ -9,7 +9,7 @@ package fake import ( v1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - apiv1alpha1 "github.com/envoyproxy/gateway/pkg/clientset/versioned/typed/api/v1alpha1" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/client/clientset/versioned/typed/api/v1alpha1" gentype "k8s.io/client-go/gentype" ) diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_envoyproxy.go b/pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_envoyproxy.go similarity index 93% rename from pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_envoyproxy.go rename to pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_envoyproxy.go index fa0227d2116..b550d852dcd 100644 --- a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_envoyproxy.go +++ b/pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_envoyproxy.go @@ -9,7 +9,7 @@ package fake import ( v1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - apiv1alpha1 "github.com/envoyproxy/gateway/pkg/clientset/versioned/typed/api/v1alpha1" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/client/clientset/versioned/typed/api/v1alpha1" gentype "k8s.io/client-go/gentype" ) diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_httproutefilter.go b/pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_httproutefilter.go similarity index 93% rename from pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_httproutefilter.go rename to pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_httproutefilter.go index 345381173bb..038f9f67575 100644 --- a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_httproutefilter.go +++ b/pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_httproutefilter.go @@ -9,7 +9,7 @@ package fake import ( v1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - apiv1alpha1 "github.com/envoyproxy/gateway/pkg/clientset/versioned/typed/api/v1alpha1" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/client/clientset/versioned/typed/api/v1alpha1" gentype "k8s.io/client-go/gentype" ) diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_securitypolicy.go b/pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_securitypolicy.go similarity index 93% rename from pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_securitypolicy.go rename to pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_securitypolicy.go index 3944495546f..9217585424d 100644 --- a/pkg/clientset/versioned/typed/api/v1alpha1/fake/fake_securitypolicy.go +++ b/pkg/client/clientset/versioned/typed/api/v1alpha1/fake/fake_securitypolicy.go @@ -9,7 +9,7 @@ package fake import ( v1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - apiv1alpha1 "github.com/envoyproxy/gateway/pkg/clientset/versioned/typed/api/v1alpha1" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/client/clientset/versioned/typed/api/v1alpha1" gentype "k8s.io/client-go/gentype" ) diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/generated_expansion.go b/pkg/client/clientset/versioned/typed/api/v1alpha1/generated_expansion.go similarity index 100% rename from pkg/clientset/versioned/typed/api/v1alpha1/generated_expansion.go rename to pkg/client/clientset/versioned/typed/api/v1alpha1/generated_expansion.go diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/httproutefilter.go b/pkg/client/clientset/versioned/typed/api/v1alpha1/httproutefilter.go similarity index 96% rename from pkg/clientset/versioned/typed/api/v1alpha1/httproutefilter.go rename to pkg/client/clientset/versioned/typed/api/v1alpha1/httproutefilter.go index 07a25525410..6726ca99cc1 100644 --- a/pkg/clientset/versioned/typed/api/v1alpha1/httproutefilter.go +++ b/pkg/client/clientset/versioned/typed/api/v1alpha1/httproutefilter.go @@ -11,7 +11,7 @@ import ( context "context" apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - scheme "github.com/envoyproxy/gateway/pkg/clientset/versioned/scheme" + scheme "github.com/envoyproxy/gateway/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/clientset/versioned/typed/api/v1alpha1/securitypolicy.go b/pkg/client/clientset/versioned/typed/api/v1alpha1/securitypolicy.go similarity index 97% rename from pkg/clientset/versioned/typed/api/v1alpha1/securitypolicy.go rename to pkg/client/clientset/versioned/typed/api/v1alpha1/securitypolicy.go index fee6b7b6ea4..b1c15300710 100644 --- a/pkg/clientset/versioned/typed/api/v1alpha1/securitypolicy.go +++ b/pkg/client/clientset/versioned/typed/api/v1alpha1/securitypolicy.go @@ -11,7 +11,7 @@ import ( context "context" apiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - scheme "github.com/envoyproxy/gateway/pkg/clientset/versioned/scheme" + scheme "github.com/envoyproxy/gateway/pkg/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/informers/externalversions/api/interface.go b/pkg/client/informers/externalversions/api/interface.go similarity index 83% rename from pkg/informers/externalversions/api/interface.go rename to pkg/client/informers/externalversions/api/interface.go index d2964be889c..eb87f5a5be9 100644 --- a/pkg/informers/externalversions/api/interface.go +++ b/pkg/client/informers/externalversions/api/interface.go @@ -8,8 +8,8 @@ package api import ( - v1alpha1 "github.com/envoyproxy/gateway/pkg/informers/externalversions/api/v1alpha1" - internalinterfaces "github.com/envoyproxy/gateway/pkg/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/envoyproxy/gateway/pkg/client/informers/externalversions/api/v1alpha1" + internalinterfaces "github.com/envoyproxy/gateway/pkg/client/informers/externalversions/internalinterfaces" ) // Interface provides access to each of this group's versions. diff --git a/pkg/informers/externalversions/api/v1alpha1/backend.go b/pkg/client/informers/externalversions/api/v1alpha1/backend.go similarity index 92% rename from pkg/informers/externalversions/api/v1alpha1/backend.go rename to pkg/client/informers/externalversions/api/v1alpha1/backend.go index 8041d74b4c5..4fff9da7492 100644 --- a/pkg/informers/externalversions/api/v1alpha1/backend.go +++ b/pkg/client/informers/externalversions/api/v1alpha1/backend.go @@ -12,9 +12,9 @@ import ( time "time" gatewayapiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - versioned "github.com/envoyproxy/gateway/pkg/clientset/versioned" - internalinterfaces "github.com/envoyproxy/gateway/pkg/informers/externalversions/internalinterfaces" - apiv1alpha1 "github.com/envoyproxy/gateway/pkg/listers/api/v1alpha1" + versioned "github.com/envoyproxy/gateway/pkg/client/clientset/versioned" + internalinterfaces "github.com/envoyproxy/gateway/pkg/client/informers/externalversions/internalinterfaces" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/client/listers/api/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/informers/externalversions/api/v1alpha1/backendtrafficpolicy.go b/pkg/client/informers/externalversions/api/v1alpha1/backendtrafficpolicy.go similarity index 92% rename from pkg/informers/externalversions/api/v1alpha1/backendtrafficpolicy.go rename to pkg/client/informers/externalversions/api/v1alpha1/backendtrafficpolicy.go index c170a6ee404..c115664fa27 100644 --- a/pkg/informers/externalversions/api/v1alpha1/backendtrafficpolicy.go +++ b/pkg/client/informers/externalversions/api/v1alpha1/backendtrafficpolicy.go @@ -12,9 +12,9 @@ import ( time "time" gatewayapiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - versioned "github.com/envoyproxy/gateway/pkg/clientset/versioned" - internalinterfaces "github.com/envoyproxy/gateway/pkg/informers/externalversions/internalinterfaces" - apiv1alpha1 "github.com/envoyproxy/gateway/pkg/listers/api/v1alpha1" + versioned "github.com/envoyproxy/gateway/pkg/client/clientset/versioned" + internalinterfaces "github.com/envoyproxy/gateway/pkg/client/informers/externalversions/internalinterfaces" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/client/listers/api/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/informers/externalversions/api/v1alpha1/clienttrafficpolicy.go b/pkg/client/informers/externalversions/api/v1alpha1/clienttrafficpolicy.go similarity index 92% rename from pkg/informers/externalversions/api/v1alpha1/clienttrafficpolicy.go rename to pkg/client/informers/externalversions/api/v1alpha1/clienttrafficpolicy.go index 34657c52dcf..3a80b69dd8f 100644 --- a/pkg/informers/externalversions/api/v1alpha1/clienttrafficpolicy.go +++ b/pkg/client/informers/externalversions/api/v1alpha1/clienttrafficpolicy.go @@ -12,9 +12,9 @@ import ( time "time" gatewayapiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - versioned "github.com/envoyproxy/gateway/pkg/clientset/versioned" - internalinterfaces "github.com/envoyproxy/gateway/pkg/informers/externalversions/internalinterfaces" - apiv1alpha1 "github.com/envoyproxy/gateway/pkg/listers/api/v1alpha1" + versioned "github.com/envoyproxy/gateway/pkg/client/clientset/versioned" + internalinterfaces "github.com/envoyproxy/gateway/pkg/client/informers/externalversions/internalinterfaces" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/client/listers/api/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/informers/externalversions/api/v1alpha1/envoyextensionpolicy.go b/pkg/client/informers/externalversions/api/v1alpha1/envoyextensionpolicy.go similarity index 92% rename from pkg/informers/externalversions/api/v1alpha1/envoyextensionpolicy.go rename to pkg/client/informers/externalversions/api/v1alpha1/envoyextensionpolicy.go index 88877398a99..f066d85a3e8 100644 --- a/pkg/informers/externalversions/api/v1alpha1/envoyextensionpolicy.go +++ b/pkg/client/informers/externalversions/api/v1alpha1/envoyextensionpolicy.go @@ -12,9 +12,9 @@ import ( time "time" gatewayapiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - versioned "github.com/envoyproxy/gateway/pkg/clientset/versioned" - internalinterfaces "github.com/envoyproxy/gateway/pkg/informers/externalversions/internalinterfaces" - apiv1alpha1 "github.com/envoyproxy/gateway/pkg/listers/api/v1alpha1" + versioned "github.com/envoyproxy/gateway/pkg/client/clientset/versioned" + internalinterfaces "github.com/envoyproxy/gateway/pkg/client/informers/externalversions/internalinterfaces" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/client/listers/api/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/informers/externalversions/api/v1alpha1/envoypatchpolicy.go b/pkg/client/informers/externalversions/api/v1alpha1/envoypatchpolicy.go similarity index 92% rename from pkg/informers/externalversions/api/v1alpha1/envoypatchpolicy.go rename to pkg/client/informers/externalversions/api/v1alpha1/envoypatchpolicy.go index 07ebbf7a92d..56378293d29 100644 --- a/pkg/informers/externalversions/api/v1alpha1/envoypatchpolicy.go +++ b/pkg/client/informers/externalversions/api/v1alpha1/envoypatchpolicy.go @@ -12,9 +12,9 @@ import ( time "time" gatewayapiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - versioned "github.com/envoyproxy/gateway/pkg/clientset/versioned" - internalinterfaces "github.com/envoyproxy/gateway/pkg/informers/externalversions/internalinterfaces" - apiv1alpha1 "github.com/envoyproxy/gateway/pkg/listers/api/v1alpha1" + versioned "github.com/envoyproxy/gateway/pkg/client/clientset/versioned" + internalinterfaces "github.com/envoyproxy/gateway/pkg/client/informers/externalversions/internalinterfaces" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/client/listers/api/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/informers/externalversions/api/v1alpha1/envoyproxy.go b/pkg/client/informers/externalversions/api/v1alpha1/envoyproxy.go similarity index 92% rename from pkg/informers/externalversions/api/v1alpha1/envoyproxy.go rename to pkg/client/informers/externalversions/api/v1alpha1/envoyproxy.go index 3208169318a..afa1671481e 100644 --- a/pkg/informers/externalversions/api/v1alpha1/envoyproxy.go +++ b/pkg/client/informers/externalversions/api/v1alpha1/envoyproxy.go @@ -12,9 +12,9 @@ import ( time "time" gatewayapiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - versioned "github.com/envoyproxy/gateway/pkg/clientset/versioned" - internalinterfaces "github.com/envoyproxy/gateway/pkg/informers/externalversions/internalinterfaces" - apiv1alpha1 "github.com/envoyproxy/gateway/pkg/listers/api/v1alpha1" + versioned "github.com/envoyproxy/gateway/pkg/client/clientset/versioned" + internalinterfaces "github.com/envoyproxy/gateway/pkg/client/informers/externalversions/internalinterfaces" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/client/listers/api/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/informers/externalversions/api/v1alpha1/httproutefilter.go b/pkg/client/informers/externalversions/api/v1alpha1/httproutefilter.go similarity index 92% rename from pkg/informers/externalversions/api/v1alpha1/httproutefilter.go rename to pkg/client/informers/externalversions/api/v1alpha1/httproutefilter.go index f5b6bfb50be..ede4526e1ec 100644 --- a/pkg/informers/externalversions/api/v1alpha1/httproutefilter.go +++ b/pkg/client/informers/externalversions/api/v1alpha1/httproutefilter.go @@ -12,9 +12,9 @@ import ( time "time" gatewayapiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - versioned "github.com/envoyproxy/gateway/pkg/clientset/versioned" - internalinterfaces "github.com/envoyproxy/gateway/pkg/informers/externalversions/internalinterfaces" - apiv1alpha1 "github.com/envoyproxy/gateway/pkg/listers/api/v1alpha1" + versioned "github.com/envoyproxy/gateway/pkg/client/clientset/versioned" + internalinterfaces "github.com/envoyproxy/gateway/pkg/client/informers/externalversions/internalinterfaces" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/client/listers/api/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/informers/externalversions/api/v1alpha1/interface.go b/pkg/client/informers/externalversions/api/v1alpha1/interface.go similarity index 96% rename from pkg/informers/externalversions/api/v1alpha1/interface.go rename to pkg/client/informers/externalversions/api/v1alpha1/interface.go index 7a5150534d6..2ca0d3175aa 100644 --- a/pkg/informers/externalversions/api/v1alpha1/interface.go +++ b/pkg/client/informers/externalversions/api/v1alpha1/interface.go @@ -8,7 +8,7 @@ package v1alpha1 import ( - internalinterfaces "github.com/envoyproxy/gateway/pkg/informers/externalversions/internalinterfaces" + internalinterfaces "github.com/envoyproxy/gateway/pkg/client/informers/externalversions/internalinterfaces" ) // Interface provides access to all the informers in this group version. diff --git a/pkg/informers/externalversions/api/v1alpha1/securitypolicy.go b/pkg/client/informers/externalversions/api/v1alpha1/securitypolicy.go similarity index 92% rename from pkg/informers/externalversions/api/v1alpha1/securitypolicy.go rename to pkg/client/informers/externalversions/api/v1alpha1/securitypolicy.go index 9a3b5deb991..9e0f13c4697 100644 --- a/pkg/informers/externalversions/api/v1alpha1/securitypolicy.go +++ b/pkg/client/informers/externalversions/api/v1alpha1/securitypolicy.go @@ -12,9 +12,9 @@ import ( time "time" gatewayapiv1alpha1 "github.com/envoyproxy/gateway/api/v1alpha1" - versioned "github.com/envoyproxy/gateway/pkg/clientset/versioned" - internalinterfaces "github.com/envoyproxy/gateway/pkg/informers/externalversions/internalinterfaces" - apiv1alpha1 "github.com/envoyproxy/gateway/pkg/listers/api/v1alpha1" + versioned "github.com/envoyproxy/gateway/pkg/client/clientset/versioned" + internalinterfaces "github.com/envoyproxy/gateway/pkg/client/informers/externalversions/internalinterfaces" + apiv1alpha1 "github.com/envoyproxy/gateway/pkg/client/listers/api/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go similarity index 97% rename from pkg/informers/externalversions/factory.go rename to pkg/client/informers/externalversions/factory.go index c0c41bfe4e3..65c415aba8d 100644 --- a/pkg/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -12,9 +12,9 @@ import ( sync "sync" time "time" - versioned "github.com/envoyproxy/gateway/pkg/clientset/versioned" - api "github.com/envoyproxy/gateway/pkg/informers/externalversions/api" - internalinterfaces "github.com/envoyproxy/gateway/pkg/informers/externalversions/internalinterfaces" + versioned "github.com/envoyproxy/gateway/pkg/client/clientset/versioned" + api "github.com/envoyproxy/gateway/pkg/client/informers/externalversions/api" + internalinterfaces "github.com/envoyproxy/gateway/pkg/client/informers/externalversions/internalinterfaces" 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/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go similarity index 100% rename from pkg/informers/externalversions/generic.go rename to pkg/client/informers/externalversions/generic.go diff --git a/pkg/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go similarity index 92% rename from pkg/informers/externalversions/internalinterfaces/factory_interfaces.go rename to pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go index 247fe26fc40..0ade29d1a5c 100644 --- a/pkg/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -10,7 +10,7 @@ package internalinterfaces import ( time "time" - versioned "github.com/envoyproxy/gateway/pkg/clientset/versioned" + versioned "github.com/envoyproxy/gateway/pkg/client/clientset/versioned" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" cache "k8s.io/client-go/tools/cache" diff --git a/pkg/listers/api/v1alpha1/backend.go b/pkg/client/listers/api/v1alpha1/backend.go similarity index 100% rename from pkg/listers/api/v1alpha1/backend.go rename to pkg/client/listers/api/v1alpha1/backend.go diff --git a/pkg/listers/api/v1alpha1/backendtrafficpolicy.go b/pkg/client/listers/api/v1alpha1/backendtrafficpolicy.go similarity index 100% rename from pkg/listers/api/v1alpha1/backendtrafficpolicy.go rename to pkg/client/listers/api/v1alpha1/backendtrafficpolicy.go diff --git a/pkg/listers/api/v1alpha1/clienttrafficpolicy.go b/pkg/client/listers/api/v1alpha1/clienttrafficpolicy.go similarity index 100% rename from pkg/listers/api/v1alpha1/clienttrafficpolicy.go rename to pkg/client/listers/api/v1alpha1/clienttrafficpolicy.go diff --git a/pkg/listers/api/v1alpha1/envoyextensionpolicy.go b/pkg/client/listers/api/v1alpha1/envoyextensionpolicy.go similarity index 100% rename from pkg/listers/api/v1alpha1/envoyextensionpolicy.go rename to pkg/client/listers/api/v1alpha1/envoyextensionpolicy.go diff --git a/pkg/listers/api/v1alpha1/envoypatchpolicy.go b/pkg/client/listers/api/v1alpha1/envoypatchpolicy.go similarity index 100% rename from pkg/listers/api/v1alpha1/envoypatchpolicy.go rename to pkg/client/listers/api/v1alpha1/envoypatchpolicy.go diff --git a/pkg/listers/api/v1alpha1/envoyproxy.go b/pkg/client/listers/api/v1alpha1/envoyproxy.go similarity index 100% rename from pkg/listers/api/v1alpha1/envoyproxy.go rename to pkg/client/listers/api/v1alpha1/envoyproxy.go diff --git a/pkg/listers/api/v1alpha1/expansion_generated.go b/pkg/client/listers/api/v1alpha1/expansion_generated.go similarity index 100% rename from pkg/listers/api/v1alpha1/expansion_generated.go rename to pkg/client/listers/api/v1alpha1/expansion_generated.go diff --git a/pkg/listers/api/v1alpha1/httproutefilter.go b/pkg/client/listers/api/v1alpha1/httproutefilter.go similarity index 100% rename from pkg/listers/api/v1alpha1/httproutefilter.go rename to pkg/client/listers/api/v1alpha1/httproutefilter.go diff --git a/pkg/listers/api/v1alpha1/securitypolicy.go b/pkg/client/listers/api/v1alpha1/securitypolicy.go similarity index 100% rename from pkg/listers/api/v1alpha1/securitypolicy.go rename to pkg/client/listers/api/v1alpha1/securitypolicy.go diff --git a/tools/make/kube.mk b/tools/make/kube.mk index 7e34d069515..5c2eedbb9b6 100644 --- a/tools/make/kube.mk +++ b/tools/make/kube.mk @@ -103,8 +103,8 @@ kube-generate-client: $(tools/client-gen) kube-generate-register-gen ## Generate --clientset-name versioned \ --input-base ${ROOT_PACKAGE} \ --input "api/v1alpha1" \ - --output-dir $(ROOT_DIR)/pkg/clientset \ - --output-pkg ${ROOT_PACKAGE}/pkg/clientset \ + --output-dir $(ROOT_DIR)/pkg/client/clientset \ + --output-pkg ${ROOT_PACKAGE}/pkg/client/clientset \ --go-header-file ${ROOT_DIR}/tools/boilerplate/boilerplate.go.txt @@ -112,8 +112,8 @@ kube-generate-client: $(tools/client-gen) kube-generate-register-gen ## Generate kube-generate-listers: $(tools/lister-gen) kube-generate-client ## Generate lister code for the API group. @$(LOG_TARGET) $(tools/lister-gen) \ - --output-dir $(ROOT_DIR)/pkg/listers \ - --output-pkg ${ROOT_PACKAGE}/pkg/listers \ + --output-dir $(ROOT_DIR)/pkg/client/listers \ + --output-pkg ${ROOT_PACKAGE}/pkg/client/listers \ --go-header-file ${ROOT_DIR}/tools/boilerplate/boilerplate.go.txt \ ${ROOT_PACKAGE}/api/v1alpha1 @@ -121,10 +121,10 @@ kube-generate-listers: $(tools/lister-gen) kube-generate-client ## Generate list kube-generate-informers: $(tools/informer-gen) kube-generate-listers ## Generate informer code for the API group. @$(LOG_TARGET) $(tools/informer-gen) \ - --versioned-clientset-package ${ROOT_PACKAGE}/pkg/clientset/versioned \ - --listers-package ${ROOT_PACKAGE}/pkg/listers \ - --output-dir $(ROOT_DIR)/pkg/informers \ - --output-pkg ${ROOT_PACKAGE}/pkg/informers \ + --versioned-clientset-package ${ROOT_PACKAGE}/pkg/client/clientset/versioned \ + --listers-package ${ROOT_PACKAGE}/pkg/client/listers \ + --output-dir $(ROOT_DIR)/pkg/client/informers \ + --output-pkg ${ROOT_PACKAGE}/pkg/client/informers \ --go-header-file ${ROOT_DIR}/tools/boilerplate/boilerplate.go.txt \ ${ROOT_PACKAGE}/api/v1alpha1 From 9a4e5cad274634b58e6deab2be2cf4ccbda19803 Mon Sep 17 00:00:00 2001 From: Dave Protasowski Date: Wed, 5 Feb 2025 13:32:48 -0500 Subject: [PATCH 9/9] preserve kube-generate-deep-copy comment Signed-off-by: Dave Protasowski --- tools/make/kube.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/make/kube.mk b/tools/make/kube.mk index 5c2eedbb9b6..a5a683ca60d 100644 --- a/tools/make/kube.mk +++ b/tools/make/kube.mk @@ -76,10 +76,9 @@ generate-gwapi-manifests: ## Generate GWAPI manifests and make it consistent wit .PHONY: kube-generate kube-generate: kube-generate-informers -## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. # Note that the paths can't just be "./..." with the header file, or the tool will panic on run. Sorry. .PHONY: kube-generate-deep-copy -kube-generate-deep-copy: $(tools/controller-gen) +kube-generate-deep-copy: $(tools/controller-gen) ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations. @$(LOG_TARGET) $(tools/controller-gen) $(CONTROLLERGEN_OBJECT_FLAGS) paths="{$(ROOT_DIR)/api/...,$(ROOT_DIR)/internal/ir/...,$(ROOT_DIR)/internal/gatewayapi/...}"