From e2ddc3daef19d096aa2fe8ebd767f3dbb511015f Mon Sep 17 00:00:00 2001 From: Damian Sawicki Date: Tue, 8 Jul 2025 11:43:41 +0000 Subject: [PATCH] Bump controller-tools and its dependencies Steps: 1. Bump sigs.k8s.io/controller-tools to v0.18.0 2. go mod tidy 3. make 4. Manual changes to pkg/client/clientset/versioned/typed/networking/v1/fake/fake_gcpgatewaypolicy.go because GCPGatewayPolicyList has a list of **pointers** in the Items field (as opposed to GCPTrafficDistributionPolicyList, for instance). --- apis/networking/v1/zz_generated.deepcopy.go | 231 ++++++++++++++++++ apis/networking/v1/zz_generated.register.go | 12 +- .../networking.gke.io_gcpbackendpolicies.yaml | 69 +----- .../networking.gke.io_gcpgatewaypolicies.yaml | 21 +- ...king.gke.io_gcpsessionaffinityfilters.yaml | 21 +- ...ing.gke.io_gcpsessionaffinitypolicies.yaml | 21 +- ...gke.io_gcptrafficdistributionpolicies.yaml | 55 +---- ...networking.gke.io_healthcheckpolicies.yaml | 31 +-- go.mod | 72 +++--- go.sum | 166 ++++++------- pkg/client/clientset/versioned/clientset.go | 4 +- .../versioned/fake/clientset_generated.go | 13 +- .../v1/fake/fake_gcpbackendpolicy.go | 133 ++-------- .../v1/fake/fake_gcpgatewaypolicy.go | 133 ++-------- .../v1/fake/fake_gcpsessionaffinityfilter.go | 135 ++-------- .../v1/fake/fake_gcpsessionaffinitypolicy.go | 135 ++-------- .../v1/fake/fake_healthcheckpolicy.go | 135 ++-------- .../v1/fake/fake_networking_client.go | 14 +- .../typed/networking/v1/gcpbackendpolicy.go | 163 ++---------- .../typed/networking/v1/gcpgatewaypolicy.go | 163 ++---------- .../networking/v1/gcpsessionaffinityfilter.go | 163 ++---------- .../networking/v1/gcpsessionaffinitypolicy.go | 163 ++---------- .../networking/v1/generated_expansion.go | 2 + .../typed/networking/v1/healthcheckpolicy.go | 163 ++---------- .../typed/networking/v1/networking_client.go | 27 +- .../informers/externalversions/factory.go | 1 + .../informers/externalversions/generic.go | 4 +- .../networking/v1/gcpbackendpolicy.go | 32 ++- .../networking/v1/gcpgatewaypolicy.go | 32 ++- .../networking/v1/gcpsessionaffinityfilter.go | 32 ++- .../networking/v1/gcpsessionaffinitypolicy.go | 32 ++- .../networking/v1/healthcheckpolicy.go | 32 ++- .../networking/v1/interface.go | 7 + .../networking/v1/expansion_generated.go | 8 + .../listers/networking/v1/gcpbackendpolicy.go | 51 +--- .../listers/networking/v1/gcpgatewaypolicy.go | 51 +--- .../networking/v1/gcpsessionaffinityfilter.go | 51 +--- .../networking/v1/gcpsessionaffinitypolicy.go | 51 +--- .../networking/v1/healthcheckpolicy.go | 51 +--- 39 files changed, 811 insertions(+), 1869 deletions(-) diff --git a/apis/networking/v1/zz_generated.deepcopy.go b/apis/networking/v1/zz_generated.deepcopy.go index de851e7..b7aa5c3 100644 --- a/apis/networking/v1/zz_generated.deepcopy.go +++ b/apis/networking/v1/zz_generated.deepcopy.go @@ -25,6 +25,26 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoCapacityDrain) DeepCopyInto(out *AutoCapacityDrain) { + *out = *in + if in.EnableAutoCapacityDrain != nil { + in, out := &in.EnableAutoCapacityDrain, &out.EnableAutoCapacityDrain + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoCapacityDrain. +func (in *AutoCapacityDrain) DeepCopy() *AutoCapacityDrain { + if in == nil { + return nil + } + out := new(AutoCapacityDrain) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CommonHTTPHealthCheck) DeepCopyInto(out *CommonHTTPHealthCheck) { *out = *in @@ -110,6 +130,26 @@ func (in *ConnectionDraining) DeepCopy() *ConnectionDraining { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FailoverConfig) DeepCopyInto(out *FailoverConfig) { + *out = *in + if in.FailoverHealthThreshold != nil { + in, out := &in.FailoverHealthThreshold, &out.FailoverHealthThreshold + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FailoverConfig. +func (in *FailoverConfig) DeepCopy() *FailoverConfig { + if in == nil { + return nil + } + out := new(FailoverConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GCPBackendPolicy) DeepCopyInto(out *GCPBackendPolicy) { *out = *in @@ -175,6 +215,11 @@ func (in *GCPBackendPolicyConfig) DeepCopyInto(out *GCPBackendPolicyConfig) { *out = new(int64) **out = **in } + if in.BackendPreference != nil { + in, out := &in.BackendPreference, &out.BackendPreference + *out = new(string) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPBackendPolicyConfig. @@ -243,6 +288,13 @@ func (in *GCPBackendPolicySpec) DeepCopy() *GCPBackendPolicySpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GCPBackendPolicyStatus) DeepCopyInto(out *GCPBackendPolicyStatus) { *out = *in + if in.Ancestors != nil { + in, out := &in.Ancestors, &out.Ancestors + *out = make([]PolicyAncestorStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions *out = make([]metav1.Condition, len(*in)) @@ -582,6 +634,125 @@ func (in *GCPSessionAffinitySpec) DeepCopy() *GCPSessionAffinitySpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPTrafficDistributionPolicy) DeepCopyInto(out *GCPTrafficDistributionPolicy) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPTrafficDistributionPolicy. +func (in *GCPTrafficDistributionPolicy) DeepCopy() *GCPTrafficDistributionPolicy { + if in == nil { + return nil + } + out := new(GCPTrafficDistributionPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GCPTrafficDistributionPolicy) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPTrafficDistributionPolicyConfig) DeepCopyInto(out *GCPTrafficDistributionPolicyConfig) { + *out = *in + if in.ServiceLbAlgorithm != nil { + in, out := &in.ServiceLbAlgorithm, &out.ServiceLbAlgorithm + *out = new(string) + **out = **in + } + if in.LocalityLbAlgorithm != nil { + in, out := &in.LocalityLbAlgorithm, &out.LocalityLbAlgorithm + *out = new(string) + **out = **in + } + if in.AutoCapacityDrain != nil { + in, out := &in.AutoCapacityDrain, &out.AutoCapacityDrain + *out = new(AutoCapacityDrain) + (*in).DeepCopyInto(*out) + } + if in.FailoverConfig != nil { + in, out := &in.FailoverConfig, &out.FailoverConfig + *out = new(FailoverConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPTrafficDistributionPolicyConfig. +func (in *GCPTrafficDistributionPolicyConfig) DeepCopy() *GCPTrafficDistributionPolicyConfig { + if in == nil { + return nil + } + out := new(GCPTrafficDistributionPolicyConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPTrafficDistributionPolicyList) DeepCopyInto(out *GCPTrafficDistributionPolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GCPTrafficDistributionPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPTrafficDistributionPolicyList. +func (in *GCPTrafficDistributionPolicyList) DeepCopy() *GCPTrafficDistributionPolicyList { + if in == nil { + return nil + } + out := new(GCPTrafficDistributionPolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GCPTrafficDistributionPolicyList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GCPTrafficDistributionPolicySpec) DeepCopyInto(out *GCPTrafficDistributionPolicySpec) { + *out = *in + if in.TargetRefs != nil { + in, out := &in.TargetRefs, &out.TargetRefs + *out = make([]LocalPolicyTargetReference, len(*in)) + copy(*out, *in) + } + if in.Default != nil { + in, out := &in.Default, &out.Default + *out = new(GCPTrafficDistributionPolicyConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPTrafficDistributionPolicySpec. +func (in *GCPTrafficDistributionPolicySpec) DeepCopy() *GCPTrafficDistributionPolicySpec { + if in == nil { + return nil + } + out := new(GCPTrafficDistributionPolicySpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GRPCHealthCheck) DeepCopyInto(out *GRPCHealthCheck) { *out = *in @@ -871,6 +1042,21 @@ func (in *IdentityAwareProxyConfig) DeepCopy() *IdentityAwareProxyConfig { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalPolicyTargetReference) DeepCopyInto(out *LocalPolicyTargetReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalPolicyTargetReference. +func (in *LocalPolicyTargetReference) DeepCopy() *LocalPolicyTargetReference { + if in == nil { + return nil + } + out := new(LocalPolicyTargetReference) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *LogConfig) DeepCopyInto(out *LogConfig) { *out = *in @@ -936,6 +1122,51 @@ func (in *Oauth2ClientSecret) DeepCopy() *Oauth2ClientSecret { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PolicyAncestorStatus) DeepCopyInto(out *PolicyAncestorStatus) { + *out = *in + in.AncestorRef.DeepCopyInto(&out.AncestorRef) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyAncestorStatus. +func (in *PolicyAncestorStatus) DeepCopy() *PolicyAncestorStatus { + if in == nil { + return nil + } + out := new(PolicyAncestorStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PolicyStatus) DeepCopyInto(out *PolicyStatus) { + *out = *in + if in.Ancestors != nil { + in, out := &in.Ancestors, &out.Ancestors + *out = make([]PolicyAncestorStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyStatus. +func (in *PolicyStatus) DeepCopy() *PolicyStatus { + if in == nil { + return nil + } + out := new(PolicyStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SessionAffinityConfig) DeepCopyInto(out *SessionAffinityConfig) { *out = *in diff --git a/apis/networking/v1/zz_generated.register.go b/apis/networking/v1/zz_generated.register.go index b2a89b8..fbde4a4 100644 --- a/apis/networking/v1/zz_generated.register.go +++ b/apis/networking/v1/zz_generated.register.go @@ -22,16 +22,16 @@ package v1 import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" + metav1 "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 = "networking.gke.io" // GroupVersion specifies the group and the version used to register the objects. -var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v1"} +var GroupVersion = metav1.GroupVersion{Group: GroupName, Version: "v1"} // SchemeGroupVersion is group version used to register these objects // Deprecated: use GroupVersion instead. @@ -69,10 +69,12 @@ func addKnownTypes(scheme *runtime.Scheme) error { &GCPSessionAffinityFilterList{}, &GCPSessionAffinityPolicy{}, &GCPSessionAffinityPolicyList{}, + &GCPTrafficDistributionPolicy{}, + &GCPTrafficDistributionPolicyList{}, &HealthCheckPolicy{}, &HealthCheckPolicyList{}, ) // AddToGroupVersion allows the serialization of client types like ListOptions. - v1.AddToGroupVersion(scheme, SchemeGroupVersion) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil } diff --git a/config/crd/networking.gke.io_gcpbackendpolicies.yaml b/config/crd/networking.gke.io_gcpbackendpolicies.yaml index bc0e25a..456e08c 100644 --- a/config/crd/networking.gke.io_gcpbackendpolicies.yaml +++ b/config/crd/networking.gke.io_gcpbackendpolicies.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.18.0 labels: gateway.networking.k8s.io/policy: Direct name: gcpbackendpolicies.networking.gke.io @@ -228,7 +228,6 @@ spec: PolicyAncestorStatus describes the status of a route with respect to an associated Ancestor. - Ancestors refer to objects that are either the Target of a policy or above it in terms of object hierarchy. For example, if a policy targets a Service, the Policy's Ancestors are, in order, the Service, the HTTPRoute, the Gateway, and @@ -237,28 +236,23 @@ spec: SHOULD use Gateway as the PolicyAncestorStatus object unless the designers have a _very_ good reason otherwise. - In the context of policy attachment, the Ancestor is used to distinguish which resource results in a distinct application of this policy. For example, if a policy targets a Service, it may have a distinct result per attached Gateway. - Policies targeting the same resource may have different effects depending on the ancestors of those resources. For example, different Gateways targeting the same Service may have different capabilities, especially if they have different underlying implementations. - For example, in BackendTLSPolicy, the Policy attaches to a Service that is used as a backend in a HTTPRoute that is itself attached to a Gateway. In this case, the relevant object for status is the Gateway, and that is the ancestor object referred to in this status. - Note that a parent is also an ancestor, so for objects where the parent is the relevant object for status, this struct SHOULD still be used. - This struct is intended to be used in a slice that's effectively a map, with a composite key made up of the AncestorRef and the ControllerName. properties: @@ -275,7 +269,6 @@ spec: To set the core API group (such as for a "Service" kind referent), Group must be explicitly set to "" (empty string). - Support: Core maxLength: 253 pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ @@ -285,14 +278,11 @@ spec: description: |- Kind is kind of the referent. - There are two kinds of parent resources with "Core" support: - * Gateway (Gateway conformance profile) * Service (Mesh conformance profile, ClusterIP Services only) - Support for other resources is Implementation-Specific. maxLength: 63 minLength: 1 @@ -302,7 +292,6 @@ spec: description: |- Name is the name of the referent. - Support: Core maxLength: 253 minLength: 1 @@ -312,20 +301,17 @@ spec: Namespace is the namespace of the referent. When unspecified, this refers to the local namespace of the Route. - Note that there are specific rules for ParentRefs which cross namespace boundaries. Cross-namespace references are only valid if they are explicitly allowed by something in the namespace they are referring to. For example: Gateway has the AllowedRoutes field, and ReferenceGrant provides a generic way to enable any other kind of cross-namespace reference. - ParentRefs from a Route to a Service in the same namespace are "producer" routes, which apply default routing rules to inbound connections from any namespace to the Service. - ParentRefs from a Route to a Service in a different namespace are "consumer" routes, and these routing rules are only applied to outbound connections originating from the same namespace as the Route, for which @@ -333,7 +319,6 @@ spec: ParentRef of the Route. - Support: Core maxLength: 63 minLength: 1 @@ -344,7 +329,6 @@ spec: Port is the network port this Route targets. It can be interpreted differently based on the type of parent resource. - When the parent resource is a Gateway, this targets all listeners listening on the specified port that also support this kind of Route(and select this Route). It's not recommended to set `Port` unless the @@ -353,19 +337,16 @@ spec: and SectionName are specified, the name and port of the selected listener must match both specified values. - When the parent resource is a Service, this targets a specific port in the Service spec. When both Port (experimental) and SectionName are specified, the name and port of the selected port must match both specified values. - Implementations MAY choose to support other parent resources. Implementations supporting other types of parent resources MUST clearly document how/if Port is interpreted. - For the purpose of status, an attachment is considered successful as long as the parent resource accepts it partially. For example, Gateway listeners can restrict which Routes can attach to them by Route kind, @@ -374,7 +355,6 @@ spec: attached. If no Gateway listeners accept attachment from this Route, the Route MUST be considered detached from the Gateway. - Support: Extended format: int32 maximum: 65535 @@ -385,7 +365,6 @@ spec: SectionName is the name of a section within the target resource. In the following resources, SectionName is interpreted as the following: - * Gateway: Listener name. When both Port (experimental) and SectionName are specified, the name and port of the selected listener must match both specified values. @@ -393,12 +372,10 @@ spec: are specified, the name and port of the selected listener must match both specified values. - Implementations MAY choose to support attaching Routes to other resources. If that is the case, they MUST clearly document how SectionName is interpreted. - When unspecified (empty string), this will reference the entire resource. For the purpose of status, an attachment is considered successful if at least one section in the parent resource accepts it. For example, Gateway @@ -408,7 +385,6 @@ spec: attached. If no Gateway listeners accept attachment from this Route, the Route MUST be considered detached from the Gateway. - Support: Core maxLength: 253 minLength: 1 @@ -421,18 +397,8 @@ spec: description: Conditions describes the status of the Policy with respect to the given Ancestor. items: - description: "Condition contains details for one aspect of - the current state of this API Resource.\n---\nThis struct - is intended for direct use as an array at the field path - .status.conditions. For example,\n\n\n\ttype FooStatus - struct{\n\t // Represents the observations of a foo's - current state.\n\t // Known .status.conditions.type are: - \"Available\", \"Progressing\", and \"Degraded\"\n\t // - +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // - +listType=map\n\t // +listMapKey=type\n\t Conditions - []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" - patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t - \ // other fields\n\t}" + description: Condition contains details for one aspect of + the current state of this API Resource. properties: lastTransitionTime: description: |- @@ -474,12 +440,7 @@ spec: - Unknown type: string type: - description: |- - type of condition in CamelCase or in foo.example.com/CamelCase. - --- - Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be - useful (see .node.status.conditions), the ability to deconflict is important. - The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + description: type of condition in CamelCase or in foo.example.com/CamelCase. maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string @@ -502,15 +463,12 @@ spec: controller that wrote this status. This corresponds with the controllerName field on GatewayClass. - Example: "example.net/gateway-controller". - The format of this field is DOMAIN "/" PATH, where DOMAIN and PATH are valid Kubernetes names (https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). - Controllers MUST populate this field when writing status. Controllers should ensure that entries to status populated with their ControllerName are cleaned up when they are no longer necessary. @@ -527,16 +485,8 @@ spec: conditions: description: Conditions describe the current conditions of the GCPBackendPolicy. items: - description: "Condition contains details for one aspect of the current - state of this API Resource.\n---\nThis struct is intended for - direct use as an array at the field path .status.conditions. For - example,\n\n\n\ttype FooStatus struct{\n\t // Represents the - observations of a foo's current state.\n\t // Known .status.conditions.type - are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // - +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t - \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" - patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t - \ // other fields\n\t}" + description: Condition contains details for one aspect of the current + state of this API Resource. properties: lastTransitionTime: description: |- @@ -577,12 +527,7 @@ spec: - Unknown type: string type: - description: |- - type of condition in CamelCase or in foo.example.com/CamelCase. - --- - Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be - useful (see .node.status.conditions), the ability to deconflict is important. - The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + description: type of condition in CamelCase or in foo.example.com/CamelCase. maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string diff --git a/config/crd/networking.gke.io_gcpgatewaypolicies.yaml b/config/crd/networking.gke.io_gcpgatewaypolicies.yaml index 6b7104a..d082f28 100644 --- a/config/crd/networking.gke.io_gcpgatewaypolicies.yaml +++ b/config/crd/networking.gke.io_gcpgatewaypolicies.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.18.0 labels: gateway.networking.k8s.io/policy: Direct name: gcpgatewaypolicies.networking.gke.io @@ -99,16 +99,8 @@ spec: conditions: description: Conditions describe the current conditions of the GatewayPolicy. items: - description: "Condition contains details for one aspect of the current - state of this API Resource.\n---\nThis struct is intended for - direct use as an array at the field path .status.conditions. For - example,\n\n\n\ttype FooStatus struct{\n\t // Represents the - observations of a foo's current state.\n\t // Known .status.conditions.type - are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // - +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t - \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" - patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t - \ // other fields\n\t}" + description: Condition contains details for one aspect of the current + state of this API Resource. properties: lastTransitionTime: description: |- @@ -149,12 +141,7 @@ spec: - Unknown type: string type: - description: |- - type of condition in CamelCase or in foo.example.com/CamelCase. - --- - Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be - useful (see .node.status.conditions), the ability to deconflict is important. - The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + description: type of condition in CamelCase or in foo.example.com/CamelCase. maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string diff --git a/config/crd/networking.gke.io_gcpsessionaffinityfilters.yaml b/config/crd/networking.gke.io_gcpsessionaffinityfilters.yaml index dd6b077..2a62517 100644 --- a/config/crd/networking.gke.io_gcpsessionaffinityfilters.yaml +++ b/config/crd/networking.gke.io_gcpsessionaffinityfilters.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.18.0 name: gcpsessionaffinityfilters.networking.gke.io spec: group: networking.gke.io @@ -71,16 +71,8 @@ spec: conditions: description: Conditions describe the current conditions of the GCPSessionAffinityFilter. items: - description: "Condition contains details for one aspect of the current - state of this API Resource.\n---\nThis struct is intended for - direct use as an array at the field path .status.conditions. For - example,\n\n\n\ttype FooStatus struct{\n\t // Represents the - observations of a foo's current state.\n\t // Known .status.conditions.type - are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // - +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t - \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" - patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t - \ // other fields\n\t}" + description: Condition contains details for one aspect of the current + state of this API Resource. properties: lastTransitionTime: description: |- @@ -121,12 +113,7 @@ spec: - Unknown type: string type: - description: |- - type of condition in CamelCase or in foo.example.com/CamelCase. - --- - Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be - useful (see .node.status.conditions), the ability to deconflict is important. - The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + description: type of condition in CamelCase or in foo.example.com/CamelCase. maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string diff --git a/config/crd/networking.gke.io_gcpsessionaffinitypolicies.yaml b/config/crd/networking.gke.io_gcpsessionaffinitypolicies.yaml index d355294..d7edd64 100644 --- a/config/crd/networking.gke.io_gcpsessionaffinitypolicies.yaml +++ b/config/crd/networking.gke.io_gcpsessionaffinitypolicies.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.18.0 labels: gateway.networking.k8s.io/policy: Direct name: gcpsessionaffinitypolicies.networking.gke.io @@ -109,16 +109,8 @@ spec: conditions: description: Conditions describe the current conditions of the GCPSessionAffinityPolicy. items: - description: "Condition contains details for one aspect of the current - state of this API Resource.\n---\nThis struct is intended for - direct use as an array at the field path .status.conditions. For - example,\n\n\n\ttype FooStatus struct{\n\t // Represents the - observations of a foo's current state.\n\t // Known .status.conditions.type - are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // - +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t - \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" - patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t - \ // other fields\n\t}" + description: Condition contains details for one aspect of the current + state of this API Resource. properties: lastTransitionTime: description: |- @@ -159,12 +151,7 @@ spec: - Unknown type: string type: - description: |- - type of condition in CamelCase or in foo.example.com/CamelCase. - --- - Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be - useful (see .node.status.conditions), the ability to deconflict is important. - The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + description: type of condition in CamelCase or in foo.example.com/CamelCase. maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string diff --git a/config/crd/networking.gke.io_gcptrafficdistributionpolicies.yaml b/config/crd/networking.gke.io_gcptrafficdistributionpolicies.yaml index d6f3e3d..986891e 100644 --- a/config/crd/networking.gke.io_gcptrafficdistributionpolicies.yaml +++ b/config/crd/networking.gke.io_gcptrafficdistributionpolicies.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.18.0 labels: gateway.networking.k8s.io/policy: Direct name: gcptrafficdistributionpolicies.networking.gke.io @@ -159,27 +159,22 @@ spec: the controller first sees the policy and SHOULD update the entry as appropriate when the relevant ancestor is modified. - Note that choosing the relevant ancestor is left to the Policy designers; an important part of Policy design is designing the right object level at which to namespace this status. - Note also that implementations MUST ONLY populate ancestor status for the Ancestor resources they are responsible for. Implementations MUST use the ControllerName field to uniquely identify the entries in this list that they are responsible for. - Note that to achieve this, the list of PolicyAncestorStatus structs MUST be treated as a map with a composite key, made up of the AncestorRef and ControllerName fields combined. - A maximum of 16 ancestors will be represented in this list. An empty list means the Policy is not relevant for any ancestors. - If this slice is full, implementations MUST NOT add further entries. Instead they MUST consider the policy unimplementable and signal that on any related resources such as the ancestor that would be referenced @@ -191,7 +186,6 @@ spec: PolicyAncestorStatus describes the status of a route with respect to an associated Ancestor. - Ancestors refer to objects that are either the Target of a policy or above it in terms of object hierarchy. For example, if a policy targets a Service, the Policy's Ancestors are, in order, the Service, the HTTPRoute, the Gateway, and @@ -200,28 +194,23 @@ spec: SHOULD use Gateway as the PolicyAncestorStatus object unless the designers have a _very_ good reason otherwise. - In the context of policy attachment, the Ancestor is used to distinguish which resource results in a distinct application of this policy. For example, if a policy targets a Service, it may have a distinct result per attached Gateway. - Policies targeting the same resource may have different effects depending on the ancestors of those resources. For example, different Gateways targeting the same Service may have different capabilities, especially if they have different underlying implementations. - For example, in BackendTLSPolicy, the Policy attaches to a Service that is used as a backend in a HTTPRoute that is itself attached to a Gateway. In this case, the relevant object for status is the Gateway, and that is the ancestor object referred to in this status. - Note that a parent is also an ancestor, so for objects where the parent is the relevant object for status, this struct SHOULD still be used. - This struct is intended to be used in a slice that's effectively a map, with a composite key made up of the AncestorRef and the ControllerName. properties: @@ -238,7 +227,6 @@ spec: To set the core API group (such as for a "Service" kind referent), Group must be explicitly set to "" (empty string). - Support: Core maxLength: 253 pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ @@ -248,14 +236,11 @@ spec: description: |- Kind is kind of the referent. - There are two kinds of parent resources with "Core" support: - * Gateway (Gateway conformance profile) * Service (Mesh conformance profile, ClusterIP Services only) - Support for other resources is Implementation-Specific. maxLength: 63 minLength: 1 @@ -265,7 +250,6 @@ spec: description: |- Name is the name of the referent. - Support: Core maxLength: 253 minLength: 1 @@ -275,20 +259,17 @@ spec: Namespace is the namespace of the referent. When unspecified, this refers to the local namespace of the Route. - Note that there are specific rules for ParentRefs which cross namespace boundaries. Cross-namespace references are only valid if they are explicitly allowed by something in the namespace they are referring to. For example: Gateway has the AllowedRoutes field, and ReferenceGrant provides a generic way to enable any other kind of cross-namespace reference. - ParentRefs from a Route to a Service in the same namespace are "producer" routes, which apply default routing rules to inbound connections from any namespace to the Service. - ParentRefs from a Route to a Service in a different namespace are "consumer" routes, and these routing rules are only applied to outbound connections originating from the same namespace as the Route, for which @@ -296,7 +277,6 @@ spec: ParentRef of the Route. - Support: Core maxLength: 63 minLength: 1 @@ -307,7 +287,6 @@ spec: Port is the network port this Route targets. It can be interpreted differently based on the type of parent resource. - When the parent resource is a Gateway, this targets all listeners listening on the specified port that also support this kind of Route(and select this Route). It's not recommended to set `Port` unless the @@ -316,19 +295,16 @@ spec: and SectionName are specified, the name and port of the selected listener must match both specified values. - When the parent resource is a Service, this targets a specific port in the Service spec. When both Port (experimental) and SectionName are specified, the name and port of the selected port must match both specified values. - Implementations MAY choose to support other parent resources. Implementations supporting other types of parent resources MUST clearly document how/if Port is interpreted. - For the purpose of status, an attachment is considered successful as long as the parent resource accepts it partially. For example, Gateway listeners can restrict which Routes can attach to them by Route kind, @@ -337,7 +313,6 @@ spec: attached. If no Gateway listeners accept attachment from this Route, the Route MUST be considered detached from the Gateway. - Support: Extended format: int32 maximum: 65535 @@ -348,7 +323,6 @@ spec: SectionName is the name of a section within the target resource. In the following resources, SectionName is interpreted as the following: - * Gateway: Listener name. When both Port (experimental) and SectionName are specified, the name and port of the selected listener must match both specified values. @@ -356,12 +330,10 @@ spec: are specified, the name and port of the selected listener must match both specified values. - Implementations MAY choose to support attaching Routes to other resources. If that is the case, they MUST clearly document how SectionName is interpreted. - When unspecified (empty string), this will reference the entire resource. For the purpose of status, an attachment is considered successful if at least one section in the parent resource accepts it. For example, Gateway @@ -371,7 +343,6 @@ spec: attached. If no Gateway listeners accept attachment from this Route, the Route MUST be considered detached from the Gateway. - Support: Core maxLength: 253 minLength: 1 @@ -384,18 +355,8 @@ spec: description: Conditions describes the status of the Policy with respect to the given Ancestor. items: - description: "Condition contains details for one aspect of - the current state of this API Resource.\n---\nThis struct - is intended for direct use as an array at the field path - .status.conditions. For example,\n\n\n\ttype FooStatus - struct{\n\t // Represents the observations of a foo's - current state.\n\t // Known .status.conditions.type are: - \"Available\", \"Progressing\", and \"Degraded\"\n\t // - +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // - +listType=map\n\t // +listMapKey=type\n\t Conditions - []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" - patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t - \ // other fields\n\t}" + description: Condition contains details for one aspect of + the current state of this API Resource. properties: lastTransitionTime: description: |- @@ -437,12 +398,7 @@ spec: - Unknown type: string type: - description: |- - type of condition in CamelCase or in foo.example.com/CamelCase. - --- - Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be - useful (see .node.status.conditions), the ability to deconflict is important. - The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + description: type of condition in CamelCase or in foo.example.com/CamelCase. maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string @@ -465,15 +421,12 @@ spec: controller that wrote this status. This corresponds with the controllerName field on GatewayClass. - Example: "example.net/gateway-controller". - The format of this field is DOMAIN "/" PATH, where DOMAIN and PATH are valid Kubernetes names (https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). - Controllers MUST populate this field when writing status. Controllers should ensure that entries to status populated with their ControllerName are cleaned up when they are no longer necessary. diff --git a/config/crd/networking.gke.io_healthcheckpolicies.yaml b/config/crd/networking.gke.io_healthcheckpolicies.yaml index e9cfa14..b613956 100644 --- a/config/crd/networking.gke.io_healthcheckpolicies.yaml +++ b/config/crd/networking.gke.io_healthcheckpolicies.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.15.0 + controller-gen.kubebuilder.io/version: v0.18.0 labels: gateway.networking.k8s.io/policy: Direct name: healthcheckpolicies.networking.gke.io @@ -98,14 +98,12 @@ spec: description: |- Specifies how port is selected for health checking, can be one of following values: - USE_FIXED_PORT: The port number in port is used for health checking. USE_NAMED_PORT: The portName is used for health checking. USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. - If not specified, Protocol health check follows behavior specified in port and portName fields. If neither Port nor PortName is specified, this defaults to USE_SERVING_PORT. enum: @@ -146,14 +144,12 @@ spec: description: |- Specifies how port is selected for health checking, can be one of following values: - USE_FIXED_PORT: The port number in port is used for health checking. USE_NAMED_PORT: The portName is used for health checking. USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. - If not specified, Protocol health check follows behavior specified in port and portName fields. If neither Port nor PortName is specified, this defaults to USE_SERVING_PORT. enum: @@ -217,14 +213,12 @@ spec: description: |- Specifies how port is selected for health checking, can be one of following values: - USE_FIXED_PORT: The port number in port is used for health checking. USE_NAMED_PORT: The portName is used for health checking. USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. - If not specified, Protocol health check follows behavior specified in port and portName fields. If neither Port nor PortName is specified, this defaults to USE_SERVING_PORT. enum: @@ -288,14 +282,12 @@ spec: description: |- Specifies how port is selected for health checking, can be one of following values: - USE_FIXED_PORT: The port number in port is used for health checking. USE_NAMED_PORT: The portName is used for health checking. USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. - If not specified, Protocol health check follows behavior specified in port and portName fields. If neither Port nor PortName is specified, this defaults to USE_SERVING_PORT. enum: @@ -349,14 +341,12 @@ spec: description: |- Specifies how port is selected for health checking, can be one of following values: - USE_FIXED_PORT: The port number in port is used for health checking. USE_NAMED_PORT: The portName is used for health checking. USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each network endpoint is used for health checking. For other backends, the port or named port specified in the Backend Service is used for health checking. - If not specified, Protocol health check follows behavior specified in port and portName fields. If neither Port nor PortName is specified, this defaults to USE_SERVING_PORT. enum: @@ -481,16 +471,8 @@ spec: conditions: description: Conditions describe the current conditions of the HealthCheckPolicy. items: - description: "Condition contains details for one aspect of the current - state of this API Resource.\n---\nThis struct is intended for - direct use as an array at the field path .status.conditions. For - example,\n\n\n\ttype FooStatus struct{\n\t // Represents the - observations of a foo's current state.\n\t // Known .status.conditions.type - are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // - +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t - \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" - patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t - \ // other fields\n\t}" + description: Condition contains details for one aspect of the current + state of this API Resource. properties: lastTransitionTime: description: |- @@ -531,12 +513,7 @@ spec: - Unknown type: string type: - description: |- - type of condition in CamelCase or in foo.example.com/CamelCase. - --- - Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be - useful (see .node.status.conditions), the ability to deconflict is important. - The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + description: type of condition in CamelCase or in foo.example.com/CamelCase. maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string diff --git a/go.mod b/go.mod index 667a4bd..be9535b 100644 --- a/go.mod +++ b/go.mod @@ -1,14 +1,14 @@ module github.com/GoogleCloudPlatform/gke-gateway-api -go 1.22.0 +go 1.24.0 -toolchain go1.22.3 +toolchain go1.24.4 require ( - k8s.io/apimachinery v0.31.1 - k8s.io/client-go v0.31.1 - k8s.io/code-generator v0.31.1 - sigs.k8s.io/controller-tools v0.16.3 + k8s.io/apimachinery v0.33.0 + k8s.io/client-go v0.33.0 + k8s.io/code-generator v0.33.0 + sigs.k8s.io/controller-tools v0.18.0 sigs.k8s.io/gateway-api v1.2.1 ) @@ -16,21 +16,18 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/go-restful/v3 v3.12.0 // indirect github.com/evanphx/json-patch/v5 v5.9.0 // indirect - github.com/fatih/color v1.17.0 // indirect + github.com/fatih/color v1.18.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/jsonreference v0.21.0 // indirect github.com/go-openapi/swag v0.23.0 // indirect - github.com/gobuffalo/flect v1.0.2 // indirect + github.com/gobuffalo/flect v1.0.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/protobuf v1.5.4 // indirect - github.com/google/gnostic-models v0.6.8 // indirect - github.com/google/go-cmp v0.6.0 // indirect - github.com/google/gofuzz v1.2.0 // indirect + github.com/google/gnostic-models v0.6.9 // indirect + github.com/google/go-cmp v0.7.0 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.1 // indirect - github.com/imdario/mergo v0.3.16 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -38,41 +35,42 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/miekg/dns v1.1.62 // indirect - github.com/moby/spdystream v0.4.0 // indirect + github.com/moby/spdystream v0.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/spf13/cobra v1.8.1 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/testify v1.9.0 // indirect + github.com/spf13/cobra v1.9.1 // indirect + github.com/spf13/pflag v1.0.6 // indirect + github.com/stretchr/testify v1.10.0 // indirect github.com/x448/float16 v0.8.4 // indirect - golang.org/x/mod v0.20.0 // indirect - golang.org/x/net v0.28.0 // indirect - golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.24.0 // indirect - golang.org/x/term v0.23.0 // indirect - golang.org/x/text v0.17.0 // indirect - golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.24.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect - google.golang.org/grpc v1.66.2 // indirect - google.golang.org/protobuf v1.34.2 // indirect + golang.org/x/mod v0.24.0 // indirect + golang.org/x/net v0.39.0 // indirect + golang.org/x/oauth2 v0.27.0 // indirect + golang.org/x/sync v0.13.0 // indirect + golang.org/x/sys v0.32.0 // indirect + golang.org/x/term v0.31.0 // indirect + golang.org/x/text v0.24.0 // indirect + golang.org/x/time v0.9.0 // indirect + golang.org/x/tools v0.32.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect + google.golang.org/grpc v1.68.1 // indirect + google.golang.org/protobuf v1.36.5 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/api v0.31.1 // indirect - k8s.io/apiextensions-apiserver v0.31.1 // indirect - k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect + k8s.io/api v0.33.0 // indirect + k8s.io/apiextensions-apiserver v0.33.0 // indirect + k8s.io/gengo/v2 v2.0.0-20250207200755-1244d31929d7 // indirect k8s.io/klog/v2 v2.130.1 // indirect - k8s.io/kube-openapi v0.0.0-20240423202451-8948a665c108 // indirect - k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect + k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect + k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect sigs.k8s.io/controller-runtime v0.18.0 // indirect - sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect + sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect + sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/go.sum b/go.sum index e528767..04d6cde 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,6 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -11,8 +11,8 @@ github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= -github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= -github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= +github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= +github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= @@ -30,28 +30,24 @@ github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= -github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA= -github.com/gobuffalo/flect v1.0.2/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs= +github.com/gobuffalo/flect v1.0.3 h1:xeWBM2nui+qnVvNM4S3foBhCAL2XgPU+a7FdpelbTq4= +github.com/gobuffalo/flect v1.0.3/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= -github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= +github.com/google/gnostic-models v0.6.9 h1:MU/8wDLif2qCXZmzncUQ/BOfxWfthHi63KqpoNbWqVw= +github.com/google/gnostic-models v0.6.9/go.mod h1:CiWsm0s6BSQd1hRn8/QmxqB6BesYcbSZxsz9b0KuDBw= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -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/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= -github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2Rrd27c3VGxi6a/6HNq8QmHRKM= -github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= +github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgYQBbFN4U4JNXUNYpxael3UzMyo= +github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= -github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= -github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= -github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -73,8 +69,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/miekg/dns v1.1.62 h1:cN8OuEF1/x5Rq6Np+h1epln8OiyPWV+lROx9LxcGgIQ= github.com/miekg/dns v1.1.62/go.mod h1:mvDlcItzm+br7MToIKqkglaGhlFMHJ9DTNNWONWXbNQ= -github.com/moby/spdystream v0.4.0 h1:Vy79D6mHeJJjiPdFEL2yku1kl0chZpJfZcPpb16BRl8= -github.com/moby/spdystream v0.4.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI= +github.com/moby/spdystream v0.5.0 h1:7r0J1Si3QO/kjRitvSLVVFUjxMEb/YLj6S9FF62JBCU= +github.com/moby/spdystream v0.5.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -88,92 +84,96 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= -github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= -github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8= -github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc= +github.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM= +github.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= +github.com/onsi/gomega v1.37.0 h1:CdEG8g0S133B4OswTDC/5XPSzE1OeP29QOioj2PID2Y= +github.com/onsi/gomega v1.37.0/go.mod h1:8D9+Txp43QWKhM24yyOBEdpkzN8FvJyAwecBgsU4KU0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= -github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= +github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= +github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= +github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f h1:99ci1mjWVBWwJiEKYY6jWa4d2nTQVIEhZIptnrVb1XY= -golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0= -golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= +golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= -golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= -golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= +golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= +golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M= +golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= +golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= -golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= +golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= +golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= +golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= -golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= -golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= +golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= +golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= +golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= -golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= +golang.org/x/tools v0.32.0 h1:Q7N1vhpkQv7ybVzLFtTjvQya2ewbwNDZzUgfXGqtMWU= +golang.org/x/tools v0.32.0/go.mod h1:ZxrU41P/wAbZD8EDa6dDCa6XfpkhJ7HFMjHJXfBDu8s= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 h1:BwIjyKYGsK9dMCBOorzRri8MQwmi7mT9rGHsCEinZkA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= -google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo= -google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 h1:8ZmaLZE4XWrtU3MyClkYqqtl6Oegr3235h7jxsDyqCY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= +google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0= +google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw= +google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= +google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= @@ -183,39 +183,41 @@ gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.31.1 h1:Xe1hX/fPW3PXYYv8BlozYqw63ytA92snr96zMW9gWTU= -k8s.io/api v0.31.1/go.mod h1:sbN1g6eY6XVLeqNsZGLnI5FwVseTrZX7Fv3O26rhAaI= -k8s.io/apiextensions-apiserver v0.31.1 h1:L+hwULvXx+nvTYX/MKM3kKMZyei+UiSXQWciX/N6E40= -k8s.io/apiextensions-apiserver v0.31.1/go.mod h1:tWMPR3sgW+jsl2xm9v7lAyRF1rYEK71i9G5dRtkknoQ= -k8s.io/apimachinery v0.31.1 h1:mhcUBbj7KUjaVhyXILglcVjuS4nYXiwC+KKFBgIVy7U= -k8s.io/apimachinery v0.31.1/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= -k8s.io/client-go v0.31.1 h1:f0ugtWSbWpxHR7sjVpQwuvw9a3ZKLXX0u0itkFXufb0= -k8s.io/client-go v0.31.1/go.mod h1:sKI8871MJN2OyeqRlmA4W4KM9KBdBUpDLu/43eGemCg= -k8s.io/code-generator v0.31.1 h1:GvkRZEP2g2UnB2QKT2Dgc/kYxIkDxCHENv2Q1itioVs= -k8s.io/code-generator v0.31.1/go.mod h1:oL2ky46L48osNqqZAeOcWWy0S5BXj50vVdwOtTefqIs= -k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 h1:NGrVE502P0s0/1hudf8zjgwki1X/TByhmAoILTarmzo= -k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= +k8s.io/api v0.33.0 h1:yTgZVn1XEe6opVpP1FylmNrIFWuDqe2H0V8CT5gxfIU= +k8s.io/api v0.33.0/go.mod h1:CTO61ECK/KU7haa3qq8sarQ0biLq2ju405IZAd9zsiM= +k8s.io/apiextensions-apiserver v0.33.0 h1:d2qpYL7Mngbsc1taA4IjJPRJ9ilnsXIrndH+r9IimOs= +k8s.io/apiextensions-apiserver v0.33.0/go.mod h1:VeJ8u9dEEN+tbETo+lFkwaaZPg6uFKLGj5vyNEwwSzc= +k8s.io/apimachinery v0.33.0 h1:1a6kHrJxb2hs4t8EE5wuR/WxKDwGN1FKH3JvDtA0CIQ= +k8s.io/apimachinery v0.33.0/go.mod h1:BHW0YOu7n22fFv/JkYOEfkUYNRN0fj0BlvMFWA7b+SM= +k8s.io/client-go v0.33.0 h1:UASR0sAYVUzs2kYuKn/ZakZlcs2bEHaizrrHUZg0G98= +k8s.io/client-go v0.33.0/go.mod h1:kGkd+l/gNGg8GYWAPr0xF1rRKvVWvzh9vmZAMXtaKOg= +k8s.io/code-generator v0.33.0 h1:B212FVl6EFqNmlgdOZYWNi77yBv+ed3QgQsMR8YQCw4= +k8s.io/code-generator v0.33.0/go.mod h1:KnJRokGxjvbBQkSJkbVuBbu6z4B0rC7ynkpY5Aw6m9o= +k8s.io/gengo/v2 v2.0.0-20250207200755-1244d31929d7 h1:2OX19X59HxDprNCVrWi6jb7LW1PoqTlYqEq5H2oetog= +k8s.io/gengo/v2 v2.0.0-20250207200755-1244d31929d7/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= -k8s.io/kube-openapi v0.0.0-20240423202451-8948a665c108 h1:Q8Z7VlGhcJgBHJHYugJ/K/7iB8a2eSxCyxdVjJp+lLY= -k8s.io/kube-openapi v0.0.0-20240423202451-8948a665c108/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= -k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= -k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff h1:/usPimJzUKKu+m+TE36gUyGcf03XZEP0ZIKgKj35LS4= +k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff/go.mod h1:5jIi+8yX4RIb8wk3XwBo5Pq2ccx4FP10ohkbSKCZoK8= +k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro= +k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/controller-runtime v0.18.0 h1:Z7jKuX784TQSUL1TIyeuF7j8KXZ4RtSX0YgtjKcSTME= sigs.k8s.io/controller-runtime v0.18.0/go.mod h1:tuAt1+wbVsXIT8lPtk5RURxqAnq7xkpv2Mhttslg7Hw= -sigs.k8s.io/controller-tools v0.16.3 h1:z48C5/d4jCVQQvtiSBL5MYyZ3EO2eFIOXrIKMgHVhFY= -sigs.k8s.io/controller-tools v0.16.3/go.mod h1:AEj6k+w1kYpLZv2einOH3mj52ips4W/6FUjnB5tkJGs= +sigs.k8s.io/controller-tools v0.18.0 h1:rGxGZCZTV2wJreeRgqVoWab/mfcumTMmSwKzoM9xrsE= +sigs.k8s.io/controller-tools v0.18.0/go.mod h1:gLKoiGBriyNh+x1rWtUQnakUYEujErjXs9pf+x/8n1U= sigs.k8s.io/gateway-api v1.2.1 h1:fZZ/+RyRb+Y5tGkwxFKuYuSRQHu9dZtbjenblleOLHM= sigs.k8s.io/gateway-api v1.2.1/go.mod h1:EpNfEXNjiYfUJypf0eZ0P5iXA9ekSGWaS1WgPaM42X0= -sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= -sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= -sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= +sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8= +sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo= +sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= +sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY= +sigs.k8s.io/structured-merge-diff/v4 v4.6.0 h1:IUA9nvMmnKWcj5jl84xn+T5MnlZKThmUW1TdblaLVAc= +sigs.k8s.io/structured-merge-diff/v4 v4.6.0/go.mod h1:dDy58f92j70zLsuZVuUX5Wp9vtxXpaZnkPGWeqDfCps= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 0df9e0d..5efde76 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -19,8 +19,8 @@ package versioned import ( - "fmt" - "net/http" + fmt "fmt" + http "net/http" networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/clientset/versioned/typed/networking/v1" discovery "k8s.io/client-go/discovery" diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index 963acc5..0455ff8 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -22,6 +22,7 @@ import ( clientset "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/clientset/versioned" networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/clientset/versioned/typed/networking/v1" fakenetworkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/clientset/versioned/typed/networking/v1/fake" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" @@ -31,8 +32,12 @@ import ( // 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 validations and/or defaults. It shouldn't be considered a replacement +// 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 { @@ -45,9 +50,13 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset { 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) { + var opts metav1.ListOptions + if watchActcion, ok := action.(testing.WatchActionImpl); ok { + opts = watchActcion.ListOptions + } gvr := action.GetResource() ns := action.GetNamespace() - watch, err := o.Watch(gvr, ns) + watch, err := o.Watch(gvr, ns, opts) if err != nil { return false, nil, err } diff --git a/pkg/client/clientset/versioned/typed/networking/v1/fake/fake_gcpbackendpolicy.go b/pkg/client/clientset/versioned/typed/networking/v1/fake/fake_gcpbackendpolicy.go index 30bd88a..dae763e 100644 --- a/pkg/client/clientset/versioned/typed/networking/v1/fake/fake_gcpbackendpolicy.go +++ b/pkg/client/clientset/versioned/typed/networking/v1/fake/fake_gcpbackendpolicy.go @@ -19,123 +19,32 @@ package fake import ( - "context" - v1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/clientset/versioned/typed/networking/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeGCPBackendPolicies implements GCPBackendPolicyInterface -type FakeGCPBackendPolicies struct { +// fakeGCPBackendPolicies implements GCPBackendPolicyInterface +type fakeGCPBackendPolicies struct { + *gentype.FakeClientWithList[*v1.GCPBackendPolicy, *v1.GCPBackendPolicyList] Fake *FakeNetworkingV1 - ns string -} - -var gcpbackendpoliciesResource = v1.SchemeGroupVersion.WithResource("gcpbackendpolicies") - -var gcpbackendpoliciesKind = v1.SchemeGroupVersion.WithKind("GCPBackendPolicy") - -// Get takes name of the gCPBackendPolicy, and returns the corresponding gCPBackendPolicy object, and an error if there is any. -func (c *FakeGCPBackendPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GCPBackendPolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(gcpbackendpoliciesResource, c.ns, name), &v1.GCPBackendPolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.GCPBackendPolicy), err -} - -// List takes label and field selectors, and returns the list of GCPBackendPolicies that match those selectors. -func (c *FakeGCPBackendPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GCPBackendPolicyList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(gcpbackendpoliciesResource, gcpbackendpoliciesKind, c.ns, opts), &v1.GCPBackendPolicyList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.GCPBackendPolicyList{ListMeta: obj.(*v1.GCPBackendPolicyList).ListMeta} - for _, item := range obj.(*v1.GCPBackendPolicyList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested gCPBackendPolicies. -func (c *FakeGCPBackendPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(gcpbackendpoliciesResource, c.ns, opts)) - -} - -// Create takes the representation of a gCPBackendPolicy and creates it. Returns the server's representation of the gCPBackendPolicy, and an error, if there is any. -func (c *FakeGCPBackendPolicies) Create(ctx context.Context, gCPBackendPolicy *v1.GCPBackendPolicy, opts metav1.CreateOptions) (result *v1.GCPBackendPolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(gcpbackendpoliciesResource, c.ns, gCPBackendPolicy), &v1.GCPBackendPolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.GCPBackendPolicy), err -} - -// Update takes the representation of a gCPBackendPolicy and updates it. Returns the server's representation of the gCPBackendPolicy, and an error, if there is any. -func (c *FakeGCPBackendPolicies) Update(ctx context.Context, gCPBackendPolicy *v1.GCPBackendPolicy, opts metav1.UpdateOptions) (result *v1.GCPBackendPolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(gcpbackendpoliciesResource, c.ns, gCPBackendPolicy), &v1.GCPBackendPolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.GCPBackendPolicy), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeGCPBackendPolicies) UpdateStatus(ctx context.Context, gCPBackendPolicy *v1.GCPBackendPolicy, opts metav1.UpdateOptions) (*v1.GCPBackendPolicy, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(gcpbackendpoliciesResource, "status", c.ns, gCPBackendPolicy), &v1.GCPBackendPolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.GCPBackendPolicy), err -} - -// Delete takes name of the gCPBackendPolicy and deletes it. Returns an error if one occurs. -func (c *FakeGCPBackendPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(gcpbackendpoliciesResource, c.ns, name, opts), &v1.GCPBackendPolicy{}) - - return err } -// DeleteCollection deletes a collection of objects. -func (c *FakeGCPBackendPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(gcpbackendpoliciesResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v1.GCPBackendPolicyList{}) - return err -} - -// Patch applies the patch and returns the patched gCPBackendPolicy. -func (c *FakeGCPBackendPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GCPBackendPolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(gcpbackendpoliciesResource, c.ns, name, pt, data, subresources...), &v1.GCPBackendPolicy{}) - - if obj == nil { - return nil, err +func newFakeGCPBackendPolicies(fake *FakeNetworkingV1, namespace string) networkingv1.GCPBackendPolicyInterface { + return &fakeGCPBackendPolicies{ + gentype.NewFakeClientWithList[*v1.GCPBackendPolicy, *v1.GCPBackendPolicyList]( + fake.Fake, + namespace, + v1.SchemeGroupVersion.WithResource("gcpbackendpolicies"), + v1.SchemeGroupVersion.WithKind("GCPBackendPolicy"), + func() *v1.GCPBackendPolicy { return &v1.GCPBackendPolicy{} }, + func() *v1.GCPBackendPolicyList { return &v1.GCPBackendPolicyList{} }, + func(dst, src *v1.GCPBackendPolicyList) { dst.ListMeta = src.ListMeta }, + func(list *v1.GCPBackendPolicyList) []*v1.GCPBackendPolicy { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.GCPBackendPolicyList, items []*v1.GCPBackendPolicy) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1.GCPBackendPolicy), err } diff --git a/pkg/client/clientset/versioned/typed/networking/v1/fake/fake_gcpgatewaypolicy.go b/pkg/client/clientset/versioned/typed/networking/v1/fake/fake_gcpgatewaypolicy.go index 339ee51..b44a5b1 100644 --- a/pkg/client/clientset/versioned/typed/networking/v1/fake/fake_gcpgatewaypolicy.go +++ b/pkg/client/clientset/versioned/typed/networking/v1/fake/fake_gcpgatewaypolicy.go @@ -19,123 +19,32 @@ package fake import ( - "context" - v1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/clientset/versioned/typed/networking/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeGCPGatewayPolicies implements GCPGatewayPolicyInterface -type FakeGCPGatewayPolicies struct { +// fakeGCPGatewayPolicies implements GCPGatewayPolicyInterface +type fakeGCPGatewayPolicies struct { + *gentype.FakeClientWithList[*v1.GCPGatewayPolicy, *v1.GCPGatewayPolicyList] Fake *FakeNetworkingV1 - ns string -} - -var gcpgatewaypoliciesResource = v1.SchemeGroupVersion.WithResource("gcpgatewaypolicies") - -var gcpgatewaypoliciesKind = v1.SchemeGroupVersion.WithKind("GCPGatewayPolicy") - -// Get takes name of the gCPGatewayPolicy, and returns the corresponding gCPGatewayPolicy object, and an error if there is any. -func (c *FakeGCPGatewayPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GCPGatewayPolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(gcpgatewaypoliciesResource, c.ns, name), &v1.GCPGatewayPolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.GCPGatewayPolicy), err -} - -// List takes label and field selectors, and returns the list of GCPGatewayPolicies that match those selectors. -func (c *FakeGCPGatewayPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GCPGatewayPolicyList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(gcpgatewaypoliciesResource, gcpgatewaypoliciesKind, c.ns, opts), &v1.GCPGatewayPolicyList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.GCPGatewayPolicyList{ListMeta: obj.(*v1.GCPGatewayPolicyList).ListMeta} - for _, item := range obj.(*v1.GCPGatewayPolicyList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested gCPGatewayPolicies. -func (c *FakeGCPGatewayPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(gcpgatewaypoliciesResource, c.ns, opts)) - -} - -// Create takes the representation of a gCPGatewayPolicy and creates it. Returns the server's representation of the gCPGatewayPolicy, and an error, if there is any. -func (c *FakeGCPGatewayPolicies) Create(ctx context.Context, gCPGatewayPolicy *v1.GCPGatewayPolicy, opts metav1.CreateOptions) (result *v1.GCPGatewayPolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(gcpgatewaypoliciesResource, c.ns, gCPGatewayPolicy), &v1.GCPGatewayPolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.GCPGatewayPolicy), err -} - -// Update takes the representation of a gCPGatewayPolicy and updates it. Returns the server's representation of the gCPGatewayPolicy, and an error, if there is any. -func (c *FakeGCPGatewayPolicies) Update(ctx context.Context, gCPGatewayPolicy *v1.GCPGatewayPolicy, opts metav1.UpdateOptions) (result *v1.GCPGatewayPolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(gcpgatewaypoliciesResource, c.ns, gCPGatewayPolicy), &v1.GCPGatewayPolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.GCPGatewayPolicy), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeGCPGatewayPolicies) UpdateStatus(ctx context.Context, gCPGatewayPolicy *v1.GCPGatewayPolicy, opts metav1.UpdateOptions) (*v1.GCPGatewayPolicy, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(gcpgatewaypoliciesResource, "status", c.ns, gCPGatewayPolicy), &v1.GCPGatewayPolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.GCPGatewayPolicy), err -} - -// Delete takes name of the gCPGatewayPolicy and deletes it. Returns an error if one occurs. -func (c *FakeGCPGatewayPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(gcpgatewaypoliciesResource, c.ns, name, opts), &v1.GCPGatewayPolicy{}) - - return err } -// DeleteCollection deletes a collection of objects. -func (c *FakeGCPGatewayPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(gcpgatewaypoliciesResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v1.GCPGatewayPolicyList{}) - return err -} - -// Patch applies the patch and returns the patched gCPGatewayPolicy. -func (c *FakeGCPGatewayPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GCPGatewayPolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(gcpgatewaypoliciesResource, c.ns, name, pt, data, subresources...), &v1.GCPGatewayPolicy{}) - - if obj == nil { - return nil, err +func newFakeGCPGatewayPolicies(fake *FakeNetworkingV1, namespace string) networkingv1.GCPGatewayPolicyInterface { + return &fakeGCPGatewayPolicies{ + gentype.NewFakeClientWithList[*v1.GCPGatewayPolicy, *v1.GCPGatewayPolicyList]( + fake.Fake, + namespace, + v1.SchemeGroupVersion.WithResource("gcpgatewaypolicies"), + v1.SchemeGroupVersion.WithKind("GCPGatewayPolicy"), + func() *v1.GCPGatewayPolicy { return &v1.GCPGatewayPolicy{} }, + func() *v1.GCPGatewayPolicyList { return &v1.GCPGatewayPolicyList{} }, + func(dst, src *v1.GCPGatewayPolicyList) { dst.ListMeta = src.ListMeta }, + func(list *v1.GCPGatewayPolicyList) []*v1.GCPGatewayPolicy { return list.Items }, + func(list *v1.GCPGatewayPolicyList, items []*v1.GCPGatewayPolicy) { + list.Items = items + }, + ), + fake, } - return obj.(*v1.GCPGatewayPolicy), err } diff --git a/pkg/client/clientset/versioned/typed/networking/v1/fake/fake_gcpsessionaffinityfilter.go b/pkg/client/clientset/versioned/typed/networking/v1/fake/fake_gcpsessionaffinityfilter.go index 07e59e7..cc1a098 100644 --- a/pkg/client/clientset/versioned/typed/networking/v1/fake/fake_gcpsessionaffinityfilter.go +++ b/pkg/client/clientset/versioned/typed/networking/v1/fake/fake_gcpsessionaffinityfilter.go @@ -19,123 +19,34 @@ package fake import ( - "context" - v1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/clientset/versioned/typed/networking/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeGCPSessionAffinityFilters implements GCPSessionAffinityFilterInterface -type FakeGCPSessionAffinityFilters struct { +// fakeGCPSessionAffinityFilters implements GCPSessionAffinityFilterInterface +type fakeGCPSessionAffinityFilters struct { + *gentype.FakeClientWithList[*v1.GCPSessionAffinityFilter, *v1.GCPSessionAffinityFilterList] Fake *FakeNetworkingV1 - ns string -} - -var gcpsessionaffinityfiltersResource = v1.SchemeGroupVersion.WithResource("gcpsessionaffinityfilters") - -var gcpsessionaffinityfiltersKind = v1.SchemeGroupVersion.WithKind("GCPSessionAffinityFilter") - -// Get takes name of the gCPSessionAffinityFilter, and returns the corresponding gCPSessionAffinityFilter object, and an error if there is any. -func (c *FakeGCPSessionAffinityFilters) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GCPSessionAffinityFilter, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(gcpsessionaffinityfiltersResource, c.ns, name), &v1.GCPSessionAffinityFilter{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.GCPSessionAffinityFilter), err -} - -// List takes label and field selectors, and returns the list of GCPSessionAffinityFilters that match those selectors. -func (c *FakeGCPSessionAffinityFilters) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GCPSessionAffinityFilterList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(gcpsessionaffinityfiltersResource, gcpsessionaffinityfiltersKind, c.ns, opts), &v1.GCPSessionAffinityFilterList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.GCPSessionAffinityFilterList{ListMeta: obj.(*v1.GCPSessionAffinityFilterList).ListMeta} - for _, item := range obj.(*v1.GCPSessionAffinityFilterList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested gCPSessionAffinityFilters. -func (c *FakeGCPSessionAffinityFilters) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(gcpsessionaffinityfiltersResource, c.ns, opts)) - -} - -// Create takes the representation of a gCPSessionAffinityFilter and creates it. Returns the server's representation of the gCPSessionAffinityFilter, and an error, if there is any. -func (c *FakeGCPSessionAffinityFilters) Create(ctx context.Context, gCPSessionAffinityFilter *v1.GCPSessionAffinityFilter, opts metav1.CreateOptions) (result *v1.GCPSessionAffinityFilter, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(gcpsessionaffinityfiltersResource, c.ns, gCPSessionAffinityFilter), &v1.GCPSessionAffinityFilter{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.GCPSessionAffinityFilter), err -} - -// Update takes the representation of a gCPSessionAffinityFilter and updates it. Returns the server's representation of the gCPSessionAffinityFilter, and an error, if there is any. -func (c *FakeGCPSessionAffinityFilters) Update(ctx context.Context, gCPSessionAffinityFilter *v1.GCPSessionAffinityFilter, opts metav1.UpdateOptions) (result *v1.GCPSessionAffinityFilter, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(gcpsessionaffinityfiltersResource, c.ns, gCPSessionAffinityFilter), &v1.GCPSessionAffinityFilter{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.GCPSessionAffinityFilter), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeGCPSessionAffinityFilters) UpdateStatus(ctx context.Context, gCPSessionAffinityFilter *v1.GCPSessionAffinityFilter, opts metav1.UpdateOptions) (*v1.GCPSessionAffinityFilter, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(gcpsessionaffinityfiltersResource, "status", c.ns, gCPSessionAffinityFilter), &v1.GCPSessionAffinityFilter{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.GCPSessionAffinityFilter), err -} - -// Delete takes name of the gCPSessionAffinityFilter and deletes it. Returns an error if one occurs. -func (c *FakeGCPSessionAffinityFilters) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(gcpsessionaffinityfiltersResource, c.ns, name, opts), &v1.GCPSessionAffinityFilter{}) - - return err } -// DeleteCollection deletes a collection of objects. -func (c *FakeGCPSessionAffinityFilters) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(gcpsessionaffinityfiltersResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v1.GCPSessionAffinityFilterList{}) - return err -} - -// Patch applies the patch and returns the patched gCPSessionAffinityFilter. -func (c *FakeGCPSessionAffinityFilters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GCPSessionAffinityFilter, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(gcpsessionaffinityfiltersResource, c.ns, name, pt, data, subresources...), &v1.GCPSessionAffinityFilter{}) - - if obj == nil { - return nil, err +func newFakeGCPSessionAffinityFilters(fake *FakeNetworkingV1, namespace string) networkingv1.GCPSessionAffinityFilterInterface { + return &fakeGCPSessionAffinityFilters{ + gentype.NewFakeClientWithList[*v1.GCPSessionAffinityFilter, *v1.GCPSessionAffinityFilterList]( + fake.Fake, + namespace, + v1.SchemeGroupVersion.WithResource("gcpsessionaffinityfilters"), + v1.SchemeGroupVersion.WithKind("GCPSessionAffinityFilter"), + func() *v1.GCPSessionAffinityFilter { return &v1.GCPSessionAffinityFilter{} }, + func() *v1.GCPSessionAffinityFilterList { return &v1.GCPSessionAffinityFilterList{} }, + func(dst, src *v1.GCPSessionAffinityFilterList) { dst.ListMeta = src.ListMeta }, + func(list *v1.GCPSessionAffinityFilterList) []*v1.GCPSessionAffinityFilter { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1.GCPSessionAffinityFilterList, items []*v1.GCPSessionAffinityFilter) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1.GCPSessionAffinityFilter), err } diff --git a/pkg/client/clientset/versioned/typed/networking/v1/fake/fake_gcpsessionaffinitypolicy.go b/pkg/client/clientset/versioned/typed/networking/v1/fake/fake_gcpsessionaffinitypolicy.go index f6b9170..b9330b5 100644 --- a/pkg/client/clientset/versioned/typed/networking/v1/fake/fake_gcpsessionaffinitypolicy.go +++ b/pkg/client/clientset/versioned/typed/networking/v1/fake/fake_gcpsessionaffinitypolicy.go @@ -19,123 +19,34 @@ package fake import ( - "context" - v1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/clientset/versioned/typed/networking/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeGCPSessionAffinityPolicies implements GCPSessionAffinityPolicyInterface -type FakeGCPSessionAffinityPolicies struct { +// fakeGCPSessionAffinityPolicies implements GCPSessionAffinityPolicyInterface +type fakeGCPSessionAffinityPolicies struct { + *gentype.FakeClientWithList[*v1.GCPSessionAffinityPolicy, *v1.GCPSessionAffinityPolicyList] Fake *FakeNetworkingV1 - ns string -} - -var gcpsessionaffinitypoliciesResource = v1.SchemeGroupVersion.WithResource("gcpsessionaffinitypolicies") - -var gcpsessionaffinitypoliciesKind = v1.SchemeGroupVersion.WithKind("GCPSessionAffinityPolicy") - -// Get takes name of the gCPSessionAffinityPolicy, and returns the corresponding gCPSessionAffinityPolicy object, and an error if there is any. -func (c *FakeGCPSessionAffinityPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GCPSessionAffinityPolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(gcpsessionaffinitypoliciesResource, c.ns, name), &v1.GCPSessionAffinityPolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.GCPSessionAffinityPolicy), err -} - -// List takes label and field selectors, and returns the list of GCPSessionAffinityPolicies that match those selectors. -func (c *FakeGCPSessionAffinityPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GCPSessionAffinityPolicyList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(gcpsessionaffinitypoliciesResource, gcpsessionaffinitypoliciesKind, c.ns, opts), &v1.GCPSessionAffinityPolicyList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.GCPSessionAffinityPolicyList{ListMeta: obj.(*v1.GCPSessionAffinityPolicyList).ListMeta} - for _, item := range obj.(*v1.GCPSessionAffinityPolicyList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested gCPSessionAffinityPolicies. -func (c *FakeGCPSessionAffinityPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(gcpsessionaffinitypoliciesResource, c.ns, opts)) - -} - -// Create takes the representation of a gCPSessionAffinityPolicy and creates it. Returns the server's representation of the gCPSessionAffinityPolicy, and an error, if there is any. -func (c *FakeGCPSessionAffinityPolicies) Create(ctx context.Context, gCPSessionAffinityPolicy *v1.GCPSessionAffinityPolicy, opts metav1.CreateOptions) (result *v1.GCPSessionAffinityPolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(gcpsessionaffinitypoliciesResource, c.ns, gCPSessionAffinityPolicy), &v1.GCPSessionAffinityPolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.GCPSessionAffinityPolicy), err -} - -// Update takes the representation of a gCPSessionAffinityPolicy and updates it. Returns the server's representation of the gCPSessionAffinityPolicy, and an error, if there is any. -func (c *FakeGCPSessionAffinityPolicies) Update(ctx context.Context, gCPSessionAffinityPolicy *v1.GCPSessionAffinityPolicy, opts metav1.UpdateOptions) (result *v1.GCPSessionAffinityPolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(gcpsessionaffinitypoliciesResource, c.ns, gCPSessionAffinityPolicy), &v1.GCPSessionAffinityPolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.GCPSessionAffinityPolicy), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeGCPSessionAffinityPolicies) UpdateStatus(ctx context.Context, gCPSessionAffinityPolicy *v1.GCPSessionAffinityPolicy, opts metav1.UpdateOptions) (*v1.GCPSessionAffinityPolicy, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(gcpsessionaffinitypoliciesResource, "status", c.ns, gCPSessionAffinityPolicy), &v1.GCPSessionAffinityPolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.GCPSessionAffinityPolicy), err -} - -// Delete takes name of the gCPSessionAffinityPolicy and deletes it. Returns an error if one occurs. -func (c *FakeGCPSessionAffinityPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(gcpsessionaffinitypoliciesResource, c.ns, name, opts), &v1.GCPSessionAffinityPolicy{}) - - return err } -// DeleteCollection deletes a collection of objects. -func (c *FakeGCPSessionAffinityPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(gcpsessionaffinitypoliciesResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v1.GCPSessionAffinityPolicyList{}) - return err -} - -// Patch applies the patch and returns the patched gCPSessionAffinityPolicy. -func (c *FakeGCPSessionAffinityPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GCPSessionAffinityPolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(gcpsessionaffinitypoliciesResource, c.ns, name, pt, data, subresources...), &v1.GCPSessionAffinityPolicy{}) - - if obj == nil { - return nil, err +func newFakeGCPSessionAffinityPolicies(fake *FakeNetworkingV1, namespace string) networkingv1.GCPSessionAffinityPolicyInterface { + return &fakeGCPSessionAffinityPolicies{ + gentype.NewFakeClientWithList[*v1.GCPSessionAffinityPolicy, *v1.GCPSessionAffinityPolicyList]( + fake.Fake, + namespace, + v1.SchemeGroupVersion.WithResource("gcpsessionaffinitypolicies"), + v1.SchemeGroupVersion.WithKind("GCPSessionAffinityPolicy"), + func() *v1.GCPSessionAffinityPolicy { return &v1.GCPSessionAffinityPolicy{} }, + func() *v1.GCPSessionAffinityPolicyList { return &v1.GCPSessionAffinityPolicyList{} }, + func(dst, src *v1.GCPSessionAffinityPolicyList) { dst.ListMeta = src.ListMeta }, + func(list *v1.GCPSessionAffinityPolicyList) []*v1.GCPSessionAffinityPolicy { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1.GCPSessionAffinityPolicyList, items []*v1.GCPSessionAffinityPolicy) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1.GCPSessionAffinityPolicy), err } diff --git a/pkg/client/clientset/versioned/typed/networking/v1/fake/fake_healthcheckpolicy.go b/pkg/client/clientset/versioned/typed/networking/v1/fake/fake_healthcheckpolicy.go index 890525b..9fd90ca 100644 --- a/pkg/client/clientset/versioned/typed/networking/v1/fake/fake_healthcheckpolicy.go +++ b/pkg/client/clientset/versioned/typed/networking/v1/fake/fake_healthcheckpolicy.go @@ -19,123 +19,34 @@ package fake import ( - "context" - v1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/clientset/versioned/typed/networking/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeHealthCheckPolicies implements HealthCheckPolicyInterface -type FakeHealthCheckPolicies struct { +// fakeHealthCheckPolicies implements HealthCheckPolicyInterface +type fakeHealthCheckPolicies struct { + *gentype.FakeClientWithList[*v1.HealthCheckPolicy, *v1.HealthCheckPolicyList] Fake *FakeNetworkingV1 - ns string -} - -var healthcheckpoliciesResource = v1.SchemeGroupVersion.WithResource("healthcheckpolicies") - -var healthcheckpoliciesKind = v1.SchemeGroupVersion.WithKind("HealthCheckPolicy") - -// Get takes name of the healthCheckPolicy, and returns the corresponding healthCheckPolicy object, and an error if there is any. -func (c *FakeHealthCheckPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HealthCheckPolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(healthcheckpoliciesResource, c.ns, name), &v1.HealthCheckPolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.HealthCheckPolicy), err -} - -// List takes label and field selectors, and returns the list of HealthCheckPolicies that match those selectors. -func (c *FakeHealthCheckPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HealthCheckPolicyList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(healthcheckpoliciesResource, healthcheckpoliciesKind, c.ns, opts), &v1.HealthCheckPolicyList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.HealthCheckPolicyList{ListMeta: obj.(*v1.HealthCheckPolicyList).ListMeta} - for _, item := range obj.(*v1.HealthCheckPolicyList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested healthCheckPolicies. -func (c *FakeHealthCheckPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(healthcheckpoliciesResource, c.ns, opts)) - -} - -// Create takes the representation of a healthCheckPolicy and creates it. Returns the server's representation of the healthCheckPolicy, and an error, if there is any. -func (c *FakeHealthCheckPolicies) Create(ctx context.Context, healthCheckPolicy *v1.HealthCheckPolicy, opts metav1.CreateOptions) (result *v1.HealthCheckPolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(healthcheckpoliciesResource, c.ns, healthCheckPolicy), &v1.HealthCheckPolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.HealthCheckPolicy), err -} - -// Update takes the representation of a healthCheckPolicy and updates it. Returns the server's representation of the healthCheckPolicy, and an error, if there is any. -func (c *FakeHealthCheckPolicies) Update(ctx context.Context, healthCheckPolicy *v1.HealthCheckPolicy, opts metav1.UpdateOptions) (result *v1.HealthCheckPolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(healthcheckpoliciesResource, c.ns, healthCheckPolicy), &v1.HealthCheckPolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.HealthCheckPolicy), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeHealthCheckPolicies) UpdateStatus(ctx context.Context, healthCheckPolicy *v1.HealthCheckPolicy, opts metav1.UpdateOptions) (*v1.HealthCheckPolicy, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(healthcheckpoliciesResource, "status", c.ns, healthCheckPolicy), &v1.HealthCheckPolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1.HealthCheckPolicy), err -} - -// Delete takes name of the healthCheckPolicy and deletes it. Returns an error if one occurs. -func (c *FakeHealthCheckPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(healthcheckpoliciesResource, c.ns, name, opts), &v1.HealthCheckPolicy{}) - - return err } -// DeleteCollection deletes a collection of objects. -func (c *FakeHealthCheckPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(healthcheckpoliciesResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v1.HealthCheckPolicyList{}) - return err -} - -// Patch applies the patch and returns the patched healthCheckPolicy. -func (c *FakeHealthCheckPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HealthCheckPolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(healthcheckpoliciesResource, c.ns, name, pt, data, subresources...), &v1.HealthCheckPolicy{}) - - if obj == nil { - return nil, err +func newFakeHealthCheckPolicies(fake *FakeNetworkingV1, namespace string) networkingv1.HealthCheckPolicyInterface { + return &fakeHealthCheckPolicies{ + gentype.NewFakeClientWithList[*v1.HealthCheckPolicy, *v1.HealthCheckPolicyList]( + fake.Fake, + namespace, + v1.SchemeGroupVersion.WithResource("healthcheckpolicies"), + v1.SchemeGroupVersion.WithKind("HealthCheckPolicy"), + func() *v1.HealthCheckPolicy { return &v1.HealthCheckPolicy{} }, + func() *v1.HealthCheckPolicyList { return &v1.HealthCheckPolicyList{} }, + func(dst, src *v1.HealthCheckPolicyList) { dst.ListMeta = src.ListMeta }, + func(list *v1.HealthCheckPolicyList) []*v1.HealthCheckPolicy { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1.HealthCheckPolicyList, items []*v1.HealthCheckPolicy) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1.HealthCheckPolicy), err } diff --git a/pkg/client/clientset/versioned/typed/networking/v1/fake/fake_networking_client.go b/pkg/client/clientset/versioned/typed/networking/v1/fake/fake_networking_client.go index 8ab718a..32c22a2 100644 --- a/pkg/client/clientset/versioned/typed/networking/v1/fake/fake_networking_client.go +++ b/pkg/client/clientset/versioned/typed/networking/v1/fake/fake_networking_client.go @@ -29,23 +29,27 @@ type FakeNetworkingV1 struct { } func (c *FakeNetworkingV1) GCPBackendPolicies(namespace string) v1.GCPBackendPolicyInterface { - return &FakeGCPBackendPolicies{c, namespace} + return newFakeGCPBackendPolicies(c, namespace) } func (c *FakeNetworkingV1) GCPGatewayPolicies(namespace string) v1.GCPGatewayPolicyInterface { - return &FakeGCPGatewayPolicies{c, namespace} + return newFakeGCPGatewayPolicies(c, namespace) } func (c *FakeNetworkingV1) GCPSessionAffinityFilters(namespace string) v1.GCPSessionAffinityFilterInterface { - return &FakeGCPSessionAffinityFilters{c, namespace} + return newFakeGCPSessionAffinityFilters(c, namespace) } func (c *FakeNetworkingV1) GCPSessionAffinityPolicies(namespace string) v1.GCPSessionAffinityPolicyInterface { - return &FakeGCPSessionAffinityPolicies{c, namespace} + return newFakeGCPSessionAffinityPolicies(c, namespace) +} + +func (c *FakeNetworkingV1) GCPTrafficDistributionPolicies(namespace string) v1.GCPTrafficDistributionPolicyInterface { + return newFakeGCPTrafficDistributionPolicies(c, namespace) } func (c *FakeNetworkingV1) HealthCheckPolicies(namespace string) v1.HealthCheckPolicyInterface { - return &FakeHealthCheckPolicies{c, namespace} + return newFakeHealthCheckPolicies(c, namespace) } // RESTClient returns a RESTClient that is used to communicate diff --git a/pkg/client/clientset/versioned/typed/networking/v1/gcpbackendpolicy.go b/pkg/client/clientset/versioned/typed/networking/v1/gcpbackendpolicy.go index 7c78b52..a42b3d4 100644 --- a/pkg/client/clientset/versioned/typed/networking/v1/gcpbackendpolicy.go +++ b/pkg/client/clientset/versioned/typed/networking/v1/gcpbackendpolicy.go @@ -19,15 +19,14 @@ package v1 import ( - "context" - "time" + context "context" - v1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" + networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" scheme "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // GCPBackendPoliciesGetter has a method to return a GCPBackendPolicyInterface. @@ -38,158 +37,34 @@ type GCPBackendPoliciesGetter interface { // GCPBackendPolicyInterface has methods to work with GCPBackendPolicy resources. type GCPBackendPolicyInterface interface { - Create(ctx context.Context, gCPBackendPolicy *v1.GCPBackendPolicy, opts metav1.CreateOptions) (*v1.GCPBackendPolicy, error) - Update(ctx context.Context, gCPBackendPolicy *v1.GCPBackendPolicy, opts metav1.UpdateOptions) (*v1.GCPBackendPolicy, error) - UpdateStatus(ctx context.Context, gCPBackendPolicy *v1.GCPBackendPolicy, opts metav1.UpdateOptions) (*v1.GCPBackendPolicy, error) + Create(ctx context.Context, gCPBackendPolicy *networkingv1.GCPBackendPolicy, opts metav1.CreateOptions) (*networkingv1.GCPBackendPolicy, error) + Update(ctx context.Context, gCPBackendPolicy *networkingv1.GCPBackendPolicy, opts metav1.UpdateOptions) (*networkingv1.GCPBackendPolicy, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, gCPBackendPolicy *networkingv1.GCPBackendPolicy, opts metav1.UpdateOptions) (*networkingv1.GCPBackendPolicy, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GCPBackendPolicy, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.GCPBackendPolicyList, error) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*networkingv1.GCPBackendPolicy, error) + List(ctx context.Context, opts metav1.ListOptions) (*networkingv1.GCPBackendPolicyList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GCPBackendPolicy, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *networkingv1.GCPBackendPolicy, err error) GCPBackendPolicyExpansion } // gCPBackendPolicies implements GCPBackendPolicyInterface type gCPBackendPolicies struct { - client rest.Interface - ns string + *gentype.ClientWithList[*networkingv1.GCPBackendPolicy, *networkingv1.GCPBackendPolicyList] } // newGCPBackendPolicies returns a GCPBackendPolicies func newGCPBackendPolicies(c *NetworkingV1Client, namespace string) *gCPBackendPolicies { return &gCPBackendPolicies{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*networkingv1.GCPBackendPolicy, *networkingv1.GCPBackendPolicyList]( + "gcpbackendpolicies", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *networkingv1.GCPBackendPolicy { return &networkingv1.GCPBackendPolicy{} }, + func() *networkingv1.GCPBackendPolicyList { return &networkingv1.GCPBackendPolicyList{} }, + ), } } - -// Get takes name of the gCPBackendPolicy, and returns the corresponding gCPBackendPolicy object, and an error if there is any. -func (c *gCPBackendPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GCPBackendPolicy, err error) { - result = &v1.GCPBackendPolicy{} - err = c.client.Get(). - Namespace(c.ns). - Resource("gcpbackendpolicies"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of GCPBackendPolicies that match those selectors. -func (c *gCPBackendPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GCPBackendPolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.GCPBackendPolicyList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("gcpbackendpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested gCPBackendPolicies. -func (c *gCPBackendPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("gcpbackendpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a gCPBackendPolicy and creates it. Returns the server's representation of the gCPBackendPolicy, and an error, if there is any. -func (c *gCPBackendPolicies) Create(ctx context.Context, gCPBackendPolicy *v1.GCPBackendPolicy, opts metav1.CreateOptions) (result *v1.GCPBackendPolicy, err error) { - result = &v1.GCPBackendPolicy{} - err = c.client.Post(). - Namespace(c.ns). - Resource("gcpbackendpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gCPBackendPolicy). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a gCPBackendPolicy and updates it. Returns the server's representation of the gCPBackendPolicy, and an error, if there is any. -func (c *gCPBackendPolicies) Update(ctx context.Context, gCPBackendPolicy *v1.GCPBackendPolicy, opts metav1.UpdateOptions) (result *v1.GCPBackendPolicy, err error) { - result = &v1.GCPBackendPolicy{} - err = c.client.Put(). - Namespace(c.ns). - Resource("gcpbackendpolicies"). - Name(gCPBackendPolicy.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gCPBackendPolicy). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *gCPBackendPolicies) UpdateStatus(ctx context.Context, gCPBackendPolicy *v1.GCPBackendPolicy, opts metav1.UpdateOptions) (result *v1.GCPBackendPolicy, err error) { - result = &v1.GCPBackendPolicy{} - err = c.client.Put(). - Namespace(c.ns). - Resource("gcpbackendpolicies"). - Name(gCPBackendPolicy.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gCPBackendPolicy). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the gCPBackendPolicy and deletes it. Returns an error if one occurs. -func (c *gCPBackendPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("gcpbackendpolicies"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *gCPBackendPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("gcpbackendpolicies"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched gCPBackendPolicy. -func (c *gCPBackendPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GCPBackendPolicy, err error) { - result = &v1.GCPBackendPolicy{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("gcpbackendpolicies"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/networking/v1/gcpgatewaypolicy.go b/pkg/client/clientset/versioned/typed/networking/v1/gcpgatewaypolicy.go index 6f07220..820dba2 100644 --- a/pkg/client/clientset/versioned/typed/networking/v1/gcpgatewaypolicy.go +++ b/pkg/client/clientset/versioned/typed/networking/v1/gcpgatewaypolicy.go @@ -19,15 +19,14 @@ package v1 import ( - "context" - "time" + context "context" - v1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" + networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" scheme "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // GCPGatewayPoliciesGetter has a method to return a GCPGatewayPolicyInterface. @@ -38,158 +37,34 @@ type GCPGatewayPoliciesGetter interface { // GCPGatewayPolicyInterface has methods to work with GCPGatewayPolicy resources. type GCPGatewayPolicyInterface interface { - Create(ctx context.Context, gCPGatewayPolicy *v1.GCPGatewayPolicy, opts metav1.CreateOptions) (*v1.GCPGatewayPolicy, error) - Update(ctx context.Context, gCPGatewayPolicy *v1.GCPGatewayPolicy, opts metav1.UpdateOptions) (*v1.GCPGatewayPolicy, error) - UpdateStatus(ctx context.Context, gCPGatewayPolicy *v1.GCPGatewayPolicy, opts metav1.UpdateOptions) (*v1.GCPGatewayPolicy, error) + Create(ctx context.Context, gCPGatewayPolicy *networkingv1.GCPGatewayPolicy, opts metav1.CreateOptions) (*networkingv1.GCPGatewayPolicy, error) + Update(ctx context.Context, gCPGatewayPolicy *networkingv1.GCPGatewayPolicy, opts metav1.UpdateOptions) (*networkingv1.GCPGatewayPolicy, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, gCPGatewayPolicy *networkingv1.GCPGatewayPolicy, opts metav1.UpdateOptions) (*networkingv1.GCPGatewayPolicy, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GCPGatewayPolicy, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.GCPGatewayPolicyList, error) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*networkingv1.GCPGatewayPolicy, error) + List(ctx context.Context, opts metav1.ListOptions) (*networkingv1.GCPGatewayPolicyList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GCPGatewayPolicy, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *networkingv1.GCPGatewayPolicy, err error) GCPGatewayPolicyExpansion } // gCPGatewayPolicies implements GCPGatewayPolicyInterface type gCPGatewayPolicies struct { - client rest.Interface - ns string + *gentype.ClientWithList[*networkingv1.GCPGatewayPolicy, *networkingv1.GCPGatewayPolicyList] } // newGCPGatewayPolicies returns a GCPGatewayPolicies func newGCPGatewayPolicies(c *NetworkingV1Client, namespace string) *gCPGatewayPolicies { return &gCPGatewayPolicies{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*networkingv1.GCPGatewayPolicy, *networkingv1.GCPGatewayPolicyList]( + "gcpgatewaypolicies", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *networkingv1.GCPGatewayPolicy { return &networkingv1.GCPGatewayPolicy{} }, + func() *networkingv1.GCPGatewayPolicyList { return &networkingv1.GCPGatewayPolicyList{} }, + ), } } - -// Get takes name of the gCPGatewayPolicy, and returns the corresponding gCPGatewayPolicy object, and an error if there is any. -func (c *gCPGatewayPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GCPGatewayPolicy, err error) { - result = &v1.GCPGatewayPolicy{} - err = c.client.Get(). - Namespace(c.ns). - Resource("gcpgatewaypolicies"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of GCPGatewayPolicies that match those selectors. -func (c *gCPGatewayPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GCPGatewayPolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.GCPGatewayPolicyList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("gcpgatewaypolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested gCPGatewayPolicies. -func (c *gCPGatewayPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("gcpgatewaypolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a gCPGatewayPolicy and creates it. Returns the server's representation of the gCPGatewayPolicy, and an error, if there is any. -func (c *gCPGatewayPolicies) Create(ctx context.Context, gCPGatewayPolicy *v1.GCPGatewayPolicy, opts metav1.CreateOptions) (result *v1.GCPGatewayPolicy, err error) { - result = &v1.GCPGatewayPolicy{} - err = c.client.Post(). - Namespace(c.ns). - Resource("gcpgatewaypolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gCPGatewayPolicy). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a gCPGatewayPolicy and updates it. Returns the server's representation of the gCPGatewayPolicy, and an error, if there is any. -func (c *gCPGatewayPolicies) Update(ctx context.Context, gCPGatewayPolicy *v1.GCPGatewayPolicy, opts metav1.UpdateOptions) (result *v1.GCPGatewayPolicy, err error) { - result = &v1.GCPGatewayPolicy{} - err = c.client.Put(). - Namespace(c.ns). - Resource("gcpgatewaypolicies"). - Name(gCPGatewayPolicy.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gCPGatewayPolicy). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *gCPGatewayPolicies) UpdateStatus(ctx context.Context, gCPGatewayPolicy *v1.GCPGatewayPolicy, opts metav1.UpdateOptions) (result *v1.GCPGatewayPolicy, err error) { - result = &v1.GCPGatewayPolicy{} - err = c.client.Put(). - Namespace(c.ns). - Resource("gcpgatewaypolicies"). - Name(gCPGatewayPolicy.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gCPGatewayPolicy). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the gCPGatewayPolicy and deletes it. Returns an error if one occurs. -func (c *gCPGatewayPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("gcpgatewaypolicies"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *gCPGatewayPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("gcpgatewaypolicies"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched gCPGatewayPolicy. -func (c *gCPGatewayPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GCPGatewayPolicy, err error) { - result = &v1.GCPGatewayPolicy{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("gcpgatewaypolicies"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/networking/v1/gcpsessionaffinityfilter.go b/pkg/client/clientset/versioned/typed/networking/v1/gcpsessionaffinityfilter.go index f1aff86..78b4893 100644 --- a/pkg/client/clientset/versioned/typed/networking/v1/gcpsessionaffinityfilter.go +++ b/pkg/client/clientset/versioned/typed/networking/v1/gcpsessionaffinityfilter.go @@ -19,15 +19,14 @@ package v1 import ( - "context" - "time" + context "context" - v1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" + networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" scheme "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // GCPSessionAffinityFiltersGetter has a method to return a GCPSessionAffinityFilterInterface. @@ -38,158 +37,34 @@ type GCPSessionAffinityFiltersGetter interface { // GCPSessionAffinityFilterInterface has methods to work with GCPSessionAffinityFilter resources. type GCPSessionAffinityFilterInterface interface { - Create(ctx context.Context, gCPSessionAffinityFilter *v1.GCPSessionAffinityFilter, opts metav1.CreateOptions) (*v1.GCPSessionAffinityFilter, error) - Update(ctx context.Context, gCPSessionAffinityFilter *v1.GCPSessionAffinityFilter, opts metav1.UpdateOptions) (*v1.GCPSessionAffinityFilter, error) - UpdateStatus(ctx context.Context, gCPSessionAffinityFilter *v1.GCPSessionAffinityFilter, opts metav1.UpdateOptions) (*v1.GCPSessionAffinityFilter, error) + Create(ctx context.Context, gCPSessionAffinityFilter *networkingv1.GCPSessionAffinityFilter, opts metav1.CreateOptions) (*networkingv1.GCPSessionAffinityFilter, error) + Update(ctx context.Context, gCPSessionAffinityFilter *networkingv1.GCPSessionAffinityFilter, opts metav1.UpdateOptions) (*networkingv1.GCPSessionAffinityFilter, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, gCPSessionAffinityFilter *networkingv1.GCPSessionAffinityFilter, opts metav1.UpdateOptions) (*networkingv1.GCPSessionAffinityFilter, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GCPSessionAffinityFilter, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.GCPSessionAffinityFilterList, error) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*networkingv1.GCPSessionAffinityFilter, error) + List(ctx context.Context, opts metav1.ListOptions) (*networkingv1.GCPSessionAffinityFilterList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GCPSessionAffinityFilter, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *networkingv1.GCPSessionAffinityFilter, err error) GCPSessionAffinityFilterExpansion } // gCPSessionAffinityFilters implements GCPSessionAffinityFilterInterface type gCPSessionAffinityFilters struct { - client rest.Interface - ns string + *gentype.ClientWithList[*networkingv1.GCPSessionAffinityFilter, *networkingv1.GCPSessionAffinityFilterList] } // newGCPSessionAffinityFilters returns a GCPSessionAffinityFilters func newGCPSessionAffinityFilters(c *NetworkingV1Client, namespace string) *gCPSessionAffinityFilters { return &gCPSessionAffinityFilters{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*networkingv1.GCPSessionAffinityFilter, *networkingv1.GCPSessionAffinityFilterList]( + "gcpsessionaffinityfilters", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *networkingv1.GCPSessionAffinityFilter { return &networkingv1.GCPSessionAffinityFilter{} }, + func() *networkingv1.GCPSessionAffinityFilterList { return &networkingv1.GCPSessionAffinityFilterList{} }, + ), } } - -// Get takes name of the gCPSessionAffinityFilter, and returns the corresponding gCPSessionAffinityFilter object, and an error if there is any. -func (c *gCPSessionAffinityFilters) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GCPSessionAffinityFilter, err error) { - result = &v1.GCPSessionAffinityFilter{} - err = c.client.Get(). - Namespace(c.ns). - Resource("gcpsessionaffinityfilters"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of GCPSessionAffinityFilters that match those selectors. -func (c *gCPSessionAffinityFilters) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GCPSessionAffinityFilterList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.GCPSessionAffinityFilterList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("gcpsessionaffinityfilters"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested gCPSessionAffinityFilters. -func (c *gCPSessionAffinityFilters) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("gcpsessionaffinityfilters"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a gCPSessionAffinityFilter and creates it. Returns the server's representation of the gCPSessionAffinityFilter, and an error, if there is any. -func (c *gCPSessionAffinityFilters) Create(ctx context.Context, gCPSessionAffinityFilter *v1.GCPSessionAffinityFilter, opts metav1.CreateOptions) (result *v1.GCPSessionAffinityFilter, err error) { - result = &v1.GCPSessionAffinityFilter{} - err = c.client.Post(). - Namespace(c.ns). - Resource("gcpsessionaffinityfilters"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gCPSessionAffinityFilter). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a gCPSessionAffinityFilter and updates it. Returns the server's representation of the gCPSessionAffinityFilter, and an error, if there is any. -func (c *gCPSessionAffinityFilters) Update(ctx context.Context, gCPSessionAffinityFilter *v1.GCPSessionAffinityFilter, opts metav1.UpdateOptions) (result *v1.GCPSessionAffinityFilter, err error) { - result = &v1.GCPSessionAffinityFilter{} - err = c.client.Put(). - Namespace(c.ns). - Resource("gcpsessionaffinityfilters"). - Name(gCPSessionAffinityFilter.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gCPSessionAffinityFilter). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *gCPSessionAffinityFilters) UpdateStatus(ctx context.Context, gCPSessionAffinityFilter *v1.GCPSessionAffinityFilter, opts metav1.UpdateOptions) (result *v1.GCPSessionAffinityFilter, err error) { - result = &v1.GCPSessionAffinityFilter{} - err = c.client.Put(). - Namespace(c.ns). - Resource("gcpsessionaffinityfilters"). - Name(gCPSessionAffinityFilter.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gCPSessionAffinityFilter). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the gCPSessionAffinityFilter and deletes it. Returns an error if one occurs. -func (c *gCPSessionAffinityFilters) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("gcpsessionaffinityfilters"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *gCPSessionAffinityFilters) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("gcpsessionaffinityfilters"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched gCPSessionAffinityFilter. -func (c *gCPSessionAffinityFilters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GCPSessionAffinityFilter, err error) { - result = &v1.GCPSessionAffinityFilter{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("gcpsessionaffinityfilters"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/networking/v1/gcpsessionaffinitypolicy.go b/pkg/client/clientset/versioned/typed/networking/v1/gcpsessionaffinitypolicy.go index ad9ed36..008f212 100644 --- a/pkg/client/clientset/versioned/typed/networking/v1/gcpsessionaffinitypolicy.go +++ b/pkg/client/clientset/versioned/typed/networking/v1/gcpsessionaffinitypolicy.go @@ -19,15 +19,14 @@ package v1 import ( - "context" - "time" + context "context" - v1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" + networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" scheme "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // GCPSessionAffinityPoliciesGetter has a method to return a GCPSessionAffinityPolicyInterface. @@ -38,158 +37,34 @@ type GCPSessionAffinityPoliciesGetter interface { // GCPSessionAffinityPolicyInterface has methods to work with GCPSessionAffinityPolicy resources. type GCPSessionAffinityPolicyInterface interface { - Create(ctx context.Context, gCPSessionAffinityPolicy *v1.GCPSessionAffinityPolicy, opts metav1.CreateOptions) (*v1.GCPSessionAffinityPolicy, error) - Update(ctx context.Context, gCPSessionAffinityPolicy *v1.GCPSessionAffinityPolicy, opts metav1.UpdateOptions) (*v1.GCPSessionAffinityPolicy, error) - UpdateStatus(ctx context.Context, gCPSessionAffinityPolicy *v1.GCPSessionAffinityPolicy, opts metav1.UpdateOptions) (*v1.GCPSessionAffinityPolicy, error) + Create(ctx context.Context, gCPSessionAffinityPolicy *networkingv1.GCPSessionAffinityPolicy, opts metav1.CreateOptions) (*networkingv1.GCPSessionAffinityPolicy, error) + Update(ctx context.Context, gCPSessionAffinityPolicy *networkingv1.GCPSessionAffinityPolicy, opts metav1.UpdateOptions) (*networkingv1.GCPSessionAffinityPolicy, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, gCPSessionAffinityPolicy *networkingv1.GCPSessionAffinityPolicy, opts metav1.UpdateOptions) (*networkingv1.GCPSessionAffinityPolicy, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GCPSessionAffinityPolicy, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.GCPSessionAffinityPolicyList, error) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*networkingv1.GCPSessionAffinityPolicy, error) + List(ctx context.Context, opts metav1.ListOptions) (*networkingv1.GCPSessionAffinityPolicyList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GCPSessionAffinityPolicy, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *networkingv1.GCPSessionAffinityPolicy, err error) GCPSessionAffinityPolicyExpansion } // gCPSessionAffinityPolicies implements GCPSessionAffinityPolicyInterface type gCPSessionAffinityPolicies struct { - client rest.Interface - ns string + *gentype.ClientWithList[*networkingv1.GCPSessionAffinityPolicy, *networkingv1.GCPSessionAffinityPolicyList] } // newGCPSessionAffinityPolicies returns a GCPSessionAffinityPolicies func newGCPSessionAffinityPolicies(c *NetworkingV1Client, namespace string) *gCPSessionAffinityPolicies { return &gCPSessionAffinityPolicies{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*networkingv1.GCPSessionAffinityPolicy, *networkingv1.GCPSessionAffinityPolicyList]( + "gcpsessionaffinitypolicies", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *networkingv1.GCPSessionAffinityPolicy { return &networkingv1.GCPSessionAffinityPolicy{} }, + func() *networkingv1.GCPSessionAffinityPolicyList { return &networkingv1.GCPSessionAffinityPolicyList{} }, + ), } } - -// Get takes name of the gCPSessionAffinityPolicy, and returns the corresponding gCPSessionAffinityPolicy object, and an error if there is any. -func (c *gCPSessionAffinityPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GCPSessionAffinityPolicy, err error) { - result = &v1.GCPSessionAffinityPolicy{} - err = c.client.Get(). - Namespace(c.ns). - Resource("gcpsessionaffinitypolicies"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of GCPSessionAffinityPolicies that match those selectors. -func (c *gCPSessionAffinityPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GCPSessionAffinityPolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.GCPSessionAffinityPolicyList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("gcpsessionaffinitypolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested gCPSessionAffinityPolicies. -func (c *gCPSessionAffinityPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("gcpsessionaffinitypolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a gCPSessionAffinityPolicy and creates it. Returns the server's representation of the gCPSessionAffinityPolicy, and an error, if there is any. -func (c *gCPSessionAffinityPolicies) Create(ctx context.Context, gCPSessionAffinityPolicy *v1.GCPSessionAffinityPolicy, opts metav1.CreateOptions) (result *v1.GCPSessionAffinityPolicy, err error) { - result = &v1.GCPSessionAffinityPolicy{} - err = c.client.Post(). - Namespace(c.ns). - Resource("gcpsessionaffinitypolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gCPSessionAffinityPolicy). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a gCPSessionAffinityPolicy and updates it. Returns the server's representation of the gCPSessionAffinityPolicy, and an error, if there is any. -func (c *gCPSessionAffinityPolicies) Update(ctx context.Context, gCPSessionAffinityPolicy *v1.GCPSessionAffinityPolicy, opts metav1.UpdateOptions) (result *v1.GCPSessionAffinityPolicy, err error) { - result = &v1.GCPSessionAffinityPolicy{} - err = c.client.Put(). - Namespace(c.ns). - Resource("gcpsessionaffinitypolicies"). - Name(gCPSessionAffinityPolicy.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gCPSessionAffinityPolicy). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *gCPSessionAffinityPolicies) UpdateStatus(ctx context.Context, gCPSessionAffinityPolicy *v1.GCPSessionAffinityPolicy, opts metav1.UpdateOptions) (result *v1.GCPSessionAffinityPolicy, err error) { - result = &v1.GCPSessionAffinityPolicy{} - err = c.client.Put(). - Namespace(c.ns). - Resource("gcpsessionaffinitypolicies"). - Name(gCPSessionAffinityPolicy.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(gCPSessionAffinityPolicy). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the gCPSessionAffinityPolicy and deletes it. Returns an error if one occurs. -func (c *gCPSessionAffinityPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("gcpsessionaffinitypolicies"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *gCPSessionAffinityPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("gcpsessionaffinitypolicies"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched gCPSessionAffinityPolicy. -func (c *gCPSessionAffinityPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GCPSessionAffinityPolicy, err error) { - result = &v1.GCPSessionAffinityPolicy{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("gcpsessionaffinitypolicies"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/networking/v1/generated_expansion.go b/pkg/client/clientset/versioned/typed/networking/v1/generated_expansion.go index cc24684..6900987 100644 --- a/pkg/client/clientset/versioned/typed/networking/v1/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/networking/v1/generated_expansion.go @@ -26,4 +26,6 @@ type GCPSessionAffinityFilterExpansion interface{} type GCPSessionAffinityPolicyExpansion interface{} +type GCPTrafficDistributionPolicyExpansion interface{} + type HealthCheckPolicyExpansion interface{} diff --git a/pkg/client/clientset/versioned/typed/networking/v1/healthcheckpolicy.go b/pkg/client/clientset/versioned/typed/networking/v1/healthcheckpolicy.go index f5f2d38..30616a4 100644 --- a/pkg/client/clientset/versioned/typed/networking/v1/healthcheckpolicy.go +++ b/pkg/client/clientset/versioned/typed/networking/v1/healthcheckpolicy.go @@ -19,15 +19,14 @@ package v1 import ( - "context" - "time" + context "context" - v1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" + networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" scheme "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" + gentype "k8s.io/client-go/gentype" ) // HealthCheckPoliciesGetter has a method to return a HealthCheckPolicyInterface. @@ -38,158 +37,34 @@ type HealthCheckPoliciesGetter interface { // HealthCheckPolicyInterface has methods to work with HealthCheckPolicy resources. type HealthCheckPolicyInterface interface { - Create(ctx context.Context, healthCheckPolicy *v1.HealthCheckPolicy, opts metav1.CreateOptions) (*v1.HealthCheckPolicy, error) - Update(ctx context.Context, healthCheckPolicy *v1.HealthCheckPolicy, opts metav1.UpdateOptions) (*v1.HealthCheckPolicy, error) - UpdateStatus(ctx context.Context, healthCheckPolicy *v1.HealthCheckPolicy, opts metav1.UpdateOptions) (*v1.HealthCheckPolicy, error) + Create(ctx context.Context, healthCheckPolicy *networkingv1.HealthCheckPolicy, opts metav1.CreateOptions) (*networkingv1.HealthCheckPolicy, error) + Update(ctx context.Context, healthCheckPolicy *networkingv1.HealthCheckPolicy, opts metav1.UpdateOptions) (*networkingv1.HealthCheckPolicy, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, healthCheckPolicy *networkingv1.HealthCheckPolicy, opts metav1.UpdateOptions) (*networkingv1.HealthCheckPolicy, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.HealthCheckPolicy, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.HealthCheckPolicyList, error) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*networkingv1.HealthCheckPolicy, error) + List(ctx context.Context, opts metav1.ListOptions) (*networkingv1.HealthCheckPolicyList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HealthCheckPolicy, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *networkingv1.HealthCheckPolicy, err error) HealthCheckPolicyExpansion } // healthCheckPolicies implements HealthCheckPolicyInterface type healthCheckPolicies struct { - client rest.Interface - ns string + *gentype.ClientWithList[*networkingv1.HealthCheckPolicy, *networkingv1.HealthCheckPolicyList] } // newHealthCheckPolicies returns a HealthCheckPolicies func newHealthCheckPolicies(c *NetworkingV1Client, namespace string) *healthCheckPolicies { return &healthCheckPolicies{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithList[*networkingv1.HealthCheckPolicy, *networkingv1.HealthCheckPolicyList]( + "healthcheckpolicies", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *networkingv1.HealthCheckPolicy { return &networkingv1.HealthCheckPolicy{} }, + func() *networkingv1.HealthCheckPolicyList { return &networkingv1.HealthCheckPolicyList{} }, + ), } } - -// Get takes name of the healthCheckPolicy, and returns the corresponding healthCheckPolicy object, and an error if there is any. -func (c *healthCheckPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HealthCheckPolicy, err error) { - result = &v1.HealthCheckPolicy{} - err = c.client.Get(). - Namespace(c.ns). - Resource("healthcheckpolicies"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of HealthCheckPolicies that match those selectors. -func (c *healthCheckPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HealthCheckPolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.HealthCheckPolicyList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("healthcheckpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested healthCheckPolicies. -func (c *healthCheckPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("healthcheckpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a healthCheckPolicy and creates it. Returns the server's representation of the healthCheckPolicy, and an error, if there is any. -func (c *healthCheckPolicies) Create(ctx context.Context, healthCheckPolicy *v1.HealthCheckPolicy, opts metav1.CreateOptions) (result *v1.HealthCheckPolicy, err error) { - result = &v1.HealthCheckPolicy{} - err = c.client.Post(). - Namespace(c.ns). - Resource("healthcheckpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(healthCheckPolicy). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a healthCheckPolicy and updates it. Returns the server's representation of the healthCheckPolicy, and an error, if there is any. -func (c *healthCheckPolicies) Update(ctx context.Context, healthCheckPolicy *v1.HealthCheckPolicy, opts metav1.UpdateOptions) (result *v1.HealthCheckPolicy, err error) { - result = &v1.HealthCheckPolicy{} - err = c.client.Put(). - Namespace(c.ns). - Resource("healthcheckpolicies"). - Name(healthCheckPolicy.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(healthCheckPolicy). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *healthCheckPolicies) UpdateStatus(ctx context.Context, healthCheckPolicy *v1.HealthCheckPolicy, opts metav1.UpdateOptions) (result *v1.HealthCheckPolicy, err error) { - result = &v1.HealthCheckPolicy{} - err = c.client.Put(). - Namespace(c.ns). - Resource("healthcheckpolicies"). - Name(healthCheckPolicy.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(healthCheckPolicy). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the healthCheckPolicy and deletes it. Returns an error if one occurs. -func (c *healthCheckPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("healthcheckpolicies"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *healthCheckPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("healthcheckpolicies"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched healthCheckPolicy. -func (c *healthCheckPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HealthCheckPolicy, err error) { - result = &v1.HealthCheckPolicy{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("healthcheckpolicies"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/networking/v1/networking_client.go b/pkg/client/clientset/versioned/typed/networking/v1/networking_client.go index dde4532..ed86707 100644 --- a/pkg/client/clientset/versioned/typed/networking/v1/networking_client.go +++ b/pkg/client/clientset/versioned/typed/networking/v1/networking_client.go @@ -19,10 +19,10 @@ package v1 import ( - "net/http" + http "net/http" - v1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" - "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/clientset/versioned/scheme" + networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" + scheme "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) @@ -32,6 +32,7 @@ type NetworkingV1Interface interface { GCPGatewayPoliciesGetter GCPSessionAffinityFiltersGetter GCPSessionAffinityPoliciesGetter + GCPTrafficDistributionPoliciesGetter HealthCheckPoliciesGetter } @@ -56,6 +57,10 @@ func (c *NetworkingV1Client) GCPSessionAffinityPolicies(namespace string) GCPSes return newGCPSessionAffinityPolicies(c, namespace) } +func (c *NetworkingV1Client) GCPTrafficDistributionPolicies(namespace string) GCPTrafficDistributionPolicyInterface { + return newGCPTrafficDistributionPolicies(c, namespace) +} + func (c *NetworkingV1Client) HealthCheckPolicies(namespace string) HealthCheckPolicyInterface { return newHealthCheckPolicies(c, namespace) } @@ -65,9 +70,7 @@ func (c *NetworkingV1Client) HealthCheckPolicies(namespace string) HealthCheckPo // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*NetworkingV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -79,9 +82,7 @@ func NewForConfig(c *rest.Config) (*NetworkingV1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NetworkingV1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -104,17 +105,15 @@ func New(c rest.Interface) *NetworkingV1Client { return &NetworkingV1Client{c} } -func setConfigDefaults(config *rest.Config) error { - gv := v1.SchemeGroupVersion +func setConfigDefaults(config *rest.Config) { + gv := networkingv1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + 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 diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index f8ecbba..2dff9b2 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -228,6 +228,7 @@ type SharedInformerFactory interface { // 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 diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index 19252ac..9242288 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -19,7 +19,7 @@ package externalversions import ( - "fmt" + fmt "fmt" v1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -61,6 +61,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1().GCPSessionAffinityFilters().Informer()}, nil case v1.SchemeGroupVersion.WithResource("gcpsessionaffinitypolicies"): return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1().GCPSessionAffinityPolicies().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("gcptrafficdistributionpolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1().GCPTrafficDistributionPolicies().Informer()}, nil case v1.SchemeGroupVersion.WithResource("healthcheckpolicies"): return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1().HealthCheckPolicies().Informer()}, nil diff --git a/pkg/client/informers/externalversions/networking/v1/gcpbackendpolicy.go b/pkg/client/informers/externalversions/networking/v1/gcpbackendpolicy.go index 43b80b0..05b811a 100644 --- a/pkg/client/informers/externalversions/networking/v1/gcpbackendpolicy.go +++ b/pkg/client/informers/externalversions/networking/v1/gcpbackendpolicy.go @@ -19,13 +19,13 @@ package v1 import ( - "context" + context "context" time "time" - networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" + apisnetworkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" versioned "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/clientset/versioned" internalinterfaces "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/listers/networking/v1" + networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/listers/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -36,7 +36,7 @@ import ( // GCPBackendPolicies. type GCPBackendPolicyInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.GCPBackendPolicyLister + Lister() networkingv1.GCPBackendPolicyLister } type gCPBackendPolicyInformer struct { @@ -62,16 +62,28 @@ func NewFilteredGCPBackendPolicyInformer(client versioned.Interface, namespace s if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1().GCPBackendPolicies(namespace).List(context.TODO(), options) + return client.NetworkingV1().GCPBackendPolicies(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1().GCPBackendPolicies(namespace).Watch(context.TODO(), options) + return client.NetworkingV1().GCPBackendPolicies(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().GCPBackendPolicies(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().GCPBackendPolicies(namespace).Watch(ctx, options) }, }, - &networkingv1.GCPBackendPolicy{}, + &apisnetworkingv1.GCPBackendPolicy{}, resyncPeriod, indexers, ) @@ -82,9 +94,9 @@ func (f *gCPBackendPolicyInformer) defaultInformer(client versioned.Interface, r } func (f *gCPBackendPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&networkingv1.GCPBackendPolicy{}, f.defaultInformer) + return f.factory.InformerFor(&apisnetworkingv1.GCPBackendPolicy{}, f.defaultInformer) } -func (f *gCPBackendPolicyInformer) Lister() v1.GCPBackendPolicyLister { - return v1.NewGCPBackendPolicyLister(f.Informer().GetIndexer()) +func (f *gCPBackendPolicyInformer) Lister() networkingv1.GCPBackendPolicyLister { + return networkingv1.NewGCPBackendPolicyLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/networking/v1/gcpgatewaypolicy.go b/pkg/client/informers/externalversions/networking/v1/gcpgatewaypolicy.go index 80fd4ac..8d0d277 100644 --- a/pkg/client/informers/externalversions/networking/v1/gcpgatewaypolicy.go +++ b/pkg/client/informers/externalversions/networking/v1/gcpgatewaypolicy.go @@ -19,13 +19,13 @@ package v1 import ( - "context" + context "context" time "time" - networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" + apisnetworkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" versioned "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/clientset/versioned" internalinterfaces "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/listers/networking/v1" + networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/listers/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -36,7 +36,7 @@ import ( // GCPGatewayPolicies. type GCPGatewayPolicyInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.GCPGatewayPolicyLister + Lister() networkingv1.GCPGatewayPolicyLister } type gCPGatewayPolicyInformer struct { @@ -62,16 +62,28 @@ func NewFilteredGCPGatewayPolicyInformer(client versioned.Interface, namespace s if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1().GCPGatewayPolicies(namespace).List(context.TODO(), options) + return client.NetworkingV1().GCPGatewayPolicies(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1().GCPGatewayPolicies(namespace).Watch(context.TODO(), options) + return client.NetworkingV1().GCPGatewayPolicies(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().GCPGatewayPolicies(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().GCPGatewayPolicies(namespace).Watch(ctx, options) }, }, - &networkingv1.GCPGatewayPolicy{}, + &apisnetworkingv1.GCPGatewayPolicy{}, resyncPeriod, indexers, ) @@ -82,9 +94,9 @@ func (f *gCPGatewayPolicyInformer) defaultInformer(client versioned.Interface, r } func (f *gCPGatewayPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&networkingv1.GCPGatewayPolicy{}, f.defaultInformer) + return f.factory.InformerFor(&apisnetworkingv1.GCPGatewayPolicy{}, f.defaultInformer) } -func (f *gCPGatewayPolicyInformer) Lister() v1.GCPGatewayPolicyLister { - return v1.NewGCPGatewayPolicyLister(f.Informer().GetIndexer()) +func (f *gCPGatewayPolicyInformer) Lister() networkingv1.GCPGatewayPolicyLister { + return networkingv1.NewGCPGatewayPolicyLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/networking/v1/gcpsessionaffinityfilter.go b/pkg/client/informers/externalversions/networking/v1/gcpsessionaffinityfilter.go index 1d87cf6..829da23 100644 --- a/pkg/client/informers/externalversions/networking/v1/gcpsessionaffinityfilter.go +++ b/pkg/client/informers/externalversions/networking/v1/gcpsessionaffinityfilter.go @@ -19,13 +19,13 @@ package v1 import ( - "context" + context "context" time "time" - networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" + apisnetworkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" versioned "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/clientset/versioned" internalinterfaces "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/listers/networking/v1" + networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/listers/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -36,7 +36,7 @@ import ( // GCPSessionAffinityFilters. type GCPSessionAffinityFilterInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.GCPSessionAffinityFilterLister + Lister() networkingv1.GCPSessionAffinityFilterLister } type gCPSessionAffinityFilterInformer struct { @@ -62,16 +62,28 @@ func NewFilteredGCPSessionAffinityFilterInformer(client versioned.Interface, nam if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1().GCPSessionAffinityFilters(namespace).List(context.TODO(), options) + return client.NetworkingV1().GCPSessionAffinityFilters(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1().GCPSessionAffinityFilters(namespace).Watch(context.TODO(), options) + return client.NetworkingV1().GCPSessionAffinityFilters(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().GCPSessionAffinityFilters(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().GCPSessionAffinityFilters(namespace).Watch(ctx, options) }, }, - &networkingv1.GCPSessionAffinityFilter{}, + &apisnetworkingv1.GCPSessionAffinityFilter{}, resyncPeriod, indexers, ) @@ -82,9 +94,9 @@ func (f *gCPSessionAffinityFilterInformer) defaultInformer(client versioned.Inte } func (f *gCPSessionAffinityFilterInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&networkingv1.GCPSessionAffinityFilter{}, f.defaultInformer) + return f.factory.InformerFor(&apisnetworkingv1.GCPSessionAffinityFilter{}, f.defaultInformer) } -func (f *gCPSessionAffinityFilterInformer) Lister() v1.GCPSessionAffinityFilterLister { - return v1.NewGCPSessionAffinityFilterLister(f.Informer().GetIndexer()) +func (f *gCPSessionAffinityFilterInformer) Lister() networkingv1.GCPSessionAffinityFilterLister { + return networkingv1.NewGCPSessionAffinityFilterLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/networking/v1/gcpsessionaffinitypolicy.go b/pkg/client/informers/externalversions/networking/v1/gcpsessionaffinitypolicy.go index 174c366..86f33a8 100644 --- a/pkg/client/informers/externalversions/networking/v1/gcpsessionaffinitypolicy.go +++ b/pkg/client/informers/externalversions/networking/v1/gcpsessionaffinitypolicy.go @@ -19,13 +19,13 @@ package v1 import ( - "context" + context "context" time "time" - networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" + apisnetworkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" versioned "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/clientset/versioned" internalinterfaces "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/listers/networking/v1" + networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/listers/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -36,7 +36,7 @@ import ( // GCPSessionAffinityPolicies. type GCPSessionAffinityPolicyInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.GCPSessionAffinityPolicyLister + Lister() networkingv1.GCPSessionAffinityPolicyLister } type gCPSessionAffinityPolicyInformer struct { @@ -62,16 +62,28 @@ func NewFilteredGCPSessionAffinityPolicyInformer(client versioned.Interface, nam if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1().GCPSessionAffinityPolicies(namespace).List(context.TODO(), options) + return client.NetworkingV1().GCPSessionAffinityPolicies(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1().GCPSessionAffinityPolicies(namespace).Watch(context.TODO(), options) + return client.NetworkingV1().GCPSessionAffinityPolicies(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().GCPSessionAffinityPolicies(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().GCPSessionAffinityPolicies(namespace).Watch(ctx, options) }, }, - &networkingv1.GCPSessionAffinityPolicy{}, + &apisnetworkingv1.GCPSessionAffinityPolicy{}, resyncPeriod, indexers, ) @@ -82,9 +94,9 @@ func (f *gCPSessionAffinityPolicyInformer) defaultInformer(client versioned.Inte } func (f *gCPSessionAffinityPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&networkingv1.GCPSessionAffinityPolicy{}, f.defaultInformer) + return f.factory.InformerFor(&apisnetworkingv1.GCPSessionAffinityPolicy{}, f.defaultInformer) } -func (f *gCPSessionAffinityPolicyInformer) Lister() v1.GCPSessionAffinityPolicyLister { - return v1.NewGCPSessionAffinityPolicyLister(f.Informer().GetIndexer()) +func (f *gCPSessionAffinityPolicyInformer) Lister() networkingv1.GCPSessionAffinityPolicyLister { + return networkingv1.NewGCPSessionAffinityPolicyLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/networking/v1/healthcheckpolicy.go b/pkg/client/informers/externalversions/networking/v1/healthcheckpolicy.go index e462d42..c1d9f8c 100644 --- a/pkg/client/informers/externalversions/networking/v1/healthcheckpolicy.go +++ b/pkg/client/informers/externalversions/networking/v1/healthcheckpolicy.go @@ -19,13 +19,13 @@ package v1 import ( - "context" + context "context" time "time" - networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" + apisnetworkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" versioned "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/clientset/versioned" internalinterfaces "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/listers/networking/v1" + networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/pkg/client/listers/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -36,7 +36,7 @@ import ( // HealthCheckPolicies. type HealthCheckPolicyInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.HealthCheckPolicyLister + Lister() networkingv1.HealthCheckPolicyLister } type healthCheckPolicyInformer struct { @@ -62,16 +62,28 @@ func NewFilteredHealthCheckPolicyInformer(client versioned.Interface, namespace if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1().HealthCheckPolicies(namespace).List(context.TODO(), options) + return client.NetworkingV1().HealthCheckPolicies(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1().HealthCheckPolicies(namespace).Watch(context.TODO(), options) + return client.NetworkingV1().HealthCheckPolicies(namespace).Watch(context.Background(), options) + }, + ListWithContextFunc: func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().HealthCheckPolicies(namespace).List(ctx, options) + }, + WatchFuncWithContext: func(ctx context.Context, options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1().HealthCheckPolicies(namespace).Watch(ctx, options) }, }, - &networkingv1.HealthCheckPolicy{}, + &apisnetworkingv1.HealthCheckPolicy{}, resyncPeriod, indexers, ) @@ -82,9 +94,9 @@ func (f *healthCheckPolicyInformer) defaultInformer(client versioned.Interface, } func (f *healthCheckPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&networkingv1.HealthCheckPolicy{}, f.defaultInformer) + return f.factory.InformerFor(&apisnetworkingv1.HealthCheckPolicy{}, f.defaultInformer) } -func (f *healthCheckPolicyInformer) Lister() v1.HealthCheckPolicyLister { - return v1.NewHealthCheckPolicyLister(f.Informer().GetIndexer()) +func (f *healthCheckPolicyInformer) Lister() networkingv1.HealthCheckPolicyLister { + return networkingv1.NewHealthCheckPolicyLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/networking/v1/interface.go b/pkg/client/informers/externalversions/networking/v1/interface.go index 7b826ca..66119d6 100644 --- a/pkg/client/informers/externalversions/networking/v1/interface.go +++ b/pkg/client/informers/externalversions/networking/v1/interface.go @@ -32,6 +32,8 @@ type Interface interface { GCPSessionAffinityFilters() GCPSessionAffinityFilterInformer // GCPSessionAffinityPolicies returns a GCPSessionAffinityPolicyInformer. GCPSessionAffinityPolicies() GCPSessionAffinityPolicyInformer + // GCPTrafficDistributionPolicies returns a GCPTrafficDistributionPolicyInformer. + GCPTrafficDistributionPolicies() GCPTrafficDistributionPolicyInformer // HealthCheckPolicies returns a HealthCheckPolicyInformer. HealthCheckPolicies() HealthCheckPolicyInformer } @@ -67,6 +69,11 @@ func (v *version) GCPSessionAffinityPolicies() GCPSessionAffinityPolicyInformer return &gCPSessionAffinityPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } +// GCPTrafficDistributionPolicies returns a GCPTrafficDistributionPolicyInformer. +func (v *version) GCPTrafficDistributionPolicies() GCPTrafficDistributionPolicyInformer { + return &gCPTrafficDistributionPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + // HealthCheckPolicies returns a HealthCheckPolicyInformer. func (v *version) HealthCheckPolicies() HealthCheckPolicyInformer { return &healthCheckPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} diff --git a/pkg/client/listers/networking/v1/expansion_generated.go b/pkg/client/listers/networking/v1/expansion_generated.go index d98ddd0..44f230b 100644 --- a/pkg/client/listers/networking/v1/expansion_generated.go +++ b/pkg/client/listers/networking/v1/expansion_generated.go @@ -50,6 +50,14 @@ type GCPSessionAffinityPolicyListerExpansion interface{} // GCPSessionAffinityPolicyNamespaceLister. type GCPSessionAffinityPolicyNamespaceListerExpansion interface{} +// GCPTrafficDistributionPolicyListerExpansion allows custom methods to be added to +// GCPTrafficDistributionPolicyLister. +type GCPTrafficDistributionPolicyListerExpansion interface{} + +// GCPTrafficDistributionPolicyNamespaceListerExpansion allows custom methods to be added to +// GCPTrafficDistributionPolicyNamespaceLister. +type GCPTrafficDistributionPolicyNamespaceListerExpansion interface{} + // HealthCheckPolicyListerExpansion allows custom methods to be added to // HealthCheckPolicyLister. type HealthCheckPolicyListerExpansion interface{} diff --git a/pkg/client/listers/networking/v1/gcpbackendpolicy.go b/pkg/client/listers/networking/v1/gcpbackendpolicy.go index b888efe..3fcafb3 100644 --- a/pkg/client/listers/networking/v1/gcpbackendpolicy.go +++ b/pkg/client/listers/networking/v1/gcpbackendpolicy.go @@ -19,10 +19,10 @@ package v1 import ( - v1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" + networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // GCPBackendPolicyLister helps list GCPBackendPolicies. @@ -30,7 +30,7 @@ import ( type GCPBackendPolicyLister interface { // List lists all GCPBackendPolicies in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.GCPBackendPolicy, err error) + List(selector labels.Selector) (ret []*networkingv1.GCPBackendPolicy, err error) // GCPBackendPolicies returns an object that can list and get GCPBackendPolicies. GCPBackendPolicies(namespace string) GCPBackendPolicyNamespaceLister GCPBackendPolicyListerExpansion @@ -38,25 +38,17 @@ type GCPBackendPolicyLister interface { // gCPBackendPolicyLister implements the GCPBackendPolicyLister interface. type gCPBackendPolicyLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*networkingv1.GCPBackendPolicy] } // NewGCPBackendPolicyLister returns a new GCPBackendPolicyLister. func NewGCPBackendPolicyLister(indexer cache.Indexer) GCPBackendPolicyLister { - return &gCPBackendPolicyLister{indexer: indexer} -} - -// List lists all GCPBackendPolicies in the indexer. -func (s *gCPBackendPolicyLister) List(selector labels.Selector) (ret []*v1.GCPBackendPolicy, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.GCPBackendPolicy)) - }) - return ret, err + return &gCPBackendPolicyLister{listers.New[*networkingv1.GCPBackendPolicy](indexer, networkingv1.Resource("gcpbackendpolicy"))} } // GCPBackendPolicies returns an object that can list and get GCPBackendPolicies. func (s *gCPBackendPolicyLister) GCPBackendPolicies(namespace string) GCPBackendPolicyNamespaceLister { - return gCPBackendPolicyNamespaceLister{indexer: s.indexer, namespace: namespace} + return gCPBackendPolicyNamespaceLister{listers.NewNamespaced[*networkingv1.GCPBackendPolicy](s.ResourceIndexer, namespace)} } // GCPBackendPolicyNamespaceLister helps list and get GCPBackendPolicies. @@ -64,36 +56,15 @@ func (s *gCPBackendPolicyLister) GCPBackendPolicies(namespace string) GCPBackend type GCPBackendPolicyNamespaceLister interface { // List lists all GCPBackendPolicies in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.GCPBackendPolicy, err error) + List(selector labels.Selector) (ret []*networkingv1.GCPBackendPolicy, err error) // Get retrieves the GCPBackendPolicy from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.GCPBackendPolicy, error) + Get(name string) (*networkingv1.GCPBackendPolicy, error) GCPBackendPolicyNamespaceListerExpansion } // gCPBackendPolicyNamespaceLister implements the GCPBackendPolicyNamespaceLister // interface. type gCPBackendPolicyNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all GCPBackendPolicies in the indexer for a given namespace. -func (s gCPBackendPolicyNamespaceLister) List(selector labels.Selector) (ret []*v1.GCPBackendPolicy, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.GCPBackendPolicy)) - }) - return ret, err -} - -// Get retrieves the GCPBackendPolicy from the indexer for a given namespace and name. -func (s gCPBackendPolicyNamespaceLister) Get(name string) (*v1.GCPBackendPolicy, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("gcpbackendpolicy"), name) - } - return obj.(*v1.GCPBackendPolicy), nil + listers.ResourceIndexer[*networkingv1.GCPBackendPolicy] } diff --git a/pkg/client/listers/networking/v1/gcpgatewaypolicy.go b/pkg/client/listers/networking/v1/gcpgatewaypolicy.go index 6496468..6f4966e 100644 --- a/pkg/client/listers/networking/v1/gcpgatewaypolicy.go +++ b/pkg/client/listers/networking/v1/gcpgatewaypolicy.go @@ -19,10 +19,10 @@ package v1 import ( - v1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" + networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // GCPGatewayPolicyLister helps list GCPGatewayPolicies. @@ -30,7 +30,7 @@ import ( type GCPGatewayPolicyLister interface { // List lists all GCPGatewayPolicies in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.GCPGatewayPolicy, err error) + List(selector labels.Selector) (ret []*networkingv1.GCPGatewayPolicy, err error) // GCPGatewayPolicies returns an object that can list and get GCPGatewayPolicies. GCPGatewayPolicies(namespace string) GCPGatewayPolicyNamespaceLister GCPGatewayPolicyListerExpansion @@ -38,25 +38,17 @@ type GCPGatewayPolicyLister interface { // gCPGatewayPolicyLister implements the GCPGatewayPolicyLister interface. type gCPGatewayPolicyLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*networkingv1.GCPGatewayPolicy] } // NewGCPGatewayPolicyLister returns a new GCPGatewayPolicyLister. func NewGCPGatewayPolicyLister(indexer cache.Indexer) GCPGatewayPolicyLister { - return &gCPGatewayPolicyLister{indexer: indexer} -} - -// List lists all GCPGatewayPolicies in the indexer. -func (s *gCPGatewayPolicyLister) List(selector labels.Selector) (ret []*v1.GCPGatewayPolicy, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.GCPGatewayPolicy)) - }) - return ret, err + return &gCPGatewayPolicyLister{listers.New[*networkingv1.GCPGatewayPolicy](indexer, networkingv1.Resource("gcpgatewaypolicy"))} } // GCPGatewayPolicies returns an object that can list and get GCPGatewayPolicies. func (s *gCPGatewayPolicyLister) GCPGatewayPolicies(namespace string) GCPGatewayPolicyNamespaceLister { - return gCPGatewayPolicyNamespaceLister{indexer: s.indexer, namespace: namespace} + return gCPGatewayPolicyNamespaceLister{listers.NewNamespaced[*networkingv1.GCPGatewayPolicy](s.ResourceIndexer, namespace)} } // GCPGatewayPolicyNamespaceLister helps list and get GCPGatewayPolicies. @@ -64,36 +56,15 @@ func (s *gCPGatewayPolicyLister) GCPGatewayPolicies(namespace string) GCPGateway type GCPGatewayPolicyNamespaceLister interface { // List lists all GCPGatewayPolicies in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.GCPGatewayPolicy, err error) + List(selector labels.Selector) (ret []*networkingv1.GCPGatewayPolicy, err error) // Get retrieves the GCPGatewayPolicy from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.GCPGatewayPolicy, error) + Get(name string) (*networkingv1.GCPGatewayPolicy, error) GCPGatewayPolicyNamespaceListerExpansion } // gCPGatewayPolicyNamespaceLister implements the GCPGatewayPolicyNamespaceLister // interface. type gCPGatewayPolicyNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all GCPGatewayPolicies in the indexer for a given namespace. -func (s gCPGatewayPolicyNamespaceLister) List(selector labels.Selector) (ret []*v1.GCPGatewayPolicy, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.GCPGatewayPolicy)) - }) - return ret, err -} - -// Get retrieves the GCPGatewayPolicy from the indexer for a given namespace and name. -func (s gCPGatewayPolicyNamespaceLister) Get(name string) (*v1.GCPGatewayPolicy, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("gcpgatewaypolicy"), name) - } - return obj.(*v1.GCPGatewayPolicy), nil + listers.ResourceIndexer[*networkingv1.GCPGatewayPolicy] } diff --git a/pkg/client/listers/networking/v1/gcpsessionaffinityfilter.go b/pkg/client/listers/networking/v1/gcpsessionaffinityfilter.go index 3c447ad..4076347 100644 --- a/pkg/client/listers/networking/v1/gcpsessionaffinityfilter.go +++ b/pkg/client/listers/networking/v1/gcpsessionaffinityfilter.go @@ -19,10 +19,10 @@ package v1 import ( - v1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" + networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // GCPSessionAffinityFilterLister helps list GCPSessionAffinityFilters. @@ -30,7 +30,7 @@ import ( type GCPSessionAffinityFilterLister interface { // List lists all GCPSessionAffinityFilters in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.GCPSessionAffinityFilter, err error) + List(selector labels.Selector) (ret []*networkingv1.GCPSessionAffinityFilter, err error) // GCPSessionAffinityFilters returns an object that can list and get GCPSessionAffinityFilters. GCPSessionAffinityFilters(namespace string) GCPSessionAffinityFilterNamespaceLister GCPSessionAffinityFilterListerExpansion @@ -38,25 +38,17 @@ type GCPSessionAffinityFilterLister interface { // gCPSessionAffinityFilterLister implements the GCPSessionAffinityFilterLister interface. type gCPSessionAffinityFilterLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*networkingv1.GCPSessionAffinityFilter] } // NewGCPSessionAffinityFilterLister returns a new GCPSessionAffinityFilterLister. func NewGCPSessionAffinityFilterLister(indexer cache.Indexer) GCPSessionAffinityFilterLister { - return &gCPSessionAffinityFilterLister{indexer: indexer} -} - -// List lists all GCPSessionAffinityFilters in the indexer. -func (s *gCPSessionAffinityFilterLister) List(selector labels.Selector) (ret []*v1.GCPSessionAffinityFilter, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.GCPSessionAffinityFilter)) - }) - return ret, err + return &gCPSessionAffinityFilterLister{listers.New[*networkingv1.GCPSessionAffinityFilter](indexer, networkingv1.Resource("gcpsessionaffinityfilter"))} } // GCPSessionAffinityFilters returns an object that can list and get GCPSessionAffinityFilters. func (s *gCPSessionAffinityFilterLister) GCPSessionAffinityFilters(namespace string) GCPSessionAffinityFilterNamespaceLister { - return gCPSessionAffinityFilterNamespaceLister{indexer: s.indexer, namespace: namespace} + return gCPSessionAffinityFilterNamespaceLister{listers.NewNamespaced[*networkingv1.GCPSessionAffinityFilter](s.ResourceIndexer, namespace)} } // GCPSessionAffinityFilterNamespaceLister helps list and get GCPSessionAffinityFilters. @@ -64,36 +56,15 @@ func (s *gCPSessionAffinityFilterLister) GCPSessionAffinityFilters(namespace str type GCPSessionAffinityFilterNamespaceLister interface { // List lists all GCPSessionAffinityFilters in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.GCPSessionAffinityFilter, err error) + List(selector labels.Selector) (ret []*networkingv1.GCPSessionAffinityFilter, err error) // Get retrieves the GCPSessionAffinityFilter from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.GCPSessionAffinityFilter, error) + Get(name string) (*networkingv1.GCPSessionAffinityFilter, error) GCPSessionAffinityFilterNamespaceListerExpansion } // gCPSessionAffinityFilterNamespaceLister implements the GCPSessionAffinityFilterNamespaceLister // interface. type gCPSessionAffinityFilterNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all GCPSessionAffinityFilters in the indexer for a given namespace. -func (s gCPSessionAffinityFilterNamespaceLister) List(selector labels.Selector) (ret []*v1.GCPSessionAffinityFilter, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.GCPSessionAffinityFilter)) - }) - return ret, err -} - -// Get retrieves the GCPSessionAffinityFilter from the indexer for a given namespace and name. -func (s gCPSessionAffinityFilterNamespaceLister) Get(name string) (*v1.GCPSessionAffinityFilter, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("gcpsessionaffinityfilter"), name) - } - return obj.(*v1.GCPSessionAffinityFilter), nil + listers.ResourceIndexer[*networkingv1.GCPSessionAffinityFilter] } diff --git a/pkg/client/listers/networking/v1/gcpsessionaffinitypolicy.go b/pkg/client/listers/networking/v1/gcpsessionaffinitypolicy.go index 834c495..5b79f37 100644 --- a/pkg/client/listers/networking/v1/gcpsessionaffinitypolicy.go +++ b/pkg/client/listers/networking/v1/gcpsessionaffinitypolicy.go @@ -19,10 +19,10 @@ package v1 import ( - v1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" + networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // GCPSessionAffinityPolicyLister helps list GCPSessionAffinityPolicies. @@ -30,7 +30,7 @@ import ( type GCPSessionAffinityPolicyLister interface { // List lists all GCPSessionAffinityPolicies in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.GCPSessionAffinityPolicy, err error) + List(selector labels.Selector) (ret []*networkingv1.GCPSessionAffinityPolicy, err error) // GCPSessionAffinityPolicies returns an object that can list and get GCPSessionAffinityPolicies. GCPSessionAffinityPolicies(namespace string) GCPSessionAffinityPolicyNamespaceLister GCPSessionAffinityPolicyListerExpansion @@ -38,25 +38,17 @@ type GCPSessionAffinityPolicyLister interface { // gCPSessionAffinityPolicyLister implements the GCPSessionAffinityPolicyLister interface. type gCPSessionAffinityPolicyLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*networkingv1.GCPSessionAffinityPolicy] } // NewGCPSessionAffinityPolicyLister returns a new GCPSessionAffinityPolicyLister. func NewGCPSessionAffinityPolicyLister(indexer cache.Indexer) GCPSessionAffinityPolicyLister { - return &gCPSessionAffinityPolicyLister{indexer: indexer} -} - -// List lists all GCPSessionAffinityPolicies in the indexer. -func (s *gCPSessionAffinityPolicyLister) List(selector labels.Selector) (ret []*v1.GCPSessionAffinityPolicy, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.GCPSessionAffinityPolicy)) - }) - return ret, err + return &gCPSessionAffinityPolicyLister{listers.New[*networkingv1.GCPSessionAffinityPolicy](indexer, networkingv1.Resource("gcpsessionaffinitypolicy"))} } // GCPSessionAffinityPolicies returns an object that can list and get GCPSessionAffinityPolicies. func (s *gCPSessionAffinityPolicyLister) GCPSessionAffinityPolicies(namespace string) GCPSessionAffinityPolicyNamespaceLister { - return gCPSessionAffinityPolicyNamespaceLister{indexer: s.indexer, namespace: namespace} + return gCPSessionAffinityPolicyNamespaceLister{listers.NewNamespaced[*networkingv1.GCPSessionAffinityPolicy](s.ResourceIndexer, namespace)} } // GCPSessionAffinityPolicyNamespaceLister helps list and get GCPSessionAffinityPolicies. @@ -64,36 +56,15 @@ func (s *gCPSessionAffinityPolicyLister) GCPSessionAffinityPolicies(namespace st type GCPSessionAffinityPolicyNamespaceLister interface { // List lists all GCPSessionAffinityPolicies in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.GCPSessionAffinityPolicy, err error) + List(selector labels.Selector) (ret []*networkingv1.GCPSessionAffinityPolicy, err error) // Get retrieves the GCPSessionAffinityPolicy from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.GCPSessionAffinityPolicy, error) + Get(name string) (*networkingv1.GCPSessionAffinityPolicy, error) GCPSessionAffinityPolicyNamespaceListerExpansion } // gCPSessionAffinityPolicyNamespaceLister implements the GCPSessionAffinityPolicyNamespaceLister // interface. type gCPSessionAffinityPolicyNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all GCPSessionAffinityPolicies in the indexer for a given namespace. -func (s gCPSessionAffinityPolicyNamespaceLister) List(selector labels.Selector) (ret []*v1.GCPSessionAffinityPolicy, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.GCPSessionAffinityPolicy)) - }) - return ret, err -} - -// Get retrieves the GCPSessionAffinityPolicy from the indexer for a given namespace and name. -func (s gCPSessionAffinityPolicyNamespaceLister) Get(name string) (*v1.GCPSessionAffinityPolicy, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("gcpsessionaffinitypolicy"), name) - } - return obj.(*v1.GCPSessionAffinityPolicy), nil + listers.ResourceIndexer[*networkingv1.GCPSessionAffinityPolicy] } diff --git a/pkg/client/listers/networking/v1/healthcheckpolicy.go b/pkg/client/listers/networking/v1/healthcheckpolicy.go index 7d320de..2602c66 100644 --- a/pkg/client/listers/networking/v1/healthcheckpolicy.go +++ b/pkg/client/listers/networking/v1/healthcheckpolicy.go @@ -19,10 +19,10 @@ package v1 import ( - v1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" + networkingv1 "github.com/GoogleCloudPlatform/gke-gateway-api/apis/networking/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // HealthCheckPolicyLister helps list HealthCheckPolicies. @@ -30,7 +30,7 @@ import ( type HealthCheckPolicyLister interface { // List lists all HealthCheckPolicies in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.HealthCheckPolicy, err error) + List(selector labels.Selector) (ret []*networkingv1.HealthCheckPolicy, err error) // HealthCheckPolicies returns an object that can list and get HealthCheckPolicies. HealthCheckPolicies(namespace string) HealthCheckPolicyNamespaceLister HealthCheckPolicyListerExpansion @@ -38,25 +38,17 @@ type HealthCheckPolicyLister interface { // healthCheckPolicyLister implements the HealthCheckPolicyLister interface. type healthCheckPolicyLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*networkingv1.HealthCheckPolicy] } // NewHealthCheckPolicyLister returns a new HealthCheckPolicyLister. func NewHealthCheckPolicyLister(indexer cache.Indexer) HealthCheckPolicyLister { - return &healthCheckPolicyLister{indexer: indexer} -} - -// List lists all HealthCheckPolicies in the indexer. -func (s *healthCheckPolicyLister) List(selector labels.Selector) (ret []*v1.HealthCheckPolicy, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.HealthCheckPolicy)) - }) - return ret, err + return &healthCheckPolicyLister{listers.New[*networkingv1.HealthCheckPolicy](indexer, networkingv1.Resource("healthcheckpolicy"))} } // HealthCheckPolicies returns an object that can list and get HealthCheckPolicies. func (s *healthCheckPolicyLister) HealthCheckPolicies(namespace string) HealthCheckPolicyNamespaceLister { - return healthCheckPolicyNamespaceLister{indexer: s.indexer, namespace: namespace} + return healthCheckPolicyNamespaceLister{listers.NewNamespaced[*networkingv1.HealthCheckPolicy](s.ResourceIndexer, namespace)} } // HealthCheckPolicyNamespaceLister helps list and get HealthCheckPolicies. @@ -64,36 +56,15 @@ func (s *healthCheckPolicyLister) HealthCheckPolicies(namespace string) HealthCh type HealthCheckPolicyNamespaceLister interface { // List lists all HealthCheckPolicies in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.HealthCheckPolicy, err error) + List(selector labels.Selector) (ret []*networkingv1.HealthCheckPolicy, err error) // Get retrieves the HealthCheckPolicy from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.HealthCheckPolicy, error) + Get(name string) (*networkingv1.HealthCheckPolicy, error) HealthCheckPolicyNamespaceListerExpansion } // healthCheckPolicyNamespaceLister implements the HealthCheckPolicyNamespaceLister // interface. type healthCheckPolicyNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all HealthCheckPolicies in the indexer for a given namespace. -func (s healthCheckPolicyNamespaceLister) List(selector labels.Selector) (ret []*v1.HealthCheckPolicy, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.HealthCheckPolicy)) - }) - return ret, err -} - -// Get retrieves the HealthCheckPolicy from the indexer for a given namespace and name. -func (s healthCheckPolicyNamespaceLister) Get(name string) (*v1.HealthCheckPolicy, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("healthcheckpolicy"), name) - } - return obj.(*v1.HealthCheckPolicy), nil + listers.ResourceIndexer[*networkingv1.HealthCheckPolicy] }