From 4b4fd67f9b182d1bf1d5bd5efdca9cde16fe75a5 Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Mon, 10 Feb 2025 11:06:38 -0500 Subject: [PATCH 01/32] apis: add implementation for GEP-3388 HTTPRoute Retry Budget --- apis/v1alpha2/backendtrafficpolicy_types.go | 107 ++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 apis/v1alpha2/backendtrafficpolicy_types.go diff --git a/apis/v1alpha2/backendtrafficpolicy_types.go b/apis/v1alpha2/backendtrafficpolicy_types.go new file mode 100644 index 0000000000..b19f00f97c --- /dev/null +++ b/apis/v1alpha2/backendtrafficpolicy_types.go @@ -0,0 +1,107 @@ +/* +Copyright 2025 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type BackendTrafficPolicy struct { + // BackendTrafficPolicy defines the configuration for how traffic to a target backend should be handled. + // + // Support: Extended + // + // +optional + // + // + // Note: there is no Override or Default policy configuration. + + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Spec defines the desired state of BackendTrafficPolicy. + Spec BackendTrafficPolicySpec `json:"spec"` + + // Status defines the current state of BackendTrafficPolicy. + Status PolicyStatus `json:"status,omitempty"` +} + +type BackendTrafficPolicySpec struct { + // TargetRef identifies an API object to apply policy to. + // Currently, Backends (i.e. Service, ServiceImport, or any + // implementation-specific backendRef) are the only valid API + // target references. + // +listType=map + // +listMapKey=group + // +listMapKey=kind + // +listMapKey=name + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=16 + TargetRefs []LocalPolicyTargetReference `json:"targetRefs"` + + // Retry defines the configuration for when to retry a request to a target backend. + // + // Implementations SHOULD retry on connection errors (disconnect, reset, timeout, + // TCP failure) if a retry stanza is configured. + // + // Support: Extended + // + // +optional + // + Retry *CommonRetryPolicy `json:"retry,omitempty"` + + // SessionPersistence defines and configures session persistence + // for the backend. + // + // Support: Extended + // + // +optional + SessionPersistence *SessionPersistence `json:"sessionPersistence,omitempty"` +} + +// CommonRetryPolicy defines the configuration for when to retry a request. +// +type CommonRetryPolicy struct { + // Support: Extended + // + // +optional + BudgetPercent *int `json:"budgetPercent,omitempty"` + + // Support: Extended + // + // +optional + BudgetInterval *Duration `json:"budgetInterval,omitempty"` + + // Support: Extended + // + // +optional + MinRetryRate *RequestRate `json:"minRetryRate,omitempty"` +} + +// RequestRate expresses a rate of requests over a given period of time. +// +type RequestRate struct { + // Support: Extended + // + // +optional + Count *int `json:"count,omitempty"` + + // Support: Extended + // + // +optional + Interval *Duration `json:"interval,omitempty"` +} From 19934172472164ca3eb1cd77f76fbdc72063ee1e Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Mon, 10 Feb 2025 12:33:46 -0500 Subject: [PATCH 02/32] fmt and add descriptions for parameters --- apis/v1alpha2/backendtrafficpolicy_types.go | 161 +++++++++++--------- 1 file changed, 89 insertions(+), 72 deletions(-) diff --git a/apis/v1alpha2/backendtrafficpolicy_types.go b/apis/v1alpha2/backendtrafficpolicy_types.go index b19f00f97c..7d342d3918 100644 --- a/apis/v1alpha2/backendtrafficpolicy_types.go +++ b/apis/v1alpha2/backendtrafficpolicy_types.go @@ -21,87 +21,104 @@ import ( ) type BackendTrafficPolicy struct { - // BackendTrafficPolicy defines the configuration for how traffic to a target backend should be handled. - // - // Support: Extended - // - // +optional - // - // - // Note: there is no Override or Default policy configuration. - - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - // Spec defines the desired state of BackendTrafficPolicy. - Spec BackendTrafficPolicySpec `json:"spec"` - - // Status defines the current state of BackendTrafficPolicy. - Status PolicyStatus `json:"status,omitempty"` + // BackendTrafficPolicy defines the configuration for how traffic to a + // target backend should be handled. + // + // Support: Extended + // + // +optional + // + // + // Note: there is no Override or Default policy configuration. + + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Spec defines the desired state of BackendTrafficPolicy. + Spec BackendTrafficPolicySpec `json:"spec"` + + // Status defines the current state of BackendTrafficPolicy. + Status PolicyStatus `json:"status,omitempty"` } type BackendTrafficPolicySpec struct { - // TargetRef identifies an API object to apply policy to. - // Currently, Backends (i.e. Service, ServiceImport, or any - // implementation-specific backendRef) are the only valid API - // target references. - // +listType=map - // +listMapKey=group - // +listMapKey=kind - // +listMapKey=name - // +kubebuilder:validation:MinItems=1 - // +kubebuilder:validation:MaxItems=16 - TargetRefs []LocalPolicyTargetReference `json:"targetRefs"` - - // Retry defines the configuration for when to retry a request to a target backend. - // - // Implementations SHOULD retry on connection errors (disconnect, reset, timeout, - // TCP failure) if a retry stanza is configured. - // - // Support: Extended - // - // +optional - // - Retry *CommonRetryPolicy `json:"retry,omitempty"` - - // SessionPersistence defines and configures session persistence - // for the backend. - // - // Support: Extended - // - // +optional - SessionPersistence *SessionPersistence `json:"sessionPersistence,omitempty"` + // TargetRef identifies an API object to apply policy to. + // Currently, Backends (i.e. Service, ServiceImport, or any + // implementation-specific backendRef) are the only valid API + // target references. + // +listType=map + // +listMapKey=group + // +listMapKey=kind + // +listMapKey=name + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=16 + TargetRefs []LocalPolicyTargetReference `json:"targetRefs"` + + // Retry defines the configuration for when to retry a request to a target + // backend. + // + // Implementations SHOULD retry on connection errors (disconnect, reset, timeout, + // TCP failure) if a retry stanza is configured. + // + // Support: Extended + // + // +optional + // + Retry *CommonRetryPolicy `json:"retry,omitempty"` + + // SessionPersistence defines and configures session persistence + // for the backend. + // + // Support: Extended + // + // +optional + SessionPersistence *SessionPersistence `json:"sessionPersistence,omitempty"` } // CommonRetryPolicy defines the configuration for when to retry a request. -// type CommonRetryPolicy struct { - // Support: Extended - // - // +optional - BudgetPercent *int `json:"budgetPercent,omitempty"` - - // Support: Extended - // - // +optional - BudgetInterval *Duration `json:"budgetInterval,omitempty"` - - // Support: Extended - // - // +optional - MinRetryRate *RequestRate `json:"minRetryRate,omitempty"` + // BudgetPercent defines the maximum percentage of active requests that may + // be made up of retries. + // + // Support: Extended + // + // +optional + BudgetPercent *int `json:"budgetPercent,omitempty"` + + // BudgetInterval defines the duration in which requests will be considered + // for calculating the budget for retries. + // + // Support: Extended + // + // +optional + BudgetInterval *Duration `json:"budgetInterval,omitempty"` + + // MinRetryRate defines the minimum rate of retries that will be allowable + // over a specified duration of time. + // + // Ensures that requests can still be retried during periods of low + // traffic. + // + // Support: Extended + // + // +optional + MinRetryRate *RequestRate `json:"minRetryRate,omitempty"` } // RequestRate expresses a rate of requests over a given period of time. -// type RequestRate struct { - // Support: Extended - // - // +optional - Count *int `json:"count,omitempty"` - - // Support: Extended - // - // +optional - Interval *Duration `json:"interval,omitempty"` + // Count specifies the number of requests per time interval. + // + // Support: Extended + // + // +optional + Count *int `json:"count,omitempty"` + + // Interval specifies the divisor of the rate of requests, the amount of + // time during which the given count of requests occr. + // + // Support: Extended + // + // +optional + Interval *Duration `json:"interval,omitempty"` } From 81ee3189e2fec7c358a4b6a22ef4f1f1091fca69 Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Mon, 10 Feb 2025 12:34:48 -0500 Subject: [PATCH 03/32] Move GEP 3388 to Experimental --- geps/gep-3388/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geps/gep-3388/index.md b/geps/gep-3388/index.md index 8f63436739..23d4763912 100644 --- a/geps/gep-3388/index.md +++ b/geps/gep-3388/index.md @@ -1,7 +1,7 @@ # GEP-3388: Retry Budgets * Issue: [#3388](https://github.com/kubernetes-sigs/gateway-api/issues/3388) -* Status: Implementable +* Status: Experimental (See status definitions [here](/geps/overview/#gep-states).) From 7b61c97629c05b65df56b3c717e92e43da02a204 Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Mon, 10 Feb 2025 12:38:06 -0500 Subject: [PATCH 04/32] make generate --- apis/v1alpha2/zz_generated.deepcopy.go | 104 ++++ apis/v1alpha2/zz_generated.register.go | 1 + ...working.k8s.io_backendtrafficpolicies.yaml | 535 ++++++++++++++++++ pkg/generated/openapi/zz_generated.openapi.go | 166 ++++++ 4 files changed, 806 insertions(+) create mode 100644 config/crd/experimental/gateway.networking.k8s.io_backendtrafficpolicies.yaml diff --git a/apis/v1alpha2/zz_generated.deepcopy.go b/apis/v1alpha2/zz_generated.deepcopy.go index 5306ca135d..21679ee6a1 100644 --- a/apis/v1alpha2/zz_generated.deepcopy.go +++ b/apis/v1alpha2/zz_generated.deepcopy.go @@ -110,6 +110,85 @@ func (in *BackendLBPolicySpec) DeepCopy() *BackendLBPolicySpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackendTrafficPolicy) DeepCopyInto(out *BackendTrafficPolicy) { + *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 BackendTrafficPolicy. +func (in *BackendTrafficPolicy) DeepCopy() *BackendTrafficPolicy { + if in == nil { + return nil + } + out := new(BackendTrafficPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackendTrafficPolicySpec) DeepCopyInto(out *BackendTrafficPolicySpec) { + *out = *in + if in.TargetRefs != nil { + in, out := &in.TargetRefs, &out.TargetRefs + *out = make([]LocalPolicyTargetReference, len(*in)) + copy(*out, *in) + } + if in.Retry != nil { + in, out := &in.Retry, &out.Retry + *out = new(CommonRetryPolicy) + (*in).DeepCopyInto(*out) + } + if in.SessionPersistence != nil { + in, out := &in.SessionPersistence, &out.SessionPersistence + *out = new(v1.SessionPersistence) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendTrafficPolicySpec. +func (in *BackendTrafficPolicySpec) DeepCopy() *BackendTrafficPolicySpec { + if in == nil { + return nil + } + out := new(BackendTrafficPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CommonRetryPolicy) DeepCopyInto(out *CommonRetryPolicy) { + *out = *in + if in.BudgetPercent != nil { + in, out := &in.BudgetPercent, &out.BudgetPercent + *out = new(int) + **out = **in + } + if in.BudgetInterval != nil { + in, out := &in.BudgetInterval, &out.BudgetInterval + *out = new(v1.Duration) + **out = **in + } + if in.MinRetryRate != nil { + in, out := &in.MinRetryRate, &out.MinRetryRate + *out = new(RequestRate) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonRetryPolicy. +func (in *CommonRetryPolicy) DeepCopy() *CommonRetryPolicy { + if in == nil { + return nil + } + out := new(CommonRetryPolicy) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GRPCRoute) DeepCopyInto(out *GRPCRoute) { *out = *in @@ -328,6 +407,31 @@ func (in *ReferenceGrantList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RequestRate) DeepCopyInto(out *RequestRate) { + *out = *in + if in.Count != nil { + in, out := &in.Count, &out.Count + *out = new(int) + **out = **in + } + if in.Interval != nil { + in, out := &in.Interval, &out.Interval + *out = new(v1.Duration) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequestRate. +func (in *RequestRate) DeepCopy() *RequestRate { + if in == nil { + return nil + } + out := new(RequestRate) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TCPRoute) DeepCopyInto(out *TCPRoute) { *out = *in diff --git a/apis/v1alpha2/zz_generated.register.go b/apis/v1alpha2/zz_generated.register.go index bb133e5dc1..55a3b08811 100644 --- a/apis/v1alpha2/zz_generated.register.go +++ b/apis/v1alpha2/zz_generated.register.go @@ -63,6 +63,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &BackendLBPolicy{}, &BackendLBPolicyList{}, + &BackendTrafficPolicy{}, &GRPCRoute{}, &GRPCRouteList{}, &ReferenceGrant{}, diff --git a/config/crd/experimental/gateway.networking.k8s.io_backendtrafficpolicies.yaml b/config/crd/experimental/gateway.networking.k8s.io_backendtrafficpolicies.yaml new file mode 100644 index 0000000000..8e9b185c46 --- /dev/null +++ b/config/crd/experimental/gateway.networking.k8s.io_backendtrafficpolicies.yaml @@ -0,0 +1,535 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/3328 + gateway.networking.k8s.io/bundle-version: v1.2.1 + gateway.networking.k8s.io/channel: experimental + creationTimestamp: null + name: backendtrafficpolicies.gateway.networking.k8s.io +spec: + group: gateway.networking.k8s.io + names: + kind: BackendTrafficPolicy + listKind: BackendTrafficPolicyList + plural: backendtrafficpolicies + singular: backendtrafficpolicy + scope: Namespaced + versions: + - name: v1alpha2 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: Spec defines the desired state of BackendTrafficPolicy. + properties: + retry: + description: |- + Retry defines the configuration for when to retry a request to a target + backend. + + Implementations SHOULD retry on connection errors (disconnect, reset, timeout, + TCP failure) if a retry stanza is configured. + + Support: Extended + properties: + budgetInterval: + description: |- + BudgetInterval defines the duration in which requests will be considered + for calculating the budget for retries. + + Support: Extended + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string + budgetPercent: + description: |- + BudgetPercent defines the maximum percentage of active requests that may + be made up of retries. + + Support: Extended + type: integer + minRetryRate: + description: |- + MinRetryRate defines the minimum rate of retries that will be allowable + over a specified duration of time. + + Ensures that requests can still be retried during periods of low + traffic. + + Support: Extended + properties: + count: + description: |- + Count specifies the number of requests per time interval. + + Support: Extended + type: integer + interval: + description: |- + Interval specifies the divisor of the rate of requests, the amount of + time during which the given count of requests occr. + + Support: Extended + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string + type: object + type: object + sessionPersistence: + description: |- + SessionPersistence defines and configures session persistence + for the backend. + + Support: Extended + properties: + absoluteTimeout: + description: |- + AbsoluteTimeout defines the absolute timeout of the persistent + session. Once the AbsoluteTimeout duration has elapsed, the + session becomes invalid. + + Support: Extended + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string + cookieConfig: + description: |- + CookieConfig provides configuration settings that are specific + to cookie-based session persistence. + + Support: Core + properties: + lifetimeType: + default: Session + description: |- + LifetimeType specifies whether the cookie has a permanent or + session-based lifetime. A permanent cookie persists until its + specified expiry time, defined by the Expires or Max-Age cookie + attributes, while a session cookie is deleted when the current + session ends. + + When set to "Permanent", AbsoluteTimeout indicates the + cookie's lifetime via the Expires or Max-Age cookie attributes + and is required. + + When set to "Session", AbsoluteTimeout indicates the + absolute lifetime of the cookie tracked by the gateway and + is optional. + + Defaults to "Session". + + Support: Core for "Session" type + + Support: Extended for "Permanent" type + enum: + - Permanent + - Session + type: string + type: object + idleTimeout: + description: |- + IdleTimeout defines the idle timeout of the persistent session. + Once the session has been idle for more than the specified + IdleTimeout duration, the session becomes invalid. + + Support: Extended + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string + sessionName: + description: |- + SessionName defines the name of the persistent session token + which may be reflected in the cookie or the header. Users + should avoid reusing session names to prevent unintended + consequences, such as rejection or unpredictable behavior. + + Support: Implementation-specific + maxLength: 128 + type: string + type: + default: Cookie + description: |- + Type defines the type of session persistence such as through + the use a header or cookie. Defaults to cookie based session + persistence. + + Support: Core for "Cookie" type + + Support: Extended for "Header" type + enum: + - Cookie + - Header + type: string + type: object + x-kubernetes-validations: + - message: AbsoluteTimeout must be specified when cookie lifetimeType + is Permanent + rule: '!has(self.cookieConfig) || !has(self.cookieConfig.lifetimeType) + || self.cookieConfig.lifetimeType != ''Permanent'' || has(self.absoluteTimeout)' + targetRefs: + description: |- + TargetRef identifies an API object to apply policy to. + Currently, Backends (i.e. Service, ServiceImport, or any + implementation-specific backendRef) are the only valid API + target references. + items: + description: |- + LocalPolicyTargetReference identifies an API object to apply a direct or + inherited policy to. This should be used as part of Policy resources + that can target Gateway API resources. For more information on how this + policy attachment model works, and a sample Policy resource, refer to + the policy attachment documentation for Gateway API. + properties: + group: + description: Group is the group of the target resource. + maxLength: 253 + pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + type: string + kind: + description: Kind is kind of the target resource. + maxLength: 63 + minLength: 1 + pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$ + type: string + name: + description: Name is the name of the target resource. + maxLength: 253 + minLength: 1 + type: string + required: + - group + - kind + - name + type: object + maxItems: 16 + minItems: 1 + type: array + x-kubernetes-list-map-keys: + - group + - kind + - name + x-kubernetes-list-type: map + required: + - targetRefs + type: object + status: + description: Status defines the current state of BackendTrafficPolicy. + properties: + ancestors: + description: |- + Ancestors is a list of ancestor resources (usually Gateways) that are + associated with the policy, and the status of the policy with respect to + each ancestor. When this policy attaches to a parent, the controller that + manages the parent and the ancestors MUST add an entry to this list when + 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 + here. For example, if this list was full on BackendTLSPolicy, no + additional Gateways would be able to reference the Service targeted by + the BackendTLSPolicy. + items: + description: |- + 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 + the GatewayClass. Almost always, in this hierarchy, the Gateway will be the most + useful object to place Policy status on, so we recommend that implementations + 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: + ancestorRef: + description: |- + AncestorRef corresponds with a ParentRef in the spec that this + PolicyAncestorStatus struct describes the status of. + properties: + group: + default: gateway.networking.k8s.io + description: |- + Group is the group of the referent. + When unspecified, "gateway.networking.k8s.io" is inferred. + 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])?)*$ + type: string + kind: + default: Gateway + 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 + pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$ + type: string + name: + description: |- + Name is the name of the referent. + + Support: Core + maxLength: 253 + minLength: 1 + type: string + namespace: + description: |- + 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 + the intended destination of the connections are a Service targeted as a + ParentRef of the Route. + + + Support: Core + maxLength: 63 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + port: + description: |- + 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 + networking behaviors specified in a Route must apply to a specific port + as opposed to a listener(s) whose port(s) may be changed. When both Port + 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, + namespace, or hostname. If 1 of 2 Gateway listeners accept attachment + from the referencing Route, the Route MUST be considered successfully + 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 + minimum: 1 + type: integer + sectionName: + description: |- + 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. + * Service: Port name. When both Port (experimental) and SectionName + 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 + listeners can restrict which Routes can attach to them by Route kind, + namespace, or hostname. If 1 of 2 Gateway listeners accept attachment from + the referencing Route, the Route MUST be considered successfully + 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 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + type: string + required: + - name + type: object + conditions: + 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. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, + Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + 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 + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 8 + minItems: 1 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + controllerName: + description: |- + ControllerName is a domain/path string that indicates the name of the + 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. + maxLength: 253 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$ + type: string + required: + - ancestorRef + - controllerName + type: object + maxItems: 16 + type: array + required: + - ancestors + type: object + required: + - spec + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go index 811e47ee48..8f462cbe8e 100644 --- a/pkg/generated/openapi/zz_generated.openapi.go +++ b/pkg/generated/openapi/zz_generated.openapi.go @@ -149,6 +149,9 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendLBPolicy": schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendLBPolicy(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendLBPolicyList": schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendLBPolicyList(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendLBPolicySpec": schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendLBPolicySpec(ref), + "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendTrafficPolicy": schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendTrafficPolicy(ref), + "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendTrafficPolicySpec": schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendTrafficPolicySpec(ref), + "sigs.k8s.io/gateway-api/apis/v1alpha2.CommonRetryPolicy": schema_sigsk8sio_gateway_api_apis_v1alpha2_CommonRetryPolicy(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.GRPCRoute": schema_sigsk8sio_gateway_api_apis_v1alpha2_GRPCRoute(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.GRPCRouteList": schema_sigsk8sio_gateway_api_apis_v1alpha2_GRPCRouteList(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.LocalPolicyTargetReference": schema_sigsk8sio_gateway_api_apis_v1alpha2_LocalPolicyTargetReference(ref), @@ -158,6 +161,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyStatus": schema_sigsk8sio_gateway_api_apis_v1alpha2_PolicyStatus(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.ReferenceGrant": schema_sigsk8sio_gateway_api_apis_v1alpha2_ReferenceGrant(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.ReferenceGrantList": schema_sigsk8sio_gateway_api_apis_v1alpha2_ReferenceGrantList(ref), + "sigs.k8s.io/gateway-api/apis/v1alpha2.RequestRate": schema_sigsk8sio_gateway_api_apis_v1alpha2_RequestRate(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.TCPRoute": schema_sigsk8sio_gateway_api_apis_v1alpha2_TCPRoute(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.TCPRouteList": schema_sigsk8sio_gateway_api_apis_v1alpha2_TCPRouteList(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.TCPRouteRule": schema_sigsk8sio_gateway_api_apis_v1alpha2_TCPRouteRule(ref), @@ -5816,6 +5820,141 @@ func schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendLBPolicySpec(ref common.R } } +func schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendTrafficPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "Spec defines the desired state of BackendTrafficPolicy.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.BackendTrafficPolicySpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "Status defines the current state of BackendTrafficPolicy.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyStatus"), + }, + }, + }, + Required: []string{"spec"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendTrafficPolicySpec", "sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyStatus"}, + } +} + +func schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendTrafficPolicySpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "targetRefs": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "group", + "kind", + "name", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "TargetRef identifies an API object to apply policy to. Currently, Backends (i.e. Service, ServiceImport, or any implementation-specific backendRef) are the only valid API target references.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.LocalPolicyTargetReference"), + }, + }, + }, + }, + }, + "retry": { + SchemaProps: spec.SchemaProps{ + Description: "Retry defines the configuration for when to retry a request to a target backend.\n\nImplementations SHOULD retry on connection errors (disconnect, reset, timeout, TCP failure) if a retry stanza is configured.\n\nSupport: Extended\n\n", + Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.CommonRetryPolicy"), + }, + }, + "sessionPersistence": { + SchemaProps: spec.SchemaProps{ + Description: "SessionPersistence defines and configures session persistence for the backend.\n\nSupport: Extended", + Ref: ref("sigs.k8s.io/gateway-api/apis/v1.SessionPersistence"), + }, + }, + }, + Required: []string{"targetRefs"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/gateway-api/apis/v1.SessionPersistence", "sigs.k8s.io/gateway-api/apis/v1alpha2.CommonRetryPolicy", "sigs.k8s.io/gateway-api/apis/v1alpha2.LocalPolicyTargetReference"}, + } +} + +func schema_sigsk8sio_gateway_api_apis_v1alpha2_CommonRetryPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "CommonRetryPolicy defines the configuration for when to retry a request.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "budgetPercent": { + SchemaProps: spec.SchemaProps{ + Description: "BudgetPercent defines the maximum percentage of active requests that may be made up of retries.\n\nSupport: Extended", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "budgetInterval": { + SchemaProps: spec.SchemaProps{ + Description: "BudgetInterval defines the duration in which requests will be considered for calculating the budget for retries.\n\nSupport: Extended", + Type: []string{"string"}, + Format: "", + }, + }, + "minRetryRate": { + SchemaProps: spec.SchemaProps{ + Description: "MinRetryRate defines the minimum rate of retries that will be allowable over a specified duration of time.\n\nEnsures that requests can still be retried during periods of low traffic.\n\nSupport: Extended", + Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.RequestRate"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/gateway-api/apis/v1alpha2.RequestRate"}, + } +} + func schema_sigsk8sio_gateway_api_apis_v1alpha2_GRPCRoute(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -6214,6 +6353,33 @@ func schema_sigsk8sio_gateway_api_apis_v1alpha2_ReferenceGrantList(ref common.Re } } +func schema_sigsk8sio_gateway_api_apis_v1alpha2_RequestRate(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "RequestRate expresses a rate of requests over a given period of time.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "count": { + SchemaProps: spec.SchemaProps{ + Description: "Count specifies the number of requests per time interval.\n\nSupport: Extended", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "interval": { + SchemaProps: spec.SchemaProps{ + Description: "Interval specifies the divisor of the rate of requests, the amount of time during which the given count of requests occr.\n\nSupport: Extended", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + func schema_sigsk8sio_gateway_api_apis_v1alpha2_TCPRoute(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ From 6661e47547c47ba32fbed0c45277ee8163bb407b Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Mon, 10 Feb 2025 12:59:56 -0500 Subject: [PATCH 05/32] Minor change --- apis/v1alpha2/backendtrafficpolicy_types.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apis/v1alpha2/backendtrafficpolicy_types.go b/apis/v1alpha2/backendtrafficpolicy_types.go index 7d342d3918..e91b487fa8 100644 --- a/apis/v1alpha2/backendtrafficpolicy_types.go +++ b/apis/v1alpha2/backendtrafficpolicy_types.go @@ -96,8 +96,9 @@ type CommonRetryPolicy struct { // MinRetryRate defines the minimum rate of retries that will be allowable // over a specified duration of time. // - // Ensures that requests can still be retried during periods of low - // traffic. + // This ensures that requests can still be retried during periods of low + // traffic, where the budget for retries may be calculated as a very low + // value. // // Support: Extended // @@ -115,7 +116,7 @@ type RequestRate struct { Count *int `json:"count,omitempty"` // Interval specifies the divisor of the rate of requests, the amount of - // time during which the given count of requests occr. + // time during which the given count of requests occur. // // Support: Extended // From e359c3e6636e7cd01767d4f639effb001ca4a436 Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Mon, 10 Feb 2025 13:09:10 -0500 Subject: [PATCH 06/32] Require both parameters of RequestRate --- apis/v1alpha2/backendtrafficpolicy_types.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apis/v1alpha2/backendtrafficpolicy_types.go b/apis/v1alpha2/backendtrafficpolicy_types.go index e91b487fa8..69c7a0f23f 100644 --- a/apis/v1alpha2/backendtrafficpolicy_types.go +++ b/apis/v1alpha2/backendtrafficpolicy_types.go @@ -111,15 +111,11 @@ type RequestRate struct { // Count specifies the number of requests per time interval. // // Support: Extended - // - // +optional Count *int `json:"count,omitempty"` // Interval specifies the divisor of the rate of requests, the amount of // time during which the given count of requests occur. // // Support: Extended - // - // +optional Interval *Duration `json:"interval,omitempty"` } From b166a68141970d2edd13d2f94d992ef5ab1b9990 Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Tue, 11 Feb 2025 11:01:00 -0500 Subject: [PATCH 07/32] Begin fixing Retry description. Add defaults, some validation, in CommonRetryPolicy --- apis/v1alpha2/backendtrafficpolicy_types.go | 15 +++++++++++---- pkg/generated/openapi/zz_generated.openapi.go | 6 +++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/apis/v1alpha2/backendtrafficpolicy_types.go b/apis/v1alpha2/backendtrafficpolicy_types.go index 69c7a0f23f..fe0e5291ac 100644 --- a/apis/v1alpha2/backendtrafficpolicy_types.go +++ b/apis/v1alpha2/backendtrafficpolicy_types.go @@ -54,11 +54,13 @@ type BackendTrafficPolicySpec struct { // +kubebuilder:validation:MaxItems=16 TargetRefs []LocalPolicyTargetReference `json:"targetRefs"` - // Retry defines the configuration for when to retry a request to a target - // backend. + // Retry defines the configuration for when to allow or prevent retries to a + // target backend. // - // Implementations SHOULD retry on connection errors (disconnect, reset, timeout, - // TCP failure) if a retry stanza is configured. + // While the static number of retries performed by the client are + // configured within HTTPRoute Retry stanzas, configuring the + // CommonRetryPolicy allows you to constrain further retries after a + // dynamic budget for retries has been exceeded. // // Support: Extended // @@ -83,6 +85,9 @@ type CommonRetryPolicy struct { // Support: Extended // // +optional + // +kubebuilder:default=20 + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=100 BudgetPercent *int `json:"budgetPercent,omitempty"` // BudgetInterval defines the duration in which requests will be considered @@ -91,6 +96,7 @@ type CommonRetryPolicy struct { // Support: Extended // // +optional + // +kubebuilder:default=10s BudgetInterval *Duration `json:"budgetInterval,omitempty"` // MinRetryRate defines the minimum rate of retries that will be allowable @@ -103,6 +109,7 @@ type CommonRetryPolicy struct { // Support: Extended // // +optional + // +kubebuilder:default={count: 10, interval: 1s} MinRetryRate *RequestRate `json:"minRetryRate,omitempty"` } diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go index 8f462cbe8e..568e51dbc1 100644 --- a/pkg/generated/openapi/zz_generated.openapi.go +++ b/pkg/generated/openapi/zz_generated.openapi.go @@ -5901,7 +5901,7 @@ func schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendTrafficPolicySpec(ref com }, "retry": { SchemaProps: spec.SchemaProps{ - Description: "Retry defines the configuration for when to retry a request to a target backend.\n\nImplementations SHOULD retry on connection errors (disconnect, reset, timeout, TCP failure) if a retry stanza is configured.\n\nSupport: Extended\n\n", + Description: "Retry defines the configuration for when to allow or prevent retries to a target backend.\n\nWhile the static number of retries performed by the client are configured within HTTPRoute Retry stanzas, configuring the CommonRetryPolicy allows you to constrain further retries after a dynamic budget for retries has been exceeded.\n\nSupport: Extended\n\n", Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.CommonRetryPolicy"), }, }, @@ -5943,7 +5943,7 @@ func schema_sigsk8sio_gateway_api_apis_v1alpha2_CommonRetryPolicy(ref common.Ref }, "minRetryRate": { SchemaProps: spec.SchemaProps{ - Description: "MinRetryRate defines the minimum rate of retries that will be allowable over a specified duration of time.\n\nEnsures that requests can still be retried during periods of low traffic.\n\nSupport: Extended", + Description: "MinRetryRate defines the minimum rate of retries that will be allowable over a specified duration of time.\n\nThis ensures that requests can still be retried during periods of low traffic, where the budget for retries may be calculated as a very low value.\n\nSupport: Extended", Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.RequestRate"), }, }, @@ -6369,7 +6369,7 @@ func schema_sigsk8sio_gateway_api_apis_v1alpha2_RequestRate(ref common.Reference }, "interval": { SchemaProps: spec.SchemaProps{ - Description: "Interval specifies the divisor of the rate of requests, the amount of time during which the given count of requests occr.\n\nSupport: Extended", + Description: "Interval specifies the divisor of the rate of requests, the amount of time during which the given count of requests occur.\n\nSupport: Extended", Type: []string{"string"}, Format: "", }, From 1a122fa5c91ebe11d73f395941d2768423bc008e Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Wed, 12 Feb 2025 09:37:30 -0500 Subject: [PATCH 08/32] Taking the liberty of renaming CommonRetryPolicy to RetryConstraint --- apis/v1alpha2/backendtrafficpolicy_types.go | 24 +++++---------------- apis/v1alpha2/shared_types.go | 15 +++++++++++++ 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/apis/v1alpha2/backendtrafficpolicy_types.go b/apis/v1alpha2/backendtrafficpolicy_types.go index fe0e5291ac..20db629efc 100644 --- a/apis/v1alpha2/backendtrafficpolicy_types.go +++ b/apis/v1alpha2/backendtrafficpolicy_types.go @@ -54,19 +54,19 @@ type BackendTrafficPolicySpec struct { // +kubebuilder:validation:MaxItems=16 TargetRefs []LocalPolicyTargetReference `json:"targetRefs"` - // Retry defines the configuration for when to allow or prevent retries to a + // RetryConstraint defines the configuration for when to allow or prevent retries to a // target backend. // // While the static number of retries performed by the client are // configured within HTTPRoute Retry stanzas, configuring the - // CommonRetryPolicy allows you to constrain further retries after a + // RetryConstraint allows you to constrain further retries after a // dynamic budget for retries has been exceeded. // // Support: Extended // // +optional // - Retry *CommonRetryPolicy `json:"retry,omitempty"` + RetryConstraint *RetryConstraint `json:"retry,omitempty"` // SessionPersistence defines and configures session persistence // for the backend. @@ -77,8 +77,8 @@ type BackendTrafficPolicySpec struct { SessionPersistence *SessionPersistence `json:"sessionPersistence,omitempty"` } -// CommonRetryPolicy defines the configuration for when to retry a request. -type CommonRetryPolicy struct { +// RetryConstraint defines the configuration for when to retry a request. +type RetryConstraint struct { // BudgetPercent defines the maximum percentage of active requests that may // be made up of retries. // @@ -112,17 +112,3 @@ type CommonRetryPolicy struct { // +kubebuilder:default={count: 10, interval: 1s} MinRetryRate *RequestRate `json:"minRetryRate,omitempty"` } - -// RequestRate expresses a rate of requests over a given period of time. -type RequestRate struct { - // Count specifies the number of requests per time interval. - // - // Support: Extended - Count *int `json:"count,omitempty"` - - // Interval specifies the divisor of the rate of requests, the amount of - // time during which the given count of requests occur. - // - // Support: Extended - Interval *Duration `json:"interval,omitempty"` -} diff --git a/apis/v1alpha2/shared_types.go b/apis/v1alpha2/shared_types.go index 2fb84d5f3b..8a40d602f4 100644 --- a/apis/v1alpha2/shared_types.go +++ b/apis/v1alpha2/shared_types.go @@ -389,3 +389,18 @@ const ( // SessionPersistence. // +k8s:deepcopy-gen=false type SessionPersistence = v1.SessionPersistence + +// RequestRate expresses a rate of requests over a given period of time. +type RequestRate struct { + // Count specifies the number of requests per time interval. + // + // Support: Extended + // +kubebuilder:validation:Minimum=0 + Count *int `json:"count,omitempty"` + + // Interval specifies the divisor of the rate of requests, the amount of + // time during which the given count of requests occur. + // + // Support: Extended + Interval *Duration `json:"interval,omitempty"` +} From 5a02c8e440de89f5ef5f6e2cb687ec0c021102f1 Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Wed, 12 Feb 2025 10:00:04 -0500 Subject: [PATCH 09/32] Shamelessly copying from backendlbpolicy and backendtlspolicy to conform with api structure --- .../apis/v1alpha2/backendtrafficpolicy.go | 264 ++++++++++++++++++ .../apis/v1alpha2/backendtrafficpolicyspec.go | 66 +++++ .../apis/v1alpha2/requestrate.go | 52 ++++ .../apis/v1alpha2/retryconstraint.go | 61 ++++ apis/applyconfiguration/internal/internal.go | 61 ++++ apis/applyconfiguration/utils.go | 8 + apis/v1alpha2/backendtrafficpolicy_types.go | 23 +- apis/v1alpha2/zz_generated.deepcopy.go | 106 ++++--- apis/v1alpha2/zz_generated.register.go | 1 + .../typed/apis/v1alpha2/apis_client.go | 5 + .../apis/v1alpha2/backendtrafficpolicy.go | 73 +++++ .../apis/v1alpha2/fake/fake_apis_client.go | 4 + .../fake/fake_backendtrafficpolicy.go | 197 +++++++++++++ .../apis/v1alpha2/generated_expansion.go | 2 + .../apis/v1alpha2/backendtrafficpolicy.go | 90 ++++++ .../apis/v1alpha2/interface.go | 7 + .../informers/externalversions/generic.go | 2 + .../apis/v1alpha2/backendtrafficpolicy.go | 70 +++++ .../apis/v1alpha2/expansion_generated.go | 8 + pkg/generated/openapi/zz_generated.openapi.go | 131 ++++++--- 20 files changed, 1155 insertions(+), 76 deletions(-) create mode 100644 apis/applyconfiguration/apis/v1alpha2/backendtrafficpolicy.go create mode 100644 apis/applyconfiguration/apis/v1alpha2/backendtrafficpolicyspec.go create mode 100644 apis/applyconfiguration/apis/v1alpha2/requestrate.go create mode 100644 apis/applyconfiguration/apis/v1alpha2/retryconstraint.go create mode 100644 pkg/client/clientset/versioned/typed/apis/v1alpha2/backendtrafficpolicy.go create mode 100644 pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_backendtrafficpolicy.go create mode 100644 pkg/client/informers/externalversions/apis/v1alpha2/backendtrafficpolicy.go create mode 100644 pkg/client/listers/apis/v1alpha2/backendtrafficpolicy.go diff --git a/apis/applyconfiguration/apis/v1alpha2/backendtrafficpolicy.go b/apis/applyconfiguration/apis/v1alpha2/backendtrafficpolicy.go new file mode 100644 index 0000000000..f6ab468e7d --- /dev/null +++ b/apis/applyconfiguration/apis/v1alpha2/backendtrafficpolicy.go @@ -0,0 +1,264 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" + internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" + apisv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" +) + +// BackendTrafficPolicyApplyConfiguration represents a declarative configuration of the BackendTrafficPolicy type for use +// with apply. +type BackendTrafficPolicyApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *BackendTrafficPolicySpecApplyConfiguration `json:"spec,omitempty"` + Status *PolicyStatusApplyConfiguration `json:"status,omitempty"` +} + +// BackendTrafficPolicy constructs a declarative configuration of the BackendTrafficPolicy type for use with +// apply. +func BackendTrafficPolicy(name, namespace string) *BackendTrafficPolicyApplyConfiguration { + b := &BackendTrafficPolicyApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("BackendTrafficPolicy") + b.WithAPIVersion("gateway.networking.k8s.io/v1alpha2") + return b +} + +// ExtractBackendTrafficPolicy extracts the applied configuration owned by fieldManager from +// backendTrafficPolicy. If no managedFields are found in backendTrafficPolicy for fieldManager, a +// BackendTrafficPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// backendTrafficPolicy must be a unmodified BackendTrafficPolicy API object that was retrieved from the Kubernetes API. +// ExtractBackendTrafficPolicy provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractBackendTrafficPolicy(backendTrafficPolicy *apisv1alpha2.BackendTrafficPolicy, fieldManager string) (*BackendTrafficPolicyApplyConfiguration, error) { + return extractBackendTrafficPolicy(backendTrafficPolicy, fieldManager, "") +} + +// ExtractBackendTrafficPolicyStatus is the same as ExtractBackendTrafficPolicy except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractBackendTrafficPolicyStatus(backendTrafficPolicy *apisv1alpha2.BackendTrafficPolicy, fieldManager string) (*BackendTrafficPolicyApplyConfiguration, error) { + return extractBackendTrafficPolicy(backendTrafficPolicy, fieldManager, "status") +} + +func extractBackendTrafficPolicy(backendTrafficPolicy *apisv1alpha2.BackendTrafficPolicy, fieldManager string, subresource string) (*BackendTrafficPolicyApplyConfiguration, error) { + b := &BackendTrafficPolicyApplyConfiguration{} + err := managedfields.ExtractInto(backendTrafficPolicy, internal.Parser().Type("io.k8s.sigs.gateway-api.apis.v1alpha2.BackendTrafficPolicy"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(backendTrafficPolicy.Name) + b.WithNamespace(backendTrafficPolicy.Namespace) + + b.WithKind("BackendTrafficPolicy") + b.WithAPIVersion("gateway.networking.k8s.io/v1alpha2") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithKind(value string) *BackendTrafficPolicyApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithAPIVersion(value string) *BackendTrafficPolicyApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithName(value string) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithGenerateName(value string) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithNamespace(value string) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithUID(value types.UID) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithResourceVersion(value string) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithGeneration(value int64) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *BackendTrafficPolicyApplyConfiguration) WithLabels(entries map[string]string) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *BackendTrafficPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *BackendTrafficPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *BackendTrafficPolicyApplyConfiguration) WithFinalizers(values ...string) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *BackendTrafficPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithSpec(value *BackendTrafficPolicySpecApplyConfiguration) *BackendTrafficPolicyApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithStatus(value *PolicyStatusApplyConfiguration) *BackendTrafficPolicyApplyConfiguration { + b.Status = value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *BackendTrafficPolicyApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/apis/applyconfiguration/apis/v1alpha2/backendtrafficpolicyspec.go b/apis/applyconfiguration/apis/v1alpha2/backendtrafficpolicyspec.go new file mode 100644 index 0000000000..e24d652a10 --- /dev/null +++ b/apis/applyconfiguration/apis/v1alpha2/backendtrafficpolicyspec.go @@ -0,0 +1,66 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" +) + +// BackendTrafficPolicySpecApplyConfiguration represents a declarative configuration of the BackendTrafficPolicySpec type for use +// with apply. +type BackendTrafficPolicySpecApplyConfiguration struct { + TargetRefs []LocalPolicyTargetReferenceApplyConfiguration `json:"targetRefs,omitempty"` + RetryConstraint *RetryConstraintApplyConfiguration `json:"retry,omitempty"` + SessionPersistence *v1.SessionPersistenceApplyConfiguration `json:"sessionPersistence,omitempty"` +} + +// BackendTrafficPolicySpecApplyConfiguration constructs a declarative configuration of the BackendTrafficPolicySpec type for use with +// apply. +func BackendTrafficPolicySpec() *BackendTrafficPolicySpecApplyConfiguration { + return &BackendTrafficPolicySpecApplyConfiguration{} +} + +// WithTargetRefs adds the given value to the TargetRefs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the TargetRefs field. +func (b *BackendTrafficPolicySpecApplyConfiguration) WithTargetRefs(values ...*LocalPolicyTargetReferenceApplyConfiguration) *BackendTrafficPolicySpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTargetRefs") + } + b.TargetRefs = append(b.TargetRefs, *values[i]) + } + return b +} + +// WithRetryConstraint sets the RetryConstraint field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RetryConstraint field is set to the value of the last call. +func (b *BackendTrafficPolicySpecApplyConfiguration) WithRetryConstraint(value *RetryConstraintApplyConfiguration) *BackendTrafficPolicySpecApplyConfiguration { + b.RetryConstraint = value + return b +} + +// WithSessionPersistence sets the SessionPersistence field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SessionPersistence field is set to the value of the last call. +func (b *BackendTrafficPolicySpecApplyConfiguration) WithSessionPersistence(value *v1.SessionPersistenceApplyConfiguration) *BackendTrafficPolicySpecApplyConfiguration { + b.SessionPersistence = value + return b +} diff --git a/apis/applyconfiguration/apis/v1alpha2/requestrate.go b/apis/applyconfiguration/apis/v1alpha2/requestrate.go new file mode 100644 index 0000000000..e71fcd534a --- /dev/null +++ b/apis/applyconfiguration/apis/v1alpha2/requestrate.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// RequestRateApplyConfiguration represents a declarative configuration of the RequestRate type for use +// with apply. +type RequestRateApplyConfiguration struct { + Count *int `json:"count,omitempty"` + Interval *v1.Duration `json:"interval,omitempty"` +} + +// RequestRateApplyConfiguration constructs a declarative configuration of the RequestRate type for use with +// apply. +func RequestRate() *RequestRateApplyConfiguration { + return &RequestRateApplyConfiguration{} +} + +// WithCount sets the Count field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Count field is set to the value of the last call. +func (b *RequestRateApplyConfiguration) WithCount(value int) *RequestRateApplyConfiguration { + b.Count = &value + return b +} + +// WithInterval sets the Interval field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Interval field is set to the value of the last call. +func (b *RequestRateApplyConfiguration) WithInterval(value v1.Duration) *RequestRateApplyConfiguration { + b.Interval = &value + return b +} diff --git a/apis/applyconfiguration/apis/v1alpha2/retryconstraint.go b/apis/applyconfiguration/apis/v1alpha2/retryconstraint.go new file mode 100644 index 0000000000..36f0068138 --- /dev/null +++ b/apis/applyconfiguration/apis/v1alpha2/retryconstraint.go @@ -0,0 +1,61 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// RetryConstraintApplyConfiguration represents a declarative configuration of the RetryConstraint type for use +// with apply. +type RetryConstraintApplyConfiguration struct { + BudgetPercent *int `json:"budgetPercent,omitempty"` + BudgetInterval *v1.Duration `json:"budgetInterval,omitempty"` + MinRetryRate *RequestRateApplyConfiguration `json:"minRetryRate,omitempty"` +} + +// RetryConstraintApplyConfiguration constructs a declarative configuration of the RetryConstraint type for use with +// apply. +func RetryConstraint() *RetryConstraintApplyConfiguration { + return &RetryConstraintApplyConfiguration{} +} + +// WithBudgetPercent sets the BudgetPercent field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BudgetPercent field is set to the value of the last call. +func (b *RetryConstraintApplyConfiguration) WithBudgetPercent(value int) *RetryConstraintApplyConfiguration { + b.BudgetPercent = &value + return b +} + +// WithBudgetInterval sets the BudgetInterval field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BudgetInterval field is set to the value of the last call. +func (b *RetryConstraintApplyConfiguration) WithBudgetInterval(value v1.Duration) *RetryConstraintApplyConfiguration { + b.BudgetInterval = &value + return b +} + +// WithMinRetryRate sets the MinRetryRate field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinRetryRate field is set to the value of the last call. +func (b *RetryConstraintApplyConfiguration) WithMinRetryRate(value *RequestRateApplyConfiguration) *RetryConstraintApplyConfiguration { + b.MinRetryRate = value + return b +} diff --git a/apis/applyconfiguration/internal/internal.go b/apis/applyconfiguration/internal/internal.go index 07a0df71dd..0f03327f8e 100644 --- a/apis/applyconfiguration/internal/internal.go +++ b/apis/applyconfiguration/internal/internal.go @@ -1219,6 +1219,46 @@ var schemaYAML = typed.YAMLObject(`types: - group - kind - name +- name: io.k8s.sigs.gateway-api.apis.v1alpha2.BackendTrafficPolicy + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.BackendTrafficPolicySpec + default: {} + - name: status + type: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.PolicyStatus + default: {} +- name: io.k8s.sigs.gateway-api.apis.v1alpha2.BackendTrafficPolicySpec + map: + fields: + - name: retry + type: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.RetryConstraint + - name: sessionPersistence + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.SessionPersistence + - name: targetRefs + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.LocalPolicyTargetReference + elementRelationship: associative + keys: + - group + - kind + - name - name: io.k8s.sigs.gateway-api.apis.v1alpha2.GRPCRoute map: fields: @@ -1318,6 +1358,27 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: io.k8s.sigs.gateway-api.apis.v1beta1.ReferenceGrantSpec default: {} +- name: io.k8s.sigs.gateway-api.apis.v1alpha2.RequestRate + map: + fields: + - name: count + type: + scalar: numeric + - name: interval + type: + scalar: string +- name: io.k8s.sigs.gateway-api.apis.v1alpha2.RetryConstraint + map: + fields: + - name: budgetInterval + type: + scalar: string + - name: budgetPercent + type: + scalar: numeric + - name: minRetryRate + type: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.RequestRate - name: io.k8s.sigs.gateway-api.apis.v1alpha2.TCPRoute map: fields: diff --git a/apis/applyconfiguration/utils.go b/apis/applyconfiguration/utils.go index debd0d9f68..c66eabcb80 100644 --- a/apis/applyconfiguration/utils.go +++ b/apis/applyconfiguration/utils.go @@ -162,6 +162,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &apisv1alpha2.BackendLBPolicyApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("BackendLBPolicySpec"): return &apisv1alpha2.BackendLBPolicySpecApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("BackendTrafficPolicy"): + return &apisv1alpha2.BackendTrafficPolicyApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("BackendTrafficPolicySpec"): + return &apisv1alpha2.BackendTrafficPolicySpecApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("GRPCRoute"): return &apisv1alpha2.GRPCRouteApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("LocalPolicyTargetReference"): @@ -174,6 +178,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &apisv1alpha2.PolicyStatusApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("ReferenceGrant"): return &apisv1alpha2.ReferenceGrantApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("RequestRate"): + return &apisv1alpha2.RequestRateApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("RetryConstraint"): + return &apisv1alpha2.RetryConstraintApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("TCPRoute"): return &apisv1alpha2.TCPRouteApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("TCPRouteRule"): diff --git a/apis/v1alpha2/backendtrafficpolicy_types.go b/apis/v1alpha2/backendtrafficpolicy_types.go index 20db629efc..c8674bdf99 100644 --- a/apis/v1alpha2/backendtrafficpolicy_types.go +++ b/apis/v1alpha2/backendtrafficpolicy_types.go @@ -20,10 +20,19 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// +genclient +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion +// +kubebuilder:resource:categories=gateway-api,shortName=btrafficpolicy +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` +// +// BackendTrafficPolicy is a Direct Attached Policy. +// +kubebuilder:metadata:labels="gateway.networking.k8s.io/policy=Direct" + +// BackendTrafficPolicy defines the configuration for how traffic to a +// target backend should be handled. type BackendTrafficPolicy struct { - // BackendTrafficPolicy defines the configuration for how traffic to a - // target backend should be handled. - // // Support: Extended // // +optional @@ -41,6 +50,14 @@ type BackendTrafficPolicy struct { Status PolicyStatus `json:"status,omitempty"` } +// BackendTrafficPolicyList contains a list of BackendTrafficPolicies +// +kubebuilder:object:root=true +type BackendTrafficPolicyList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []BackendTrafficPolicy `json:"items"` +} + type BackendTrafficPolicySpec struct { // TargetRef identifies an API object to apply policy to. // Currently, Backends (i.e. Service, ServiceImport, or any diff --git a/apis/v1alpha2/zz_generated.deepcopy.go b/apis/v1alpha2/zz_generated.deepcopy.go index 21679ee6a1..e864499ddd 100644 --- a/apis/v1alpha2/zz_generated.deepcopy.go +++ b/apis/v1alpha2/zz_generated.deepcopy.go @@ -129,62 +129,72 @@ func (in *BackendTrafficPolicy) DeepCopy() *BackendTrafficPolicy { return out } +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BackendTrafficPolicy) 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 *BackendTrafficPolicySpec) DeepCopyInto(out *BackendTrafficPolicySpec) { +func (in *BackendTrafficPolicyList) DeepCopyInto(out *BackendTrafficPolicyList) { *out = *in - if in.TargetRefs != nil { - in, out := &in.TargetRefs, &out.TargetRefs - *out = make([]LocalPolicyTargetReference, len(*in)) - copy(*out, *in) - } - if in.Retry != nil { - in, out := &in.Retry, &out.Retry - *out = new(CommonRetryPolicy) - (*in).DeepCopyInto(*out) - } - if in.SessionPersistence != nil { - in, out := &in.SessionPersistence, &out.SessionPersistence - *out = new(v1.SessionPersistence) - (*in).DeepCopyInto(*out) + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]BackendTrafficPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendTrafficPolicySpec. -func (in *BackendTrafficPolicySpec) DeepCopy() *BackendTrafficPolicySpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendTrafficPolicyList. +func (in *BackendTrafficPolicyList) DeepCopy() *BackendTrafficPolicyList { if in == nil { return nil } - out := new(BackendTrafficPolicySpec) + out := new(BackendTrafficPolicyList) in.DeepCopyInto(out) return out } +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BackendTrafficPolicyList) 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 *CommonRetryPolicy) DeepCopyInto(out *CommonRetryPolicy) { +func (in *BackendTrafficPolicySpec) DeepCopyInto(out *BackendTrafficPolicySpec) { *out = *in - if in.BudgetPercent != nil { - in, out := &in.BudgetPercent, &out.BudgetPercent - *out = new(int) - **out = **in + if in.TargetRefs != nil { + in, out := &in.TargetRefs, &out.TargetRefs + *out = make([]LocalPolicyTargetReference, len(*in)) + copy(*out, *in) } - if in.BudgetInterval != nil { - in, out := &in.BudgetInterval, &out.BudgetInterval - *out = new(v1.Duration) - **out = **in + if in.RetryConstraint != nil { + in, out := &in.RetryConstraint, &out.RetryConstraint + *out = new(RetryConstraint) + (*in).DeepCopyInto(*out) } - if in.MinRetryRate != nil { - in, out := &in.MinRetryRate, &out.MinRetryRate - *out = new(RequestRate) + if in.SessionPersistence != nil { + in, out := &in.SessionPersistence, &out.SessionPersistence + *out = new(v1.SessionPersistence) (*in).DeepCopyInto(*out) } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonRetryPolicy. -func (in *CommonRetryPolicy) DeepCopy() *CommonRetryPolicy { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendTrafficPolicySpec. +func (in *BackendTrafficPolicySpec) DeepCopy() *BackendTrafficPolicySpec { if in == nil { return nil } - out := new(CommonRetryPolicy) + out := new(BackendTrafficPolicySpec) in.DeepCopyInto(out) return out } @@ -432,6 +442,36 @@ func (in *RequestRate) DeepCopy() *RequestRate { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RetryConstraint) DeepCopyInto(out *RetryConstraint) { + *out = *in + if in.BudgetPercent != nil { + in, out := &in.BudgetPercent, &out.BudgetPercent + *out = new(int) + **out = **in + } + if in.BudgetInterval != nil { + in, out := &in.BudgetInterval, &out.BudgetInterval + *out = new(v1.Duration) + **out = **in + } + if in.MinRetryRate != nil { + in, out := &in.MinRetryRate, &out.MinRetryRate + *out = new(RequestRate) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetryConstraint. +func (in *RetryConstraint) DeepCopy() *RetryConstraint { + if in == nil { + return nil + } + out := new(RetryConstraint) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TCPRoute) DeepCopyInto(out *TCPRoute) { *out = *in diff --git a/apis/v1alpha2/zz_generated.register.go b/apis/v1alpha2/zz_generated.register.go index 55a3b08811..52495a7675 100644 --- a/apis/v1alpha2/zz_generated.register.go +++ b/apis/v1alpha2/zz_generated.register.go @@ -64,6 +64,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { &BackendLBPolicy{}, &BackendLBPolicyList{}, &BackendTrafficPolicy{}, + &BackendTrafficPolicyList{}, &GRPCRoute{}, &GRPCRouteList{}, &ReferenceGrant{}, diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha2/apis_client.go b/pkg/client/clientset/versioned/typed/apis/v1alpha2/apis_client.go index 8431bb1688..c24039215d 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha2/apis_client.go +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha2/apis_client.go @@ -29,6 +29,7 @@ import ( type GatewayV1alpha2Interface interface { RESTClient() rest.Interface BackendLBPoliciesGetter + BackendTrafficPoliciesGetter GRPCRoutesGetter ReferenceGrantsGetter TCPRoutesGetter @@ -45,6 +46,10 @@ func (c *GatewayV1alpha2Client) BackendLBPolicies(namespace string) BackendLBPol return newBackendLBPolicies(c, namespace) } +func (c *GatewayV1alpha2Client) BackendTrafficPolicies(namespace string) BackendTrafficPolicyInterface { + return newBackendTrafficPolicies(c, namespace) +} + func (c *GatewayV1alpha2Client) GRPCRoutes(namespace string) GRPCRouteInterface { return newGRPCRoutes(c, namespace) } diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha2/backendtrafficpolicy.go b/pkg/client/clientset/versioned/typed/apis/v1alpha2/backendtrafficpolicy.go new file mode 100644 index 0000000000..cda9a3272d --- /dev/null +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha2/backendtrafficpolicy.go @@ -0,0 +1,73 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" + apisv1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" + v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" + scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" +) + +// BackendTrafficPoliciesGetter has a method to return a BackendTrafficPolicyInterface. +// A group's client should implement this interface. +type BackendTrafficPoliciesGetter interface { + BackendTrafficPolicies(namespace string) BackendTrafficPolicyInterface +} + +// BackendTrafficPolicyInterface has methods to work with BackendTrafficPolicy resources. +type BackendTrafficPolicyInterface interface { + Create(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.CreateOptions) (*v1alpha2.BackendTrafficPolicy, error) + Update(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.UpdateOptions) (*v1alpha2.BackendTrafficPolicy, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.UpdateOptions) (*v1alpha2.BackendTrafficPolicy, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.BackendTrafficPolicy, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.BackendTrafficPolicyList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.BackendTrafficPolicy, err error) + Apply(ctx context.Context, backendTrafficPolicy *apisv1alpha2.BackendTrafficPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendTrafficPolicy, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, backendTrafficPolicy *apisv1alpha2.BackendTrafficPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendTrafficPolicy, err error) + BackendTrafficPolicyExpansion +} + +// backendTrafficPolicies implements BackendTrafficPolicyInterface +type backendTrafficPolicies struct { + *gentype.ClientWithListAndApply[*v1alpha2.BackendTrafficPolicy, *v1alpha2.BackendTrafficPolicyList, *apisv1alpha2.BackendTrafficPolicyApplyConfiguration] +} + +// newBackendTrafficPolicies returns a BackendTrafficPolicies +func newBackendTrafficPolicies(c *GatewayV1alpha2Client, namespace string) *backendTrafficPolicies { + return &backendTrafficPolicies{ + gentype.NewClientWithListAndApply[*v1alpha2.BackendTrafficPolicy, *v1alpha2.BackendTrafficPolicyList, *apisv1alpha2.BackendTrafficPolicyApplyConfiguration]( + "backendtrafficpolicies", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha2.BackendTrafficPolicy { return &v1alpha2.BackendTrafficPolicy{} }, + func() *v1alpha2.BackendTrafficPolicyList { return &v1alpha2.BackendTrafficPolicyList{} }), + } +} diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_apis_client.go b/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_apis_client.go index 7ea0de6477..b50a66de8b 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_apis_client.go +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_apis_client.go @@ -32,6 +32,10 @@ func (c *FakeGatewayV1alpha2) BackendLBPolicies(namespace string) v1alpha2.Backe return &FakeBackendLBPolicies{c, namespace} } +func (c *FakeGatewayV1alpha2) BackendTrafficPolicies(namespace string) v1alpha2.BackendTrafficPolicyInterface { + return &FakeBackendTrafficPolicies{c, namespace} +} + func (c *FakeGatewayV1alpha2) GRPCRoutes(namespace string) v1alpha2.GRPCRouteInterface { return &FakeGRPCRoutes{c, namespace} } diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_backendtrafficpolicy.go b/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_backendtrafficpolicy.go new file mode 100644 index 0000000000..a67e1275bf --- /dev/null +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_backendtrafficpolicy.go @@ -0,0 +1,197 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1 "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" + apisv1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" + v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" +) + +// FakeBackendTrafficPolicies implements BackendTrafficPolicyInterface +type FakeBackendTrafficPolicies struct { + Fake *FakeGatewayV1alpha2 + ns string +} + +var backendtrafficpoliciesResource = v1alpha2.SchemeGroupVersion.WithResource("backendtrafficpolicies") + +var backendtrafficpoliciesKind = v1alpha2.SchemeGroupVersion.WithKind("BackendTrafficPolicy") + +// Get takes name of the backendTrafficPolicy, and returns the corresponding backendTrafficPolicy object, and an error if there is any. +func (c *FakeBackendTrafficPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { + emptyResult := &v1alpha2.BackendTrafficPolicy{} + obj, err := c.Fake. + Invokes(testing.NewGetActionWithOptions(backendtrafficpoliciesResource, c.ns, name, options), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha2.BackendTrafficPolicy), err +} + +// List takes label and field selectors, and returns the list of BackendTrafficPolicies that match those selectors. +func (c *FakeBackendTrafficPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.BackendTrafficPolicyList, err error) { + emptyResult := &v1alpha2.BackendTrafficPolicyList{} + obj, err := c.Fake. + Invokes(testing.NewListActionWithOptions(backendtrafficpoliciesResource, backendtrafficpoliciesKind, c.ns, opts), emptyResult) + + if obj == nil { + return emptyResult, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha2.BackendTrafficPolicyList{ListMeta: obj.(*v1alpha2.BackendTrafficPolicyList).ListMeta} + for _, item := range obj.(*v1alpha2.BackendTrafficPolicyList).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 backendTrafficPolicies. +func (c *FakeBackendTrafficPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchActionWithOptions(backendtrafficpoliciesResource, c.ns, opts)) + +} + +// Create takes the representation of a backendTrafficPolicy and creates it. Returns the server's representation of the backendTrafficPolicy, and an error, if there is any. +func (c *FakeBackendTrafficPolicies) Create(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.CreateOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { + emptyResult := &v1alpha2.BackendTrafficPolicy{} + obj, err := c.Fake. + Invokes(testing.NewCreateActionWithOptions(backendtrafficpoliciesResource, c.ns, backendTrafficPolicy, opts), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha2.BackendTrafficPolicy), err +} + +// Update takes the representation of a backendTrafficPolicy and updates it. Returns the server's representation of the backendTrafficPolicy, and an error, if there is any. +func (c *FakeBackendTrafficPolicies) Update(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.UpdateOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { + emptyResult := &v1alpha2.BackendTrafficPolicy{} + obj, err := c.Fake. + Invokes(testing.NewUpdateActionWithOptions(backendtrafficpoliciesResource, c.ns, backendTrafficPolicy, opts), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha2.BackendTrafficPolicy), 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 *FakeBackendTrafficPolicies) UpdateStatus(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.UpdateOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { + emptyResult := &v1alpha2.BackendTrafficPolicy{} + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceActionWithOptions(backendtrafficpoliciesResource, "status", c.ns, backendTrafficPolicy, opts), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha2.BackendTrafficPolicy), err +} + +// Delete takes name of the backendTrafficPolicy and deletes it. Returns an error if one occurs. +func (c *FakeBackendTrafficPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(backendtrafficpoliciesResource, c.ns, name, opts), &v1alpha2.BackendTrafficPolicy{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeBackendTrafficPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionActionWithOptions(backendtrafficpoliciesResource, c.ns, opts, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha2.BackendTrafficPolicyList{}) + return err +} + +// Patch applies the patch and returns the patched backendTrafficPolicy. +func (c *FakeBackendTrafficPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.BackendTrafficPolicy, err error) { + emptyResult := &v1alpha2.BackendTrafficPolicy{} + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceActionWithOptions(backendtrafficpoliciesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha2.BackendTrafficPolicy), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied backendTrafficPolicy. +func (c *FakeBackendTrafficPolicies) Apply(ctx context.Context, backendTrafficPolicy *apisv1alpha2.BackendTrafficPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { + if backendTrafficPolicy == nil { + return nil, fmt.Errorf("backendTrafficPolicy provided to Apply must not be nil") + } + data, err := json.Marshal(backendTrafficPolicy) + if err != nil { + return nil, err + } + name := backendTrafficPolicy.Name + if name == nil { + return nil, fmt.Errorf("backendTrafficPolicy.Name must be provided to Apply") + } + emptyResult := &v1alpha2.BackendTrafficPolicy{} + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceActionWithOptions(backendtrafficpoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha2.BackendTrafficPolicy), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeBackendTrafficPolicies) ApplyStatus(ctx context.Context, backendTrafficPolicy *apisv1alpha2.BackendTrafficPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { + if backendTrafficPolicy == nil { + return nil, fmt.Errorf("backendTrafficPolicy provided to Apply must not be nil") + } + data, err := json.Marshal(backendTrafficPolicy) + if err != nil { + return nil, err + } + name := backendTrafficPolicy.Name + if name == nil { + return nil, fmt.Errorf("backendTrafficPolicy.Name must be provided to Apply") + } + emptyResult := &v1alpha2.BackendTrafficPolicy{} + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceActionWithOptions(backendtrafficpoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha2.BackendTrafficPolicy), err +} diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha2/generated_expansion.go b/pkg/client/clientset/versioned/typed/apis/v1alpha2/generated_expansion.go index c0fe07b497..c7a03b33fa 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha2/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha2/generated_expansion.go @@ -20,6 +20,8 @@ package v1alpha2 type BackendLBPolicyExpansion interface{} +type BackendTrafficPolicyExpansion interface{} + type GRPCRouteExpansion interface{} type ReferenceGrantExpansion interface{} diff --git a/pkg/client/informers/externalversions/apis/v1alpha2/backendtrafficpolicy.go b/pkg/client/informers/externalversions/apis/v1alpha2/backendtrafficpolicy.go new file mode 100644 index 0000000000..2afda1c5f7 --- /dev/null +++ b/pkg/client/informers/externalversions/apis/v1alpha2/backendtrafficpolicy.go @@ -0,0 +1,90 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + "context" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + apisv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" + versioned "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned" + internalinterfaces "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/internalinterfaces" + v1alpha2 "sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2" +) + +// BackendTrafficPolicyInformer provides access to a shared informer and lister for +// BackendTrafficPolicies. +type BackendTrafficPolicyInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha2.BackendTrafficPolicyLister +} + +type backendTrafficPolicyInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewBackendTrafficPolicyInformer constructs a new informer for BackendTrafficPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewBackendTrafficPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredBackendTrafficPolicyInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredBackendTrafficPolicyInformer constructs a new informer for BackendTrafficPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredBackendTrafficPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GatewayV1alpha2().BackendTrafficPolicies(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GatewayV1alpha2().BackendTrafficPolicies(namespace).Watch(context.TODO(), options) + }, + }, + &apisv1alpha2.BackendTrafficPolicy{}, + resyncPeriod, + indexers, + ) +} + +func (f *backendTrafficPolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredBackendTrafficPolicyInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *backendTrafficPolicyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apisv1alpha2.BackendTrafficPolicy{}, f.defaultInformer) +} + +func (f *backendTrafficPolicyInformer) Lister() v1alpha2.BackendTrafficPolicyLister { + return v1alpha2.NewBackendTrafficPolicyLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/informers/externalversions/apis/v1alpha2/interface.go b/pkg/client/informers/externalversions/apis/v1alpha2/interface.go index 8f21c3d8e6..cd253ab0ae 100644 --- a/pkg/client/informers/externalversions/apis/v1alpha2/interface.go +++ b/pkg/client/informers/externalversions/apis/v1alpha2/interface.go @@ -26,6 +26,8 @@ import ( type Interface interface { // BackendLBPolicies returns a BackendLBPolicyInformer. BackendLBPolicies() BackendLBPolicyInformer + // BackendTrafficPolicies returns a BackendTrafficPolicyInformer. + BackendTrafficPolicies() BackendTrafficPolicyInformer // GRPCRoutes returns a GRPCRouteInformer. GRPCRoutes() GRPCRouteInformer // ReferenceGrants returns a ReferenceGrantInformer. @@ -54,6 +56,11 @@ func (v *version) BackendLBPolicies() BackendLBPolicyInformer { return &backendLBPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } +// BackendTrafficPolicies returns a BackendTrafficPolicyInformer. +func (v *version) BackendTrafficPolicies() BackendTrafficPolicyInformer { + return &backendTrafficPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + // GRPCRoutes returns a GRPCRouteInformer. func (v *version) GRPCRoutes() GRPCRouteInformer { return &gRPCRouteInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index 283d2475b2..88f2ce2ce3 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -68,6 +68,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource // Group=gateway.networking.k8s.io, Version=v1alpha2 case v1alpha2.SchemeGroupVersion.WithResource("backendlbpolicies"): return &genericInformer{resource: resource.GroupResource(), informer: f.Gateway().V1alpha2().BackendLBPolicies().Informer()}, nil + case v1alpha2.SchemeGroupVersion.WithResource("backendtrafficpolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Gateway().V1alpha2().BackendTrafficPolicies().Informer()}, nil case v1alpha2.SchemeGroupVersion.WithResource("grpcroutes"): return &genericInformer{resource: resource.GroupResource(), informer: f.Gateway().V1alpha2().GRPCRoutes().Informer()}, nil case v1alpha2.SchemeGroupVersion.WithResource("referencegrants"): diff --git a/pkg/client/listers/apis/v1alpha2/backendtrafficpolicy.go b/pkg/client/listers/apis/v1alpha2/backendtrafficpolicy.go new file mode 100644 index 0000000000..5c79f7300b --- /dev/null +++ b/pkg/client/listers/apis/v1alpha2/backendtrafficpolicy.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" + "k8s.io/client-go/tools/cache" + v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" +) + +// BackendTrafficPolicyLister helps list BackendTrafficPolicies. +// All objects returned here must be treated as read-only. +type BackendTrafficPolicyLister interface { + // List lists all BackendTrafficPolicies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha2.BackendTrafficPolicy, err error) + // BackendTrafficPolicies returns an object that can list and get BackendTrafficPolicies. + BackendTrafficPolicies(namespace string) BackendTrafficPolicyNamespaceLister + BackendTrafficPolicyListerExpansion +} + +// backendTrafficPolicyLister implements the BackendTrafficPolicyLister interface. +type backendTrafficPolicyLister struct { + listers.ResourceIndexer[*v1alpha2.BackendTrafficPolicy] +} + +// NewBackendTrafficPolicyLister returns a new BackendTrafficPolicyLister. +func NewBackendTrafficPolicyLister(indexer cache.Indexer) BackendTrafficPolicyLister { + return &backendTrafficPolicyLister{listers.New[*v1alpha2.BackendTrafficPolicy](indexer, v1alpha2.Resource("backendtrafficpolicy"))} +} + +// BackendTrafficPolicies returns an object that can list and get BackendTrafficPolicies. +func (s *backendTrafficPolicyLister) BackendTrafficPolicies(namespace string) BackendTrafficPolicyNamespaceLister { + return backendTrafficPolicyNamespaceLister{listers.NewNamespaced[*v1alpha2.BackendTrafficPolicy](s.ResourceIndexer, namespace)} +} + +// BackendTrafficPolicyNamespaceLister helps list and get BackendTrafficPolicies. +// All objects returned here must be treated as read-only. +type BackendTrafficPolicyNamespaceLister interface { + // List lists all BackendTrafficPolicies in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha2.BackendTrafficPolicy, err error) + // Get retrieves the BackendTrafficPolicy from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha2.BackendTrafficPolicy, error) + BackendTrafficPolicyNamespaceListerExpansion +} + +// backendTrafficPolicyNamespaceLister implements the BackendTrafficPolicyNamespaceLister +// interface. +type backendTrafficPolicyNamespaceLister struct { + listers.ResourceIndexer[*v1alpha2.BackendTrafficPolicy] +} diff --git a/pkg/client/listers/apis/v1alpha2/expansion_generated.go b/pkg/client/listers/apis/v1alpha2/expansion_generated.go index d311d49157..98516d30c3 100644 --- a/pkg/client/listers/apis/v1alpha2/expansion_generated.go +++ b/pkg/client/listers/apis/v1alpha2/expansion_generated.go @@ -26,6 +26,14 @@ type BackendLBPolicyListerExpansion interface{} // BackendLBPolicyNamespaceLister. type BackendLBPolicyNamespaceListerExpansion interface{} +// BackendTrafficPolicyListerExpansion allows custom methods to be added to +// BackendTrafficPolicyLister. +type BackendTrafficPolicyListerExpansion interface{} + +// BackendTrafficPolicyNamespaceListerExpansion allows custom methods to be added to +// BackendTrafficPolicyNamespaceLister. +type BackendTrafficPolicyNamespaceListerExpansion interface{} + // GRPCRouteListerExpansion allows custom methods to be added to // GRPCRouteLister. type GRPCRouteListerExpansion interface{} diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go index 568e51dbc1..2617bf58f4 100644 --- a/pkg/generated/openapi/zz_generated.openapi.go +++ b/pkg/generated/openapi/zz_generated.openapi.go @@ -150,8 +150,8 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendLBPolicyList": schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendLBPolicyList(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendLBPolicySpec": schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendLBPolicySpec(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendTrafficPolicy": schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendTrafficPolicy(ref), + "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendTrafficPolicyList": schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendTrafficPolicyList(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendTrafficPolicySpec": schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendTrafficPolicySpec(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.CommonRetryPolicy": schema_sigsk8sio_gateway_api_apis_v1alpha2_CommonRetryPolicy(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.GRPCRoute": schema_sigsk8sio_gateway_api_apis_v1alpha2_GRPCRoute(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.GRPCRouteList": schema_sigsk8sio_gateway_api_apis_v1alpha2_GRPCRouteList(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.LocalPolicyTargetReference": schema_sigsk8sio_gateway_api_apis_v1alpha2_LocalPolicyTargetReference(ref), @@ -162,6 +162,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "sigs.k8s.io/gateway-api/apis/v1alpha2.ReferenceGrant": schema_sigsk8sio_gateway_api_apis_v1alpha2_ReferenceGrant(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.ReferenceGrantList": schema_sigsk8sio_gateway_api_apis_v1alpha2_ReferenceGrantList(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.RequestRate": schema_sigsk8sio_gateway_api_apis_v1alpha2_RequestRate(ref), + "sigs.k8s.io/gateway-api/apis/v1alpha2.RetryConstraint": schema_sigsk8sio_gateway_api_apis_v1alpha2_RetryConstraint(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.TCPRoute": schema_sigsk8sio_gateway_api_apis_v1alpha2_TCPRoute(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.TCPRouteList": schema_sigsk8sio_gateway_api_apis_v1alpha2_TCPRouteList(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.TCPRouteRule": schema_sigsk8sio_gateway_api_apis_v1alpha2_TCPRouteRule(ref), @@ -5824,7 +5825,8 @@ func schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendTrafficPolicy(ref common. return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, + Description: "BackendTrafficPolicy defines the configuration for how traffic to a target backend should be handled.", + Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { SchemaProps: spec.SchemaProps{ @@ -5869,6 +5871,55 @@ func schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendTrafficPolicy(ref common. } } +func schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendTrafficPolicyList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "BackendTrafficPolicyList contains a list of BackendTrafficPolicies", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.BackendTrafficPolicy"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendTrafficPolicy"}, + } +} + func schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendTrafficPolicySpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -5901,8 +5952,8 @@ func schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendTrafficPolicySpec(ref com }, "retry": { SchemaProps: spec.SchemaProps{ - Description: "Retry defines the configuration for when to allow or prevent retries to a target backend.\n\nWhile the static number of retries performed by the client are configured within HTTPRoute Retry stanzas, configuring the CommonRetryPolicy allows you to constrain further retries after a dynamic budget for retries has been exceeded.\n\nSupport: Extended\n\n", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.CommonRetryPolicy"), + Description: "RetryConstraint defines the configuration for when to allow or prevent retries to a target backend.\n\nWhile the static number of retries performed by the client are configured within HTTPRoute Retry stanzas, configuring the RetryConstraint allows you to constrain further retries after a dynamic budget for retries has been exceeded.\n\nSupport: Extended\n\n", + Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.RetryConstraint"), }, }, "sessionPersistence": { @@ -5916,42 +5967,7 @@ func schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendTrafficPolicySpec(ref com }, }, Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.SessionPersistence", "sigs.k8s.io/gateway-api/apis/v1alpha2.CommonRetryPolicy", "sigs.k8s.io/gateway-api/apis/v1alpha2.LocalPolicyTargetReference"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_CommonRetryPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CommonRetryPolicy defines the configuration for when to retry a request.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "budgetPercent": { - SchemaProps: spec.SchemaProps{ - Description: "BudgetPercent defines the maximum percentage of active requests that may be made up of retries.\n\nSupport: Extended", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "budgetInterval": { - SchemaProps: spec.SchemaProps{ - Description: "BudgetInterval defines the duration in which requests will be considered for calculating the budget for retries.\n\nSupport: Extended", - Type: []string{"string"}, - Format: "", - }, - }, - "minRetryRate": { - SchemaProps: spec.SchemaProps{ - Description: "MinRetryRate defines the minimum rate of retries that will be allowable over a specified duration of time.\n\nThis ensures that requests can still be retried during periods of low traffic, where the budget for retries may be calculated as a very low value.\n\nSupport: Extended", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.RequestRate"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1alpha2.RequestRate"}, + "sigs.k8s.io/gateway-api/apis/v1.SessionPersistence", "sigs.k8s.io/gateway-api/apis/v1alpha2.LocalPolicyTargetReference", "sigs.k8s.io/gateway-api/apis/v1alpha2.RetryConstraint"}, } } @@ -6380,6 +6396,41 @@ func schema_sigsk8sio_gateway_api_apis_v1alpha2_RequestRate(ref common.Reference } } +func schema_sigsk8sio_gateway_api_apis_v1alpha2_RetryConstraint(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "RetryConstraint defines the configuration for when to retry a request.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "budgetPercent": { + SchemaProps: spec.SchemaProps{ + Description: "BudgetPercent defines the maximum percentage of active requests that may be made up of retries.\n\nSupport: Extended", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "budgetInterval": { + SchemaProps: spec.SchemaProps{ + Description: "BudgetInterval defines the duration in which requests will be considered for calculating the budget for retries.\n\nSupport: Extended", + Type: []string{"string"}, + Format: "", + }, + }, + "minRetryRate": { + SchemaProps: spec.SchemaProps{ + Description: "MinRetryRate defines the minimum rate of retries that will be allowable over a specified duration of time.\n\nThis ensures that requests can still be retried during periods of low traffic, where the budget for retries may be calculated as a very low value.\n\nSupport: Extended", + Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.RequestRate"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/gateway-api/apis/v1alpha2.RequestRate"}, + } +} + func schema_sigsk8sio_gateway_api_apis_v1alpha2_TCPRoute(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ From 5f2b55b07cb279b96ff9ecba49ecb652c3359ffb Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Wed, 12 Feb 2025 11:52:55 -0500 Subject: [PATCH 10/32] Fleshing out the description for RetryConstraint --- apis/v1alpha2/backendtrafficpolicy_types.go | 35 ++++++++++++++----- pkg/generated/openapi/zz_generated.openapi.go | 5 +-- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/apis/v1alpha2/backendtrafficpolicy_types.go b/apis/v1alpha2/backendtrafficpolicy_types.go index c8674bdf99..4b0b3aca61 100644 --- a/apis/v1alpha2/backendtrafficpolicy_types.go +++ b/apis/v1alpha2/backendtrafficpolicy_types.go @@ -37,8 +37,6 @@ type BackendTrafficPolicy struct { // // +optional // - // - // Note: there is no Override or Default policy configuration. metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` @@ -58,11 +56,14 @@ type BackendTrafficPolicyList struct { Items []BackendTrafficPolicy `json:"items"` } +// BackendTrafficPolicySpec define the desired state of BackendTrafficPolicy +// Note: there is no Override or Default policy configuration. type BackendTrafficPolicySpec struct { // TargetRef identifies an API object to apply policy to. // Currently, Backends (i.e. Service, ServiceImport, or any // implementation-specific backendRef) are the only valid API // target references. + // // +listType=map // +listMapKey=group // +listMapKey=kind @@ -71,13 +72,31 @@ type BackendTrafficPolicySpec struct { // +kubebuilder:validation:MaxItems=16 TargetRefs []LocalPolicyTargetReference `json:"targetRefs"` - // RetryConstraint defines the configuration for when to allow or prevent retries to a - // target backend. + // RetryConstraint defines the configuration for when to allow or prevent + // further retries to a target backend by dynamically calculating a 'retry + // budget'. This budget is calculated based on the percentage of incoming + // traffic composed of retries over a given time interval. Once the budget + // is exceeded, additional retries will be rejected by the backend. + // + // For example, if the retry budget interval is 10 seconds, there have been + // 1000 active requests in the past 10 seconds, and the allowed percentage + // of requests that can be retried is 20% (the default), then 200 of those + // requests may be composed of retries. Active requests will only be + // considered for the duration of the interval when calculating the retry + // budget. + // + // Configuring a RetryConstraint in BackendTrafficPolicy is compatible with + // HTTPRoute Retry settings for each HTTPRouteRule that targets the same + // backend. While the HTTPRouteRule Retry stanza can specify whether a + // request should be retried and the number of retry attempts each client + // may perform, RetryConstraint helps prevent cascading failures, such as + // retry storms, during periods of consistent failures. + // + // After the retry budget has been exceeded, additional retries to the + // backend must return a 503 response to the client. // - // While the static number of retries performed by the client are - // configured within HTTPRoute Retry stanzas, configuring the - // RetryConstraint allows you to constrain further retries after a - // dynamic budget for retries has been exceeded. + // Additional configurations for defining a constraint on retries MAY be + // defined in the future. // // Support: Extended // diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go index 2617bf58f4..11a1e89248 100644 --- a/pkg/generated/openapi/zz_generated.openapi.go +++ b/pkg/generated/openapi/zz_generated.openapi.go @@ -5924,7 +5924,8 @@ func schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendTrafficPolicySpec(ref com return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, + Description: "BackendTrafficPolicySpec define the desired state of BackendTrafficPolicy Note: there is no Override or Default policy configuration.", + Type: []string{"object"}, Properties: map[string]spec.Schema{ "targetRefs": { VendorExtensible: spec.VendorExtensible{ @@ -5952,7 +5953,7 @@ func schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendTrafficPolicySpec(ref com }, "retry": { SchemaProps: spec.SchemaProps{ - Description: "RetryConstraint defines the configuration for when to allow or prevent retries to a target backend.\n\nWhile the static number of retries performed by the client are configured within HTTPRoute Retry stanzas, configuring the RetryConstraint allows you to constrain further retries after a dynamic budget for retries has been exceeded.\n\nSupport: Extended\n\n", + Description: "RetryConstraint defines the configuration for when to allow or prevent further retries to a target backend by dynamically calculating a 'retry budget'. This budget is calculated based on the percentage of incoming traffic composed of retries over a given time interval. Once the budget is exceeded, additional retries will be rejected by the backend.\n\nFor example, if the retry budget interval is 10 seconds, there have been 1000 active requests in the past 10 seconds, and the allowed percentage of requests that can be retried is 20% (the default), then 200 of those requests may be composed of retries. Active requests will only be considered for the duration of the interval when calculating the retry budget.\n\nConfiguring a RetryConstraint in BackendTrafficPolicy is compatible with HTTPRoute Retry settings for each HTTPRouteRule that targets the same backend. While the HTTPRouteRule Retry stanza can specify whether a request should be retried and the number of retry attempts each client may perform, RetryConstraint helps prevent cascading failures, such as retry storms, during periods of consistent failures.\n\nAfter the retry budget has been exceeded, additional retries to the backend must return a 503 response to the client.\n\nAdditional configurations for defining a constraint on retries MAY be defined in the future.\n\nSupport: Extended\n\n", Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.RetryConstraint"), }, }, From d6bcae54db0c79742bda95dd86c9c3e440db4683 Mon Sep 17 00:00:00 2001 From: Dave Protasowski Date: Mon, 3 Feb 2025 16:42:45 -0500 Subject: [PATCH 11/32] refactor codegen scripts to make it easier to generate two clients --- .../openapi/zz_generated.openapi.go | 0 cmd/modelschema/main.go | 4 +- hack/update-clientset.sh | 122 +++++++++++ hack/update-codegen.sh | 197 +----------------- hack/update-protos.sh | 94 +++++++++ pkg/client/clientset/versioned/clientset.go | 24 +-- .../versioned/fake/clientset_generated.go | 10 +- .../clientset/versioned/fake/register.go | 2 +- .../clientset/versioned/scheme/register.go | 2 +- 9 files changed, 239 insertions(+), 216 deletions(-) rename {pkg/generated => apis}/openapi/zz_generated.openapi.go (100%) create mode 100755 hack/update-clientset.sh create mode 100755 hack/update-protos.sh diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/apis/openapi/zz_generated.openapi.go similarity index 100% rename from pkg/generated/openapi/zz_generated.openapi.go rename to apis/openapi/zz_generated.openapi.go diff --git a/cmd/modelschema/main.go b/cmd/modelschema/main.go index 42713567e5..a04294ace5 100644 --- a/cmd/modelschema/main.go +++ b/cmd/modelschema/main.go @@ -24,7 +24,7 @@ import ( "os" "strings" - openapi "sigs.k8s.io/gateway-api/pkg/generated/openapi" + stable "sigs.k8s.io/gateway-api/apis/openapi" "k8s.io/kube-openapi/pkg/common" "k8s.io/kube-openapi/pkg/validation/spec" @@ -43,7 +43,7 @@ func output() error { refFunc := func(name string) spec.Ref { return spec.MustCreateRef(fmt.Sprintf("#/definitions/%s", friendlyName(name))) } - defs := openapi.GetOpenAPIDefinitions(refFunc) + defs := stable.GetOpenAPIDefinitions(refFunc) schemaDefs := make(map[string]spec.Schema, len(defs)) for k, v := range defs { // Replace top-level schema with v2 if a v2 schema is embedded diff --git a/hack/update-clientset.sh b/hack/update-clientset.sh new file mode 100755 index 0000000000..62894d4b5c --- /dev/null +++ b/hack/update-clientset.sh @@ -0,0 +1,122 @@ +#!/usr/bin/env bash + +# Copyright 2025 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -o errexit +set -o nounset +set -o pipefail + + +if [[ "${1:-stable}" == "experimental" ]]; then + readonly API_PATH="apisx" +else + readonly API_PATH="apis" +fi + +readonly SCRIPT_ROOT="$(cd "$(dirname "${BASH_SOURCE}")"/.. && pwd)" + +if [[ "${VERIFY_CODEGEN:-}" == "true" ]]; then + echo "Running in verification mode" + readonly VERIFY_FLAG="--verify-only" +fi + +readonly COMMON_FLAGS="${VERIFY_FLAG:-} --go-header-file ${SCRIPT_ROOT}/hack/boilerplate/boilerplate.generatego.txt" + +readonly APIS_PKG=sigs.k8s.io/gateway-api +readonly CLIENTSET_NAME=versioned +readonly CLIENTSET_PKG_NAME=clientset +readonly VERSIONS=($(find ./${API_PATH} -maxdepth 1 -name "v*" -exec bash -c 'basename {}' \; | xargs)) + +if [[ "${1:-stable}" == "experimental" ]]; then + readonly OUTPUT_DIR=pkg/clientx + readonly OUTPUT_PKG=sigs.k8s.io/gateway-api/pkg/clientx +else + readonly OUTPUT_DIR=pkg/client + readonly OUTPUT_PKG=sigs.k8s.io/gateway-api/pkg/client +fi + +GATEWAY_INPUT_DIRS_SPACE="" +GATEWAY_INPUT_DIRS_COMMA="" +for VERSION in "${VERSIONS[@]}" +do + GATEWAY_INPUT_DIRS_SPACE+="${APIS_PKG}/${API_PATH}/${VERSION} " + GATEWAY_INPUT_DIRS_COMMA+="${APIS_PKG}/${API_PATH}/${VERSION}," +done +GATEWAY_INPUT_DIRS_SPACE="${GATEWAY_INPUT_DIRS_SPACE%,}" # drop trailing space +GATEWAY_INPUT_DIRS_COMMA="${GATEWAY_INPUT_DIRS_COMMA%,}" # drop trailing comma + +# throw away +new_report="$(mktemp -t "$(basename "$0").api_violations.XXXXXX")" + +echo "Generating openapi schema" +go run k8s.io/kube-openapi/cmd/openapi-gen \ + --output-file zz_generated.openapi.go \ + --report-filename "${new_report}" \ + --output-dir "${API_PATH}/openapi" \ + --output-pkg "sigs.k8s.io/gateway-api/${API_PATH}/openapi" \ + ${COMMON_FLAGS} \ + $GATEWAY_INPUT_DIRS_SPACE \ + k8s.io/apimachinery/pkg/apis/meta/v1 \ + k8s.io/apimachinery/pkg/runtime \ + k8s.io/apimachinery/pkg/version + + +echo "Generating apply configuration" +go run k8s.io/code-generator/cmd/applyconfiguration-gen \ + --openapi-schema <(go run ${SCRIPT_ROOT}/cmd/modelschema) \ + --output-dir "${API_PATH}/applyconfiguration" \ + --output-pkg "${APIS_PKG}/${API_PATH}/applyconfiguration" \ + ${COMMON_FLAGS} \ + ${GATEWAY_INPUT_DIRS_SPACE} + +echo "Generating clientset at ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME}" +go run k8s.io/code-generator/cmd/client-gen \ + --clientset-name "${CLIENTSET_NAME}" \ + --input-base "${APIS_PKG}" \ + --input "${GATEWAY_INPUT_DIRS_COMMA//${APIS_PKG}/}" \ + --output-dir "${OUTPUT_DIR}/${CLIENTSET_PKG_NAME}" \ + --output-pkg "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME}" \ + --apply-configuration-package "${APIS_PKG}/${API_PATH}/applyconfiguration" \ + ${COMMON_FLAGS} + +echo "Generating listers at ${OUTPUT_PKG}/listers" +go run k8s.io/code-generator/cmd/lister-gen \ + --output-dir "${OUTPUT_DIR}/listers" \ + --output-pkg "${OUTPUT_PKG}/listers" \ + ${COMMON_FLAGS} \ + ${GATEWAY_INPUT_DIRS_SPACE} + +echo "Generating informers at ${OUTPUT_PKG}/informers" +go run k8s.io/code-generator/cmd/informer-gen \ + --versioned-clientset-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME}/${CLIENTSET_NAME}" \ + --listers-package "${OUTPUT_PKG}/listers" \ + --output-dir "${OUTPUT_DIR}/informers" \ + --output-pkg "${OUTPUT_PKG}/informers" \ + ${COMMON_FLAGS} \ + ${GATEWAY_INPUT_DIRS_SPACE} + +echo "Generating ${VERSION} register at ${APIS_PKG}/${API_PATH}/${VERSION}" +go run k8s.io/code-generator/cmd/register-gen \ + --output-file zz_generated.register.go \ + ${COMMON_FLAGS} \ + ${GATEWAY_INPUT_DIRS_SPACE} + +for VERSION in "${VERSIONS[@]}" +do + echo "Generating ${VERSION} deepcopy at ${APIS_PKG}/${API_PATH}/${VERSION}" + go run sigs.k8s.io/controller-tools/cmd/controller-gen \ + object:headerFile=${SCRIPT_ROOT}/hack/boilerplate/boilerplate.generatego.txt \ + paths="${APIS_PKG}/${API_PATH}/${VERSION}" +done \ No newline at end of file diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 2608fc2c4f..9aa562dd7c 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -46,202 +46,9 @@ export GOMODCACHE GO111MODULE GOFLAGS GOPATH mkdir -p "$GOPATH/src/sigs.k8s.io" ln -s "${SCRIPT_ROOT}" "$GOPATH/src/sigs.k8s.io/gateway-api" -readonly OUTPUT_PKG=sigs.k8s.io/gateway-api/pkg/client -readonly APIS_PKG=sigs.k8s.io/gateway-api -readonly CLIENTSET_NAME=versioned -readonly CLIENTSET_PKG_NAME=clientset -readonly VERSIONS=(v1alpha2 v1alpha3 v1beta1 v1) - -GATEWAY_INPUT_DIRS_SPACE="" -GATEWAY_INPUT_DIRS_COMMA="" -for VERSION in "${VERSIONS[@]}" -do - GATEWAY_INPUT_DIRS_SPACE+="${APIS_PKG}/apis/${VERSION} " - GATEWAY_INPUT_DIRS_COMMA+="${APIS_PKG}/apis/${VERSION}," -done -GATEWAY_INPUT_DIRS_SPACE="${GATEWAY_INPUT_DIRS_SPACE%,}" # drop trailing space -GATEWAY_INPUT_DIRS_COMMA="${GATEWAY_INPUT_DIRS_COMMA%,}" # drop trailing comma - - -if [[ "${VERIFY_CODEGEN:-}" == "true" ]]; then - echo "Running in verification mode" - readonly VERIFY_FLAG="--verify-only" -fi - -readonly COMMON_FLAGS="${VERIFY_FLAG:-} --go-header-file ${SCRIPT_ROOT}/hack/boilerplate/boilerplate.generatego.txt" - echo "Generating CRDs" go run ./pkg/generator -# throw away -new_report="$(mktemp -t "$(basename "$0").api_violations.XXXXXX")" - -echo "Generating openapi schema" -go run k8s.io/kube-openapi/cmd/openapi-gen \ - --output-file zz_generated.openapi.go \ - --report-filename "${new_report}" \ - --output-dir "pkg/generated/openapi" \ - --output-pkg "sigs.k8s.io/gateway-api/pkg/generated/openapi" \ - ${COMMON_FLAGS} \ - $GATEWAY_INPUT_DIRS_SPACE \ - k8s.io/apimachinery/pkg/apis/meta/v1 \ - k8s.io/apimachinery/pkg/runtime \ - k8s.io/apimachinery/pkg/version - - -echo "Generating apply configuration" -go run k8s.io/code-generator/cmd/applyconfiguration-gen \ - --openapi-schema <(go run ${SCRIPT_ROOT}/cmd/modelschema) \ - --output-dir "apis/applyconfiguration" \ - --output-pkg "${APIS_PKG}/apis/applyconfiguration" \ - ${COMMON_FLAGS} \ - ${GATEWAY_INPUT_DIRS_SPACE} - - -# Temporary hack until https://github.com/kubernetes/kubernetes/pull/124371 is released -function fix_applyconfiguration() { - local package="$1" - local version="$(basename $1)" - - echo $package - echo $version - pushd $package > /dev/null - - # Replace import - for filename in *.go; do - import_line=$(grep "$package" "$filename") - if [[ -z "$import_line" ]]; then - continue - fi - import_prefix=$(echo "$import_line" | awk '{print $1}') - sed -i'.bak' -e "s,${import_prefix} \"sigs.k8s.io/gateway-api/${package}\",,g" "$filename" - sed -i'.bak' -e "s,\[\]${import_prefix}\.,\[\],g" "$filename" - sed -i'.bak' -e "s,&${import_prefix}\.,&,g" "$filename" - sed -i'.bak' -e "s,*${import_prefix}\.,*,g" "$filename" - sed -i'.bak' -e "s,^\t${import_prefix}\.,,g" "$filename" - done - - rm *.bak - go fmt . - find . -type f -name "*.go" -exec sed -i'.bak' -e "s,import (),,g" {} \; - rm *.bak - go fmt . - - popd > /dev/null -} - -export -f fix_applyconfiguration -find apis/applyconfiguration/apis -name "v*" -type d -exec bash -c 'fix_applyconfiguration $0' {} \; - -echo "Generating clientset at ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME}" -go run k8s.io/code-generator/cmd/client-gen \ - --clientset-name "${CLIENTSET_NAME}" \ - --input-base "${APIS_PKG}" \ - --input "${GATEWAY_INPUT_DIRS_COMMA//${APIS_PKG}/}" \ - --output-dir "pkg/client/${CLIENTSET_PKG_NAME}" \ - --output-pkg "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME}" \ - --apply-configuration-package "${APIS_PKG}/apis/applyconfiguration" \ - ${COMMON_FLAGS} - -echo "Generating listers at ${OUTPUT_PKG}/listers" -go run k8s.io/code-generator/cmd/lister-gen \ - --output-dir "pkg/client/listers" \ - --output-pkg "${OUTPUT_PKG}/listers" \ - ${COMMON_FLAGS} \ - ${GATEWAY_INPUT_DIRS_SPACE} - -echo "Generating informers at ${OUTPUT_PKG}/informers" -go run k8s.io/code-generator/cmd/informer-gen \ - --versioned-clientset-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME}/${CLIENTSET_NAME}" \ - --listers-package "${OUTPUT_PKG}/listers" \ - --output-dir "pkg/client/informers" \ - --output-pkg "${OUTPUT_PKG}/informers" \ - ${COMMON_FLAGS} \ - ${GATEWAY_INPUT_DIRS_SPACE} - -echo "Generating ${VERSION} register at ${APIS_PKG}/apis/${VERSION}" -go run k8s.io/code-generator/cmd/register-gen \ - --output-file zz_generated.register.go \ - ${COMMON_FLAGS} \ - ${GATEWAY_INPUT_DIRS_SPACE} - -for VERSION in "${VERSIONS[@]}" -do - echo "Generating ${VERSION} deepcopy at ${APIS_PKG}/apis/${VERSION}" - go run sigs.k8s.io/controller-tools/cmd/controller-gen \ - object:headerFile=${SCRIPT_ROOT}/hack/boilerplate/boilerplate.generatego.txt \ - paths="${APIS_PKG}/apis/${VERSION}" -done - -echo "Generating gRPC/Protobuf code" - -readonly PROTOC_CACHE_DIR="/tmp/protoc.cache" -readonly PROTOC_BINARY="${PROTOC_CACHE_DIR}/bin/protoc" -readonly PROTOC_VERSION="22.2" -readonly PROTOC_REPO="https://github.com/protocolbuffers/protobuf" - -readonly PROTOC_LINUX_X86_URL="${PROTOC_REPO}/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip" -readonly PROTOC_LINUX_X86_CHECKSUM="4805ba56594556402a6c327a8d885a47640ee363 ${PROTOC_BINARY}" - -readonly PROTOC_LINUX_ARM64_URL="${PROTOC_REPO}/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-aarch_64.zip" -readonly PROTOC_LINUX_ARM64_CHECKSUM="47285b2386f990da319e9eef92cadec2dfa28733 ${PROTOC_BINARY}" - -readonly PROTOC_MAC_UNIVERSAL_URL="${PROTOC_REPO}/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-osx-universal_binary.zip" -readonly PROTOC_MAC_UNIVERSAL_CHECKSUM="2a79d0eb235c808eca8de893762072b94dc6144c ${PROTOC_BINARY}" - -PROTOC_URL="" -PROTOC_CHECKSUM="" - -ARCH=$(uname -m) -OS=$(uname) - -if [[ "${OS}" != "Linux" ]] && [[ "${OS}" != "Darwin" ]]; then - echo "Unsupported operating system ${OS}" >/dev/stderr - exit 1 -fi - -if [[ "${OS}" == "Linux" ]]; then - if [[ "$ARCH" == "x86_64" ]]; then - PROTOC_URL="$PROTOC_LINUX_X86_URL" - PROTOC_CHECKSUM="$PROTOC_LINUX_X86_CHECKSUM" - elif [[ "$ARCH" == "arm64" ]]; then - PROTOC_URL="$PROTOC_LINUX_ARM64_URL" - PROTOC_CHECKSUM="$PROTOC_LINUX_ARM64_CHECKSUM" - elif [[ "$ARCH" == "aarch64" ]]; then - PROTOC_URL="$PROTOC_LINUX_ARM64_URL" - PROTOC_CHECKSUM="$PROTOC_LINUX_ARM64_CHECKSUM" - else - echo "Architecture ${ARCH} is not supported on OS ${OS}." >/dev/stderr - exit 1 - fi -elif [[ "${OS}" == "Darwin" ]]; then - PROTOC_URL="$PROTOC_MAC_UNIVERSAL_URL" - PROTOC_CHECKSUM="$PROTOC_MAC_UNIVERSAL_CHECKSUM" -fi - -function verify_protoc { - if ! echo "${PROTOC_CHECKSUM}" | shasum -c >/dev/null; then - echo "Downloaded protoc binary failed checksum." >/dev/stderr - exit 1 - fi -} - -function ensure_protoc { - mkdir -p "${PROTOC_CACHE_DIR}" - if [ ! -f "${PROTOC_BINARY}" ]; then - curl -sL -o "${PROTOC_CACHE_DIR}/protoc.zip" "${PROTOC_URL}" - unzip -d "${PROTOC_CACHE_DIR}" "${PROTOC_CACHE_DIR}/protoc.zip" - fi - verify_protoc -} - -ensure_protoc -go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28 -go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2 -(cd conformance/echo-basic && \ - export PATH="$PATH:$GOPATH/bin" && \ - "${PROTOC_BINARY}" --go_out=grpcechoserver --go_opt=paths=source_relative \ - --go-grpc_out=grpcechoserver --go-grpc_opt=paths=source_relative \ - grpcecho.proto -) +./hack/update-clientset.sh +./hack/update-protos.sh \ No newline at end of file diff --git a/hack/update-protos.sh b/hack/update-protos.sh new file mode 100755 index 0000000000..92e888d3e5 --- /dev/null +++ b/hack/update-protos.sh @@ -0,0 +1,94 @@ +#!/usr/bin/env bash + +# Copyright 2025 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -o errexit +set -o nounset +set -o pipefail + +readonly SCRIPT_ROOT="$(cd "$(dirname "${BASH_SOURCE}")"/.. && pwd)" + +echo "Generating gRPC/Protobuf code" + +readonly PROTOC_CACHE_DIR="/tmp/protoc.cache" +readonly PROTOC_BINARY="${PROTOC_CACHE_DIR}/bin/protoc" +readonly PROTOC_VERSION="22.2" +readonly PROTOC_REPO="https://github.com/protocolbuffers/protobuf" + +readonly PROTOC_LINUX_X86_URL="${PROTOC_REPO}/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip" +readonly PROTOC_LINUX_X86_CHECKSUM="4805ba56594556402a6c327a8d885a47640ee363 ${PROTOC_BINARY}" + +readonly PROTOC_LINUX_ARM64_URL="${PROTOC_REPO}/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-aarch_64.zip" +readonly PROTOC_LINUX_ARM64_CHECKSUM="47285b2386f990da319e9eef92cadec2dfa28733 ${PROTOC_BINARY}" + +readonly PROTOC_MAC_UNIVERSAL_URL="${PROTOC_REPO}/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-osx-universal_binary.zip" +readonly PROTOC_MAC_UNIVERSAL_CHECKSUM="2a79d0eb235c808eca8de893762072b94dc6144c ${PROTOC_BINARY}" + +PROTOC_URL="" +PROTOC_CHECKSUM="" + +ARCH=$(uname -m) +OS=$(uname) + +if [[ "${OS}" != "Linux" ]] && [[ "${OS}" != "Darwin" ]]; then + echo "Unsupported operating system ${OS}" >/dev/stderr + exit 1 +fi + +if [[ "${OS}" == "Linux" ]]; then + if [[ "$ARCH" == "x86_64" ]]; then + PROTOC_URL="$PROTOC_LINUX_X86_URL" + PROTOC_CHECKSUM="$PROTOC_LINUX_X86_CHECKSUM" + elif [[ "$ARCH" == "arm64" ]]; then + PROTOC_URL="$PROTOC_LINUX_ARM64_URL" + PROTOC_CHECKSUM="$PROTOC_LINUX_ARM64_CHECKSUM" + elif [[ "$ARCH" == "aarch64" ]]; then + PROTOC_URL="$PROTOC_LINUX_ARM64_URL" + PROTOC_CHECKSUM="$PROTOC_LINUX_ARM64_CHECKSUM" + else + echo "Architecture ${ARCH} is not supported on OS ${OS}." >/dev/stderr + exit 1 + fi +elif [[ "${OS}" == "Darwin" ]]; then + PROTOC_URL="$PROTOC_MAC_UNIVERSAL_URL" + PROTOC_CHECKSUM="$PROTOC_MAC_UNIVERSAL_CHECKSUM" +fi + +function verify_protoc { + if ! echo "${PROTOC_CHECKSUM}" | shasum -c >/dev/null; then + echo "Downloaded protoc binary failed checksum." >/dev/stderr + exit 1 + fi +} + +function ensure_protoc { + mkdir -p "${PROTOC_CACHE_DIR}" + if [ ! -f "${PROTOC_BINARY}" ]; then + curl -sL -o "${PROTOC_CACHE_DIR}/protoc.zip" "${PROTOC_URL}" + unzip -d "${PROTOC_CACHE_DIR}" "${PROTOC_CACHE_DIR}/protoc.zip" + fi + verify_protoc +} + +ensure_protoc +go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28 +go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2 + +(cd conformance/echo-basic && \ + export PATH="$PATH:$GOPATH/bin" && \ + "${PROTOC_BINARY}" --go_out=grpcechoserver --go_opt=paths=source_relative \ + --go-grpc_out=grpcechoserver --go-grpc_opt=paths=source_relative \ + grpcecho.proto +) \ No newline at end of file diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 116d5cca8a..ef9ef2376f 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -33,19 +33,24 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterface + GatewayV1() gatewayv1.GatewayV1Interface GatewayV1alpha2() gatewayv1alpha2.GatewayV1alpha2Interface GatewayV1alpha3() gatewayv1alpha3.GatewayV1alpha3Interface GatewayV1beta1() gatewayv1beta1.GatewayV1beta1Interface - GatewayV1() gatewayv1.GatewayV1Interface } // Clientset contains the clients for groups. type Clientset struct { *discovery.DiscoveryClient + gatewayV1 *gatewayv1.GatewayV1Client gatewayV1alpha2 *gatewayv1alpha2.GatewayV1alpha2Client gatewayV1alpha3 *gatewayv1alpha3.GatewayV1alpha3Client gatewayV1beta1 *gatewayv1beta1.GatewayV1beta1Client - gatewayV1 *gatewayv1.GatewayV1Client +} + +// GatewayV1 retrieves the GatewayV1Client +func (c *Clientset) GatewayV1() gatewayv1.GatewayV1Interface { + return c.gatewayV1 } // GatewayV1alpha2 retrieves the GatewayV1alpha2Client @@ -63,11 +68,6 @@ func (c *Clientset) GatewayV1beta1() gatewayv1beta1.GatewayV1beta1Interface { return c.gatewayV1beta1 } -// GatewayV1 retrieves the GatewayV1Client -func (c *Clientset) GatewayV1() gatewayv1.GatewayV1Interface { - return c.gatewayV1 -} - // Discovery retrieves the DiscoveryClient func (c *Clientset) Discovery() discovery.DiscoveryInterface { if c == nil { @@ -112,19 +112,19 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, var cs Clientset var err error - cs.gatewayV1alpha2, err = gatewayv1alpha2.NewForConfigAndClient(&configShallowCopy, httpClient) + cs.gatewayV1, err = gatewayv1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } - cs.gatewayV1alpha3, err = gatewayv1alpha3.NewForConfigAndClient(&configShallowCopy, httpClient) + cs.gatewayV1alpha2, err = gatewayv1alpha2.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } - cs.gatewayV1beta1, err = gatewayv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) + cs.gatewayV1alpha3, err = gatewayv1alpha3.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } - cs.gatewayV1, err = gatewayv1.NewForConfigAndClient(&configShallowCopy, httpClient) + cs.gatewayV1beta1, err = gatewayv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } @@ -149,10 +149,10 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset + cs.gatewayV1 = gatewayv1.New(c) cs.gatewayV1alpha2 = gatewayv1alpha2.New(c) cs.gatewayV1alpha3 = gatewayv1alpha3.New(c) cs.gatewayV1beta1 = gatewayv1beta1.New(c) - cs.gatewayV1 = gatewayv1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index 7d165c93ba..7cc8169913 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -122,6 +122,11 @@ var ( _ testing.FakeClient = &Clientset{} ) +// GatewayV1 retrieves the GatewayV1Client +func (c *Clientset) GatewayV1() gatewayv1.GatewayV1Interface { + return &fakegatewayv1.FakeGatewayV1{Fake: &c.Fake} +} + // GatewayV1alpha2 retrieves the GatewayV1alpha2Client func (c *Clientset) GatewayV1alpha2() gatewayv1alpha2.GatewayV1alpha2Interface { return &fakegatewayv1alpha2.FakeGatewayV1alpha2{Fake: &c.Fake} @@ -136,8 +141,3 @@ func (c *Clientset) GatewayV1alpha3() gatewayv1alpha3.GatewayV1alpha3Interface { func (c *Clientset) GatewayV1beta1() gatewayv1beta1.GatewayV1beta1Interface { return &fakegatewayv1beta1.FakeGatewayV1beta1{Fake: &c.Fake} } - -// GatewayV1 retrieves the GatewayV1Client -func (c *Clientset) GatewayV1() gatewayv1.GatewayV1Interface { - return &fakegatewayv1.FakeGatewayV1{Fake: &c.Fake} -} diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index 502a6efc6e..70e71314d6 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -34,10 +34,10 @@ var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ + gatewayv1.AddToScheme, gatewayv1alpha2.AddToScheme, gatewayv1alpha3.AddToScheme, gatewayv1beta1.AddToScheme, - gatewayv1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index c6eca7a83a..715fcc4caa 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -34,10 +34,10 @@ var Scheme = runtime.NewScheme() var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ + gatewayv1.AddToScheme, gatewayv1alpha2.AddToScheme, gatewayv1alpha3.AddToScheme, gatewayv1beta1.AddToScheme, - gatewayv1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition From 6f04b8b04b26fcd3e451336c257af2dc292e8154 Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Thu, 13 Feb 2025 08:55:17 -0500 Subject: [PATCH 12/32] Attempting to match the experimental API structure that dprotaso made in #3588 --- apis/applyconfiguration/internal/internal.go | 61 - apis/applyconfiguration/utils.go | 8 - apis/openapi/zz_generated.openapi.go | 218 -- apis/v1alpha2/shared_types.go | 15 - apis/v1alpha2/zz_generated.deepcopy.go | 144 - apis/v1alpha2/zz_generated.register.go | 2 - .../apisx/v1alpha2/backendtrafficpolicy.go | 265 ++ .../v1alpha2/backendtrafficpolicyspec.go | 64 + .../apisx/v1alpha2/requestrate.go | 52 + .../apisx/v1alpha2/retryconstraint.go | 61 + apisx/applyconfiguration/internal/internal.go | 72 + apisx/applyconfiguration/utils.go | 50 + apisx/doc.go | 14 + apisx/openapi/zz_generated.openapi.go | 2893 +++++++++++++++++ .../v1alpha2/backendtrafficpolicy.go | 0 apisx/v1alpha2/doc.go | 20 + apisx/v1alpha2/shared_types.go | 46 + apisx/v1alpha2/zz_generated.deepcopy.go | 171 + apisx/v1alpha2/zz_generated.register.go | 70 + cmd/modelschema/main.go | 4 + .../typed/apis/v1alpha2/apis_client.go | 5 - .../apis/v1alpha2/fake/fake_apis_client.go | 4 - .../apis/v1alpha2/generated_expansion.go | 2 - .../apis/v1alpha2/interface.go | 7 - .../informers/externalversions/generic.go | 2 - .../apis/v1alpha2/expansion_generated.go | 8 - pkg/clientx/clientset/versioned/clientset.go | 120 + .../versioned/fake/clientset_generated.go | 122 + pkg/clientx/clientset/versioned/fake/doc.go | 20 + .../clientset/versioned/fake/register.go | 56 + pkg/clientx/clientset/versioned/scheme/doc.go | 20 + .../clientset/versioned/scheme/register.go | 56 + .../typed/apisx/v1alpha2/apisx_client.go | 107 + .../apisx/v1alpha2/backendtrafficpolicy.go | 73 + .../versioned/typed/apisx/v1alpha2/doc.go | 20 + .../typed/apisx/v1alpha2/fake/doc.go | 20 + .../apisx/v1alpha2/fake/fake_apisx_client.go | 40 + .../fake/fake_backendtrafficpolicy.go | 197 ++ .../apisx/v1alpha2/generated_expansion.go | 21 + .../externalversions/apisx/interface.go | 46 + .../apisx/v1alpha2/backendtrafficpolicy.go | 90 + .../apisx/v1alpha2/interface.go | 45 + .../informers/externalversions/factory.go | 262 ++ .../informers/externalversions/generic.go | 62 + .../internalinterfaces/factory_interfaces.go | 40 + .../apisx/v1alpha2/backendtrafficpolicy.go | 70 + .../apisx/v1alpha2/expansion_generated.go | 27 + 47 files changed, 5296 insertions(+), 476 deletions(-) create mode 100644 apisx/applyconfiguration/apisx/v1alpha2/backendtrafficpolicy.go create mode 100644 apisx/applyconfiguration/apisx/v1alpha2/backendtrafficpolicyspec.go create mode 100644 apisx/applyconfiguration/apisx/v1alpha2/requestrate.go create mode 100644 apisx/applyconfiguration/apisx/v1alpha2/retryconstraint.go create mode 100644 apisx/applyconfiguration/internal/internal.go create mode 100644 apisx/applyconfiguration/utils.go create mode 100644 apisx/doc.go create mode 100644 apisx/openapi/zz_generated.openapi.go rename apis/v1alpha2/backendtrafficpolicy_types.go => apisx/v1alpha2/backendtrafficpolicy.go (100%) create mode 100644 apisx/v1alpha2/doc.go create mode 100644 apisx/v1alpha2/shared_types.go create mode 100644 apisx/v1alpha2/zz_generated.deepcopy.go create mode 100644 apisx/v1alpha2/zz_generated.register.go create mode 100644 pkg/clientx/clientset/versioned/clientset.go create mode 100644 pkg/clientx/clientset/versioned/fake/clientset_generated.go create mode 100644 pkg/clientx/clientset/versioned/fake/doc.go create mode 100644 pkg/clientx/clientset/versioned/fake/register.go create mode 100644 pkg/clientx/clientset/versioned/scheme/doc.go create mode 100644 pkg/clientx/clientset/versioned/scheme/register.go create mode 100644 pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/apisx_client.go create mode 100644 pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/backendtrafficpolicy.go create mode 100644 pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/doc.go create mode 100644 pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake/doc.go create mode 100644 pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake/fake_apisx_client.go create mode 100644 pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake/fake_backendtrafficpolicy.go create mode 100644 pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/generated_expansion.go create mode 100644 pkg/clientx/informers/externalversions/apisx/interface.go create mode 100644 pkg/clientx/informers/externalversions/apisx/v1alpha2/backendtrafficpolicy.go create mode 100644 pkg/clientx/informers/externalversions/apisx/v1alpha2/interface.go create mode 100644 pkg/clientx/informers/externalversions/factory.go create mode 100644 pkg/clientx/informers/externalversions/generic.go create mode 100644 pkg/clientx/informers/externalversions/internalinterfaces/factory_interfaces.go create mode 100644 pkg/clientx/listers/apisx/v1alpha2/backendtrafficpolicy.go create mode 100644 pkg/clientx/listers/apisx/v1alpha2/expansion_generated.go diff --git a/apis/applyconfiguration/internal/internal.go b/apis/applyconfiguration/internal/internal.go index 0f03327f8e..07a0df71dd 100644 --- a/apis/applyconfiguration/internal/internal.go +++ b/apis/applyconfiguration/internal/internal.go @@ -1219,46 +1219,6 @@ var schemaYAML = typed.YAMLObject(`types: - group - kind - name -- name: io.k8s.sigs.gateway-api.apis.v1alpha2.BackendTrafficPolicy - map: - fields: - - name: apiVersion - type: - scalar: string - - name: kind - type: - scalar: string - - name: metadata - type: - namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta - default: {} - - name: spec - type: - namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.BackendTrafficPolicySpec - default: {} - - name: status - type: - namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.PolicyStatus - default: {} -- name: io.k8s.sigs.gateway-api.apis.v1alpha2.BackendTrafficPolicySpec - map: - fields: - - name: retry - type: - namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.RetryConstraint - - name: sessionPersistence - type: - namedType: io.k8s.sigs.gateway-api.apis.v1.SessionPersistence - - name: targetRefs - type: - list: - elementType: - namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.LocalPolicyTargetReference - elementRelationship: associative - keys: - - group - - kind - - name - name: io.k8s.sigs.gateway-api.apis.v1alpha2.GRPCRoute map: fields: @@ -1358,27 +1318,6 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: io.k8s.sigs.gateway-api.apis.v1beta1.ReferenceGrantSpec default: {} -- name: io.k8s.sigs.gateway-api.apis.v1alpha2.RequestRate - map: - fields: - - name: count - type: - scalar: numeric - - name: interval - type: - scalar: string -- name: io.k8s.sigs.gateway-api.apis.v1alpha2.RetryConstraint - map: - fields: - - name: budgetInterval - type: - scalar: string - - name: budgetPercent - type: - scalar: numeric - - name: minRetryRate - type: - namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.RequestRate - name: io.k8s.sigs.gateway-api.apis.v1alpha2.TCPRoute map: fields: diff --git a/apis/applyconfiguration/utils.go b/apis/applyconfiguration/utils.go index c66eabcb80..debd0d9f68 100644 --- a/apis/applyconfiguration/utils.go +++ b/apis/applyconfiguration/utils.go @@ -162,10 +162,6 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &apisv1alpha2.BackendLBPolicyApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("BackendLBPolicySpec"): return &apisv1alpha2.BackendLBPolicySpecApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("BackendTrafficPolicy"): - return &apisv1alpha2.BackendTrafficPolicyApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("BackendTrafficPolicySpec"): - return &apisv1alpha2.BackendTrafficPolicySpecApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("GRPCRoute"): return &apisv1alpha2.GRPCRouteApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("LocalPolicyTargetReference"): @@ -178,10 +174,6 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &apisv1alpha2.PolicyStatusApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("ReferenceGrant"): return &apisv1alpha2.ReferenceGrantApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("RequestRate"): - return &apisv1alpha2.RequestRateApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("RetryConstraint"): - return &apisv1alpha2.RetryConstraintApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("TCPRoute"): return &apisv1alpha2.TCPRouteApplyConfiguration{} case v1alpha2.SchemeGroupVersion.WithKind("TCPRouteRule"): diff --git a/apis/openapi/zz_generated.openapi.go b/apis/openapi/zz_generated.openapi.go index 11a1e89248..811e47ee48 100644 --- a/apis/openapi/zz_generated.openapi.go +++ b/apis/openapi/zz_generated.openapi.go @@ -149,9 +149,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendLBPolicy": schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendLBPolicy(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendLBPolicyList": schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendLBPolicyList(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendLBPolicySpec": schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendLBPolicySpec(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendTrafficPolicy": schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendTrafficPolicy(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendTrafficPolicyList": schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendTrafficPolicyList(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendTrafficPolicySpec": schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendTrafficPolicySpec(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.GRPCRoute": schema_sigsk8sio_gateway_api_apis_v1alpha2_GRPCRoute(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.GRPCRouteList": schema_sigsk8sio_gateway_api_apis_v1alpha2_GRPCRouteList(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.LocalPolicyTargetReference": schema_sigsk8sio_gateway_api_apis_v1alpha2_LocalPolicyTargetReference(ref), @@ -161,8 +158,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyStatus": schema_sigsk8sio_gateway_api_apis_v1alpha2_PolicyStatus(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.ReferenceGrant": schema_sigsk8sio_gateway_api_apis_v1alpha2_ReferenceGrant(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.ReferenceGrantList": schema_sigsk8sio_gateway_api_apis_v1alpha2_ReferenceGrantList(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.RequestRate": schema_sigsk8sio_gateway_api_apis_v1alpha2_RequestRate(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.RetryConstraint": schema_sigsk8sio_gateway_api_apis_v1alpha2_RetryConstraint(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.TCPRoute": schema_sigsk8sio_gateway_api_apis_v1alpha2_TCPRoute(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.TCPRouteList": schema_sigsk8sio_gateway_api_apis_v1alpha2_TCPRouteList(ref), "sigs.k8s.io/gateway-api/apis/v1alpha2.TCPRouteRule": schema_sigsk8sio_gateway_api_apis_v1alpha2_TCPRouteRule(ref), @@ -5821,157 +5816,6 @@ func schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendLBPolicySpec(ref common.R } } -func schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendTrafficPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "BackendTrafficPolicy defines the configuration for how traffic to a target backend should be handled.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the desired state of BackendTrafficPolicy.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.BackendTrafficPolicySpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status defines the current state of BackendTrafficPolicy.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyStatus"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendTrafficPolicySpec", "sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyStatus"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendTrafficPolicyList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "BackendTrafficPolicyList contains a list of BackendTrafficPolicies", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.BackendTrafficPolicy"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendTrafficPolicy"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendTrafficPolicySpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "BackendTrafficPolicySpec define the desired state of BackendTrafficPolicy Note: there is no Override or Default policy configuration.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "targetRefs": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "group", - "kind", - "name", - }, - "x-kubernetes-list-type": "map", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "TargetRef identifies an API object to apply policy to. Currently, Backends (i.e. Service, ServiceImport, or any implementation-specific backendRef) are the only valid API target references.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.LocalPolicyTargetReference"), - }, - }, - }, - }, - }, - "retry": { - SchemaProps: spec.SchemaProps{ - Description: "RetryConstraint defines the configuration for when to allow or prevent further retries to a target backend by dynamically calculating a 'retry budget'. This budget is calculated based on the percentage of incoming traffic composed of retries over a given time interval. Once the budget is exceeded, additional retries will be rejected by the backend.\n\nFor example, if the retry budget interval is 10 seconds, there have been 1000 active requests in the past 10 seconds, and the allowed percentage of requests that can be retried is 20% (the default), then 200 of those requests may be composed of retries. Active requests will only be considered for the duration of the interval when calculating the retry budget.\n\nConfiguring a RetryConstraint in BackendTrafficPolicy is compatible with HTTPRoute Retry settings for each HTTPRouteRule that targets the same backend. While the HTTPRouteRule Retry stanza can specify whether a request should be retried and the number of retry attempts each client may perform, RetryConstraint helps prevent cascading failures, such as retry storms, during periods of consistent failures.\n\nAfter the retry budget has been exceeded, additional retries to the backend must return a 503 response to the client.\n\nAdditional configurations for defining a constraint on retries MAY be defined in the future.\n\nSupport: Extended\n\n", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.RetryConstraint"), - }, - }, - "sessionPersistence": { - SchemaProps: spec.SchemaProps{ - Description: "SessionPersistence defines and configures session persistence for the backend.\n\nSupport: Extended", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.SessionPersistence"), - }, - }, - }, - Required: []string{"targetRefs"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.SessionPersistence", "sigs.k8s.io/gateway-api/apis/v1alpha2.LocalPolicyTargetReference", "sigs.k8s.io/gateway-api/apis/v1alpha2.RetryConstraint"}, - } -} - func schema_sigsk8sio_gateway_api_apis_v1alpha2_GRPCRoute(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -6370,68 +6214,6 @@ func schema_sigsk8sio_gateway_api_apis_v1alpha2_ReferenceGrantList(ref common.Re } } -func schema_sigsk8sio_gateway_api_apis_v1alpha2_RequestRate(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RequestRate expresses a rate of requests over a given period of time.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "count": { - SchemaProps: spec.SchemaProps{ - Description: "Count specifies the number of requests per time interval.\n\nSupport: Extended", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "interval": { - SchemaProps: spec.SchemaProps{ - Description: "Interval specifies the divisor of the rate of requests, the amount of time during which the given count of requests occur.\n\nSupport: Extended", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_RetryConstraint(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RetryConstraint defines the configuration for when to retry a request.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "budgetPercent": { - SchemaProps: spec.SchemaProps{ - Description: "BudgetPercent defines the maximum percentage of active requests that may be made up of retries.\n\nSupport: Extended", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "budgetInterval": { - SchemaProps: spec.SchemaProps{ - Description: "BudgetInterval defines the duration in which requests will be considered for calculating the budget for retries.\n\nSupport: Extended", - Type: []string{"string"}, - Format: "", - }, - }, - "minRetryRate": { - SchemaProps: spec.SchemaProps{ - Description: "MinRetryRate defines the minimum rate of retries that will be allowable over a specified duration of time.\n\nThis ensures that requests can still be retried during periods of low traffic, where the budget for retries may be calculated as a very low value.\n\nSupport: Extended", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.RequestRate"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1alpha2.RequestRate"}, - } -} - func schema_sigsk8sio_gateway_api_apis_v1alpha2_TCPRoute(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/apis/v1alpha2/shared_types.go b/apis/v1alpha2/shared_types.go index 8a40d602f4..2fb84d5f3b 100644 --- a/apis/v1alpha2/shared_types.go +++ b/apis/v1alpha2/shared_types.go @@ -389,18 +389,3 @@ const ( // SessionPersistence. // +k8s:deepcopy-gen=false type SessionPersistence = v1.SessionPersistence - -// RequestRate expresses a rate of requests over a given period of time. -type RequestRate struct { - // Count specifies the number of requests per time interval. - // - // Support: Extended - // +kubebuilder:validation:Minimum=0 - Count *int `json:"count,omitempty"` - - // Interval specifies the divisor of the rate of requests, the amount of - // time during which the given count of requests occur. - // - // Support: Extended - Interval *Duration `json:"interval,omitempty"` -} diff --git a/apis/v1alpha2/zz_generated.deepcopy.go b/apis/v1alpha2/zz_generated.deepcopy.go index e864499ddd..5306ca135d 100644 --- a/apis/v1alpha2/zz_generated.deepcopy.go +++ b/apis/v1alpha2/zz_generated.deepcopy.go @@ -110,95 +110,6 @@ func (in *BackendLBPolicySpec) DeepCopy() *BackendLBPolicySpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BackendTrafficPolicy) DeepCopyInto(out *BackendTrafficPolicy) { - *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 BackendTrafficPolicy. -func (in *BackendTrafficPolicy) DeepCopy() *BackendTrafficPolicy { - if in == nil { - return nil - } - out := new(BackendTrafficPolicy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BackendTrafficPolicy) 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 *BackendTrafficPolicyList) DeepCopyInto(out *BackendTrafficPolicyList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]BackendTrafficPolicy, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendTrafficPolicyList. -func (in *BackendTrafficPolicyList) DeepCopy() *BackendTrafficPolicyList { - if in == nil { - return nil - } - out := new(BackendTrafficPolicyList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BackendTrafficPolicyList) 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 *BackendTrafficPolicySpec) DeepCopyInto(out *BackendTrafficPolicySpec) { - *out = *in - if in.TargetRefs != nil { - in, out := &in.TargetRefs, &out.TargetRefs - *out = make([]LocalPolicyTargetReference, len(*in)) - copy(*out, *in) - } - if in.RetryConstraint != nil { - in, out := &in.RetryConstraint, &out.RetryConstraint - *out = new(RetryConstraint) - (*in).DeepCopyInto(*out) - } - if in.SessionPersistence != nil { - in, out := &in.SessionPersistence, &out.SessionPersistence - *out = new(v1.SessionPersistence) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendTrafficPolicySpec. -func (in *BackendTrafficPolicySpec) DeepCopy() *BackendTrafficPolicySpec { - if in == nil { - return nil - } - out := new(BackendTrafficPolicySpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GRPCRoute) DeepCopyInto(out *GRPCRoute) { *out = *in @@ -417,61 +328,6 @@ func (in *ReferenceGrantList) DeepCopyObject() runtime.Object { return nil } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RequestRate) DeepCopyInto(out *RequestRate) { - *out = *in - if in.Count != nil { - in, out := &in.Count, &out.Count - *out = new(int) - **out = **in - } - if in.Interval != nil { - in, out := &in.Interval, &out.Interval - *out = new(v1.Duration) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequestRate. -func (in *RequestRate) DeepCopy() *RequestRate { - if in == nil { - return nil - } - out := new(RequestRate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RetryConstraint) DeepCopyInto(out *RetryConstraint) { - *out = *in - if in.BudgetPercent != nil { - in, out := &in.BudgetPercent, &out.BudgetPercent - *out = new(int) - **out = **in - } - if in.BudgetInterval != nil { - in, out := &in.BudgetInterval, &out.BudgetInterval - *out = new(v1.Duration) - **out = **in - } - if in.MinRetryRate != nil { - in, out := &in.MinRetryRate, &out.MinRetryRate - *out = new(RequestRate) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetryConstraint. -func (in *RetryConstraint) DeepCopy() *RetryConstraint { - if in == nil { - return nil - } - out := new(RetryConstraint) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *TCPRoute) DeepCopyInto(out *TCPRoute) { *out = *in diff --git a/apis/v1alpha2/zz_generated.register.go b/apis/v1alpha2/zz_generated.register.go index 52495a7675..bb133e5dc1 100644 --- a/apis/v1alpha2/zz_generated.register.go +++ b/apis/v1alpha2/zz_generated.register.go @@ -63,8 +63,6 @@ func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &BackendLBPolicy{}, &BackendLBPolicyList{}, - &BackendTrafficPolicy{}, - &BackendTrafficPolicyList{}, &GRPCRoute{}, &GRPCRouteList{}, &ReferenceGrant{}, diff --git a/apisx/applyconfiguration/apisx/v1alpha2/backendtrafficpolicy.go b/apisx/applyconfiguration/apisx/v1alpha2/backendtrafficpolicy.go new file mode 100644 index 0000000000..a81c838094 --- /dev/null +++ b/apisx/applyconfiguration/apisx/v1alpha2/backendtrafficpolicy.go @@ -0,0 +1,265 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" + apisv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" + internal "sigs.k8s.io/gateway-api/apisx/applyconfiguration/internal" + apisxv1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" +) + +// BackendTrafficPolicyApplyConfiguration represents a declarative configuration of the BackendTrafficPolicy type for use +// with apply. +type BackendTrafficPolicyApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *BackendTrafficPolicySpecApplyConfiguration `json:"spec,omitempty"` + Status *apisv1alpha2.PolicyStatus `json:"status,omitempty"` +} + +// BackendTrafficPolicy constructs a declarative configuration of the BackendTrafficPolicy type for use with +// apply. +func BackendTrafficPolicy(name, namespace string) *BackendTrafficPolicyApplyConfiguration { + b := &BackendTrafficPolicyApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("BackendTrafficPolicy") + b.WithAPIVersion("gateway.networking.k8s-x.io/v1alpha2") + return b +} + +// ExtractBackendTrafficPolicy extracts the applied configuration owned by fieldManager from +// backendTrafficPolicy. If no managedFields are found in backendTrafficPolicy for fieldManager, a +// BackendTrafficPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// backendTrafficPolicy must be a unmodified BackendTrafficPolicy API object that was retrieved from the Kubernetes API. +// ExtractBackendTrafficPolicy provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractBackendTrafficPolicy(backendTrafficPolicy *apisxv1alpha2.BackendTrafficPolicy, fieldManager string) (*BackendTrafficPolicyApplyConfiguration, error) { + return extractBackendTrafficPolicy(backendTrafficPolicy, fieldManager, "") +} + +// ExtractBackendTrafficPolicyStatus is the same as ExtractBackendTrafficPolicy except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractBackendTrafficPolicyStatus(backendTrafficPolicy *apisxv1alpha2.BackendTrafficPolicy, fieldManager string) (*BackendTrafficPolicyApplyConfiguration, error) { + return extractBackendTrafficPolicy(backendTrafficPolicy, fieldManager, "status") +} + +func extractBackendTrafficPolicy(backendTrafficPolicy *apisxv1alpha2.BackendTrafficPolicy, fieldManager string, subresource string) (*BackendTrafficPolicyApplyConfiguration, error) { + b := &BackendTrafficPolicyApplyConfiguration{} + err := managedfields.ExtractInto(backendTrafficPolicy, internal.Parser().Type("io.k8s.sigs.gateway-api.apisx.v1alpha2.BackendTrafficPolicy"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(backendTrafficPolicy.Name) + b.WithNamespace(backendTrafficPolicy.Namespace) + + b.WithKind("BackendTrafficPolicy") + b.WithAPIVersion("gateway.networking.k8s-x.io/v1alpha2") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithKind(value string) *BackendTrafficPolicyApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithAPIVersion(value string) *BackendTrafficPolicyApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithName(value string) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithGenerateName(value string) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithNamespace(value string) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithUID(value types.UID) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithResourceVersion(value string) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithGeneration(value int64) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *BackendTrafficPolicyApplyConfiguration) WithLabels(entries map[string]string) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *BackendTrafficPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *BackendTrafficPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *BackendTrafficPolicyApplyConfiguration) WithFinalizers(values ...string) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *BackendTrafficPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithSpec(value *BackendTrafficPolicySpecApplyConfiguration) *BackendTrafficPolicyApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithStatus(value apisv1alpha2.PolicyStatus) *BackendTrafficPolicyApplyConfiguration { + b.Status = &value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *BackendTrafficPolicyApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/apisx/applyconfiguration/apisx/v1alpha2/backendtrafficpolicyspec.go b/apisx/applyconfiguration/apisx/v1alpha2/backendtrafficpolicyspec.go new file mode 100644 index 0000000000..e073f35c01 --- /dev/null +++ b/apisx/applyconfiguration/apisx/v1alpha2/backendtrafficpolicyspec.go @@ -0,0 +1,64 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" + v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" +) + +// BackendTrafficPolicySpecApplyConfiguration represents a declarative configuration of the BackendTrafficPolicySpec type for use +// with apply. +type BackendTrafficPolicySpecApplyConfiguration struct { + TargetRefs []v1alpha2.LocalPolicyTargetReference `json:"targetRefs,omitempty"` + RetryConstraint *RetryConstraintApplyConfiguration `json:"retry,omitempty"` + SessionPersistence *v1.SessionPersistence `json:"sessionPersistence,omitempty"` +} + +// BackendTrafficPolicySpecApplyConfiguration constructs a declarative configuration of the BackendTrafficPolicySpec type for use with +// apply. +func BackendTrafficPolicySpec() *BackendTrafficPolicySpecApplyConfiguration { + return &BackendTrafficPolicySpecApplyConfiguration{} +} + +// WithTargetRefs adds the given value to the TargetRefs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the TargetRefs field. +func (b *BackendTrafficPolicySpecApplyConfiguration) WithTargetRefs(values ...v1alpha2.LocalPolicyTargetReference) *BackendTrafficPolicySpecApplyConfiguration { + for i := range values { + b.TargetRefs = append(b.TargetRefs, values[i]) + } + return b +} + +// WithRetryConstraint sets the RetryConstraint field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RetryConstraint field is set to the value of the last call. +func (b *BackendTrafficPolicySpecApplyConfiguration) WithRetryConstraint(value *RetryConstraintApplyConfiguration) *BackendTrafficPolicySpecApplyConfiguration { + b.RetryConstraint = value + return b +} + +// WithSessionPersistence sets the SessionPersistence field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SessionPersistence field is set to the value of the last call. +func (b *BackendTrafficPolicySpecApplyConfiguration) WithSessionPersistence(value v1.SessionPersistence) *BackendTrafficPolicySpecApplyConfiguration { + b.SessionPersistence = &value + return b +} diff --git a/apisx/applyconfiguration/apisx/v1alpha2/requestrate.go b/apisx/applyconfiguration/apisx/v1alpha2/requestrate.go new file mode 100644 index 0000000000..e71fcd534a --- /dev/null +++ b/apisx/applyconfiguration/apisx/v1alpha2/requestrate.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// RequestRateApplyConfiguration represents a declarative configuration of the RequestRate type for use +// with apply. +type RequestRateApplyConfiguration struct { + Count *int `json:"count,omitempty"` + Interval *v1.Duration `json:"interval,omitempty"` +} + +// RequestRateApplyConfiguration constructs a declarative configuration of the RequestRate type for use with +// apply. +func RequestRate() *RequestRateApplyConfiguration { + return &RequestRateApplyConfiguration{} +} + +// WithCount sets the Count field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Count field is set to the value of the last call. +func (b *RequestRateApplyConfiguration) WithCount(value int) *RequestRateApplyConfiguration { + b.Count = &value + return b +} + +// WithInterval sets the Interval field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Interval field is set to the value of the last call. +func (b *RequestRateApplyConfiguration) WithInterval(value v1.Duration) *RequestRateApplyConfiguration { + b.Interval = &value + return b +} diff --git a/apisx/applyconfiguration/apisx/v1alpha2/retryconstraint.go b/apisx/applyconfiguration/apisx/v1alpha2/retryconstraint.go new file mode 100644 index 0000000000..36f0068138 --- /dev/null +++ b/apisx/applyconfiguration/apisx/v1alpha2/retryconstraint.go @@ -0,0 +1,61 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// RetryConstraintApplyConfiguration represents a declarative configuration of the RetryConstraint type for use +// with apply. +type RetryConstraintApplyConfiguration struct { + BudgetPercent *int `json:"budgetPercent,omitempty"` + BudgetInterval *v1.Duration `json:"budgetInterval,omitempty"` + MinRetryRate *RequestRateApplyConfiguration `json:"minRetryRate,omitempty"` +} + +// RetryConstraintApplyConfiguration constructs a declarative configuration of the RetryConstraint type for use with +// apply. +func RetryConstraint() *RetryConstraintApplyConfiguration { + return &RetryConstraintApplyConfiguration{} +} + +// WithBudgetPercent sets the BudgetPercent field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BudgetPercent field is set to the value of the last call. +func (b *RetryConstraintApplyConfiguration) WithBudgetPercent(value int) *RetryConstraintApplyConfiguration { + b.BudgetPercent = &value + return b +} + +// WithBudgetInterval sets the BudgetInterval field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BudgetInterval field is set to the value of the last call. +func (b *RetryConstraintApplyConfiguration) WithBudgetInterval(value v1.Duration) *RetryConstraintApplyConfiguration { + b.BudgetInterval = &value + return b +} + +// WithMinRetryRate sets the MinRetryRate field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinRetryRate field is set to the value of the last call. +func (b *RetryConstraintApplyConfiguration) WithMinRetryRate(value *RequestRateApplyConfiguration) *RetryConstraintApplyConfiguration { + b.MinRetryRate = value + return b +} diff --git a/apisx/applyconfiguration/internal/internal.go b/apisx/applyconfiguration/internal/internal.go new file mode 100644 index 0000000000..926627c38a --- /dev/null +++ b/apisx/applyconfiguration/internal/internal.go @@ -0,0 +1,72 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package internal + +import ( + "fmt" + "sync" + + typed "sigs.k8s.io/structured-merge-diff/v4/typed" +) + +func Parser() *typed.Parser { + parserOnce.Do(func() { + var err error + parser, err = typed.NewParser(schemaYAML) + if err != nil { + panic(fmt.Sprintf("Failed to parse schema: %v", err)) + } + }) + return parser +} + +var parserOnce sync.Once +var parser *typed.Parser +var schemaYAML = typed.YAMLObject(`types: +- name: io.k8s.sigs.gateway-api.apisx.v1alpha2.BackendTrafficPolicy + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: __untyped_atomic_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic +- name: __untyped_deduced_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +`) diff --git a/apisx/applyconfiguration/utils.go b/apisx/applyconfiguration/utils.go new file mode 100644 index 0000000000..145c90d36a --- /dev/null +++ b/apisx/applyconfiguration/utils.go @@ -0,0 +1,50 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package applyconfiguration + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + testing "k8s.io/client-go/testing" + apisxv1alpha2 "sigs.k8s.io/gateway-api/apisx/applyconfiguration/apisx/v1alpha2" + internal "sigs.k8s.io/gateway-api/apisx/applyconfiguration/internal" + v1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" +) + +// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no +// apply configuration type exists for the given GroupVersionKind. +func ForKind(kind schema.GroupVersionKind) interface{} { + switch kind { + // Group=gateway.networking.k8s-x.io, Version=v1alpha2 + case v1alpha2.SchemeGroupVersion.WithKind("BackendTrafficPolicy"): + return &apisxv1alpha2.BackendTrafficPolicyApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("BackendTrafficPolicySpec"): + return &apisxv1alpha2.BackendTrafficPolicySpecApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("RequestRate"): + return &apisxv1alpha2.RequestRateApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("RetryConstraint"): + return &apisxv1alpha2.RetryConstraintApplyConfiguration{} + + } + return nil +} + +func NewTypeConverter(scheme *runtime.Scheme) *testing.TypeConverter { + return &testing.TypeConverter{Scheme: scheme, TypeResolver: internal.Parser()} +} diff --git a/apisx/doc.go b/apisx/doc.go new file mode 100644 index 0000000000..1c7f4a234c --- /dev/null +++ b/apisx/doc.go @@ -0,0 +1,14 @@ +/* +Copyright 2025 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package apix diff --git a/apisx/openapi/zz_generated.openapi.go b/apisx/openapi/zz_generated.openapi.go new file mode 100644 index 0000000000..4059e14b64 --- /dev/null +++ b/apisx/openapi/zz_generated.openapi.go @@ -0,0 +1,2893 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by openapi-gen. DO NOT EDIT. + +package openapi + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + common "k8s.io/kube-openapi/pkg/common" + spec "k8s.io/kube-openapi/pkg/validation/spec" +) + +func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { + return map[string]common.OpenAPIDefinition{ + "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup": schema_pkg_apis_meta_v1_APIGroup(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroupList": schema_pkg_apis_meta_v1_APIGroupList(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.APIResource": schema_pkg_apis_meta_v1_APIResource(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.APIResourceList": schema_pkg_apis_meta_v1_APIResourceList(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.APIVersions": schema_pkg_apis_meta_v1_APIVersions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.ApplyOptions": schema_pkg_apis_meta_v1_ApplyOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Condition": schema_pkg_apis_meta_v1_Condition(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.CreateOptions": schema_pkg_apis_meta_v1_CreateOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.DeleteOptions": schema_pkg_apis_meta_v1_DeleteOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Duration": schema_pkg_apis_meta_v1_Duration(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.FieldSelectorRequirement": schema_pkg_apis_meta_v1_FieldSelectorRequirement(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1": schema_pkg_apis_meta_v1_FieldsV1(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GetOptions": schema_pkg_apis_meta_v1_GetOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupKind": schema_pkg_apis_meta_v1_GroupKind(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupResource": schema_pkg_apis_meta_v1_GroupResource(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersion": schema_pkg_apis_meta_v1_GroupVersion(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery": schema_pkg_apis_meta_v1_GroupVersionForDiscovery(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionKind": schema_pkg_apis_meta_v1_GroupVersionKind(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionResource": schema_pkg_apis_meta_v1_GroupVersionResource(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.InternalEvent": schema_pkg_apis_meta_v1_InternalEvent(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector": schema_pkg_apis_meta_v1_LabelSelector(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement": schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.List": schema_pkg_apis_meta_v1_List(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta": schema_pkg_apis_meta_v1_ListMeta(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.ListOptions": schema_pkg_apis_meta_v1_ListOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry": schema_pkg_apis_meta_v1_ManagedFieldsEntry(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime": schema_pkg_apis_meta_v1_MicroTime(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta": schema_pkg_apis_meta_v1_ObjectMeta(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference": schema_pkg_apis_meta_v1_OwnerReference(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata": schema_pkg_apis_meta_v1_PartialObjectMetadata(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadataList": schema_pkg_apis_meta_v1_PartialObjectMetadataList(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Patch": schema_pkg_apis_meta_v1_Patch(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.PatchOptions": schema_pkg_apis_meta_v1_PatchOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions": schema_pkg_apis_meta_v1_Preconditions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.RootPaths": schema_pkg_apis_meta_v1_RootPaths(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR": schema_pkg_apis_meta_v1_ServerAddressByClientCIDR(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Status": schema_pkg_apis_meta_v1_Status(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause": schema_pkg_apis_meta_v1_StatusCause(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails": schema_pkg_apis_meta_v1_StatusDetails(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Table": schema_pkg_apis_meta_v1_Table(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition": schema_pkg_apis_meta_v1_TableColumnDefinition(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.TableOptions": schema_pkg_apis_meta_v1_TableOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.TableRow": schema_pkg_apis_meta_v1_TableRow(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition": schema_pkg_apis_meta_v1_TableRowCondition(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Time": schema_pkg_apis_meta_v1_Time(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Timestamp": schema_pkg_apis_meta_v1_Timestamp(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta": schema_pkg_apis_meta_v1_TypeMeta(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.UpdateOptions": schema_pkg_apis_meta_v1_UpdateOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.WatchEvent": schema_pkg_apis_meta_v1_WatchEvent(ref), + "k8s.io/apimachinery/pkg/runtime.RawExtension": schema_k8sio_apimachinery_pkg_runtime_RawExtension(ref), + "k8s.io/apimachinery/pkg/runtime.TypeMeta": schema_k8sio_apimachinery_pkg_runtime_TypeMeta(ref), + "k8s.io/apimachinery/pkg/runtime.Unknown": schema_k8sio_apimachinery_pkg_runtime_Unknown(ref), + "k8s.io/apimachinery/pkg/version.Info": schema_k8sio_apimachinery_pkg_version_Info(ref), + "sigs.k8s.io/gateway-api/apisx/v1alpha2.BackendTrafficPolicy": schema_sigsk8sio_gateway_api_apisx_v1alpha2_BackendTrafficPolicy(ref), + "sigs.k8s.io/gateway-api/apisx/v1alpha2.BackendTrafficPolicyList": schema_sigsk8sio_gateway_api_apisx_v1alpha2_BackendTrafficPolicyList(ref), + "sigs.k8s.io/gateway-api/apisx/v1alpha2.BackendTrafficPolicySpec": schema_sigsk8sio_gateway_api_apisx_v1alpha2_BackendTrafficPolicySpec(ref), + "sigs.k8s.io/gateway-api/apisx/v1alpha2.RequestRate": schema_sigsk8sio_gateway_api_apisx_v1alpha2_RequestRate(ref), + "sigs.k8s.io/gateway-api/apisx/v1alpha2.RetryConstraint": schema_sigsk8sio_gateway_api_apisx_v1alpha2_RetryConstraint(ref), + } +} + +func schema_pkg_apis_meta_v1_APIGroup(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "APIGroup contains the name, the supported versions, and the preferred version of a group.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name is the name of the group.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "versions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "versions are the versions supported in this group.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery"), + }, + }, + }, + }, + }, + "preferredVersion": { + SchemaProps: spec.SchemaProps{ + Description: "preferredVersion is the version preferred by the API server, which probably is the storage version.", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery"), + }, + }, + "serverAddressByClientCIDRs": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"), + }, + }, + }, + }, + }, + }, + Required: []string{"name", "versions"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery", "k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"}, + } +} + +func schema_pkg_apis_meta_v1_APIGroupList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "APIGroupList is a list of APIGroup, to allow clients to discover the API at /apis.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "groups": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "groups is a list of APIGroup.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup"), + }, + }, + }, + }, + }, + }, + Required: []string{"groups"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup"}, + } +} + +func schema_pkg_apis_meta_v1_APIResource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "APIResource specifies the name of a resource and whether it is namespaced.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name is the plural name of the resource.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "singularName": { + SchemaProps: spec.SchemaProps{ + Description: "singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "namespaced": { + SchemaProps: spec.SchemaProps{ + Description: "namespaced indicates if a resource is namespaced or not.", + Default: false, + Type: []string{"boolean"}, + Format: "", + }, + }, + "group": { + SchemaProps: spec.SchemaProps{ + Description: "group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\".", + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\".", + Type: []string{"string"}, + Format: "", + }, + }, + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "verbs": { + SchemaProps: spec.SchemaProps{ + Description: "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "shortNames": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "shortNames is a list of suggested short names of the resource.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "categories": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "categories is a list of the grouped resources this resource belongs to (e.g. 'all')", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "storageVersionHash": { + SchemaProps: spec.SchemaProps{ + Description: "The hash value of the storage version, the version this resource is converted to when written to the data store. Value must be treated as opaque by clients. Only equality comparison on the value is valid. This is an alpha feature and may change or be removed in the future. The field is populated by the apiserver only if the StorageVersionHash feature gate is enabled. This field will remain optional even if it graduates.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"name", "singularName", "namespaced", "kind", "verbs"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_APIResourceList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "groupVersion": { + SchemaProps: spec.SchemaProps{ + Description: "groupVersion is the group and version this APIResourceList is for.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "resources": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "resources contains the name of the resources and if they are namespaced.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.APIResource"), + }, + }, + }, + }, + }, + }, + Required: []string{"groupVersion", "resources"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.APIResource"}, + } +} + +func schema_pkg_apis_meta_v1_APIVersions(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "APIVersions lists the versions that are available, to allow clients to discover the API at /api, which is the root path of the legacy v1 API.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "versions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "versions are the api versions that are available.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "serverAddressByClientCIDRs": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"), + }, + }, + }, + }, + }, + }, + Required: []string{"versions", "serverAddressByClientCIDRs"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"}, + } +} + +func schema_pkg_apis_meta_v1_ApplyOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ApplyOptions may be provided when applying an API object. FieldManager is required for apply requests. ApplyOptions is equivalent to PatchOptions. It is provided as a convenience with documentation that speaks specifically to how the options fields relate to apply.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "dryRun": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "force": { + SchemaProps: spec.SchemaProps{ + Description: "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people.", + Default: false, + Type: []string{"boolean"}, + Format: "", + }, + }, + "fieldManager": { + SchemaProps: spec.SchemaProps{ + Description: "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"force", "fieldManager"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_Condition(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Condition contains details for one aspect of the current state of this API Resource.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Description: "type of condition in CamelCase or in foo.example.com/CamelCase.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "status of the condition, one of True, False, Unknown.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "observedGeneration": { + SchemaProps: spec.SchemaProps{ + Description: "observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "lastTransitionTime": { + SchemaProps: spec.SchemaProps{ + Description: "lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "reason": { + SchemaProps: spec.SchemaProps{ + Description: "reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "message": { + SchemaProps: spec.SchemaProps{ + Description: "message is a human readable message indicating details about the transition. This may be an empty string.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"type", "status", "lastTransitionTime", "reason", "message"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} + +func schema_pkg_apis_meta_v1_CreateOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "CreateOptions may be provided when creating an API object.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "dryRun": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "fieldManager": { + SchemaProps: spec.SchemaProps{ + Description: "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", + Type: []string{"string"}, + Format: "", + }, + }, + "fieldValidation": { + SchemaProps: spec.SchemaProps{ + Description: "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_DeleteOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DeleteOptions may be provided when deleting an API object.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "gracePeriodSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "preconditions": { + SchemaProps: spec.SchemaProps{ + Description: "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions"), + }, + }, + "orphanDependents": { + SchemaProps: spec.SchemaProps{ + Description: "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "propagationPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", + Type: []string{"string"}, + Format: "", + }, + }, + "dryRun": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions"}, + } +} + +func schema_pkg_apis_meta_v1_Duration(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Duration is a wrapper around time.Duration which supports correct marshaling to YAML and JSON. In particular, it marshals into strings, which can be used as map keys in json.", + Type: v1.Duration{}.OpenAPISchemaType(), + Format: v1.Duration{}.OpenAPISchemaFormat(), + }, + }, + } +} + +func schema_pkg_apis_meta_v1_FieldSelectorRequirement(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "FieldSelectorRequirement is a selector that contains values, a key, and an operator that relates the key and values.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "key": { + SchemaProps: spec.SchemaProps{ + Description: "key is the field selector key that the requirement applies to.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "operator": { + SchemaProps: spec.SchemaProps{ + Description: "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. The list of operators may grow in the future.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "values": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"key", "operator"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_FieldsV1(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format.\n\nEach key is either a '.' representing the field itself, and will always map to an empty set, or a string representing a sub-field or item. The string will follow one of these four formats: 'f:', where is the name of a field in a struct, or key in a map 'v:', where is the exact json formatted value of a list item 'i:', where is position of a item in a list 'k:', where is a map of a list item's key fields to their unique values If a key maps to an empty Fields value, the field that key represents is part of the set.\n\nThe exact format is defined in sigs.k8s.io/structured-merge-diff", + Type: []string{"object"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_GetOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GetOptions is the standard query options to the standard REST get call.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "resourceVersion": { + SchemaProps: spec.SchemaProps{ + Description: "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_GroupKind(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GroupKind specifies a Group and a Kind, but does not force a version. This is useful for identifying concepts during lookup stages without having partially valid types", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "group": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "kind": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"group", "kind"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_GroupResource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GroupResource specifies a Group and a Resource, but does not force a version. This is useful for identifying concepts during lookup stages without having partially valid types", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "group": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "resource": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"group", "resource"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_GroupVersion(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GroupVersion contains the \"group\" and the \"version\", which uniquely identifies the API.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "group": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"group", "version"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_GroupVersionForDiscovery(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensibility.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "groupVersion": { + SchemaProps: spec.SchemaProps{ + Description: "groupVersion specifies the API group and version in the form \"group/version\"", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"groupVersion", "version"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_GroupVersionKind(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GroupVersionKind unambiguously identifies a kind. It doesn't anonymously include GroupVersion to avoid automatic coercion. It doesn't use a GroupVersion to avoid custom marshalling", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "group": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "kind": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"group", "version", "kind"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_GroupVersionResource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GroupVersionResource unambiguously identifies a resource. It doesn't anonymously include GroupVersion to avoid automatic coercion. It doesn't use a GroupVersion to avoid custom marshalling", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "group": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "resource": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"group", "version", "resource"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_InternalEvent(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "InternalEvent makes watch.Event versioned", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "Type": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "Object": { + SchemaProps: spec.SchemaProps{ + Description: "Object is:\n * If Type is Added or Modified: the new state of the object.\n * If Type is Deleted: the state of the object immediately before deletion.\n * If Type is Bookmark: the object (instance of a type being watched) where\n only ResourceVersion field is set. On successful restart of watch from a\n bookmark resourceVersion, client is guaranteed to not get repeat event\n nor miss any events.\n * If Type is Error: *api.Status is recommended; other types may make sense\n depending on context.", + Ref: ref("k8s.io/apimachinery/pkg/runtime.Object"), + }, + }, + }, + Required: []string{"Type", "Object"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/runtime.Object"}, + } +} + +func schema_pkg_apis_meta_v1_LabelSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "matchLabels": { + SchemaProps: spec.SchemaProps{ + Description: "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "matchExpressions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "matchExpressions is a list of label selector requirements. The requirements are ANDed.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement"), + }, + }, + }, + }, + }, + }, + }, + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-map-type": "atomic", + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement"}, + } +} + +func schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "key": { + SchemaProps: spec.SchemaProps{ + Description: "key is the label key that the selector applies to.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "operator": { + SchemaProps: spec.SchemaProps{ + Description: "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "values": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"key", "operator"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_List(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "List holds a list of objects, which may not be known by the server.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "List of objects", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, + } +} + +func schema_pkg_apis_meta_v1_ListMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "selfLink": { + SchemaProps: spec.SchemaProps{ + Description: "Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.", + Type: []string{"string"}, + Format: "", + }, + }, + "resourceVersion": { + SchemaProps: spec.SchemaProps{ + Description: "String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", + Type: []string{"string"}, + Format: "", + }, + }, + "continue": { + SchemaProps: spec.SchemaProps{ + Description: "continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message.", + Type: []string{"string"}, + Format: "", + }, + }, + "remainingItemCount": { + SchemaProps: spec.SchemaProps{ + Description: "remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_ListOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ListOptions is the query options to a standard REST list call.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "labelSelector": { + SchemaProps: spec.SchemaProps{ + Description: "A selector to restrict the list of returned objects by their labels. Defaults to everything.", + Type: []string{"string"}, + Format: "", + }, + }, + "fieldSelector": { + SchemaProps: spec.SchemaProps{ + Description: "A selector to restrict the list of returned objects by their fields. Defaults to everything.", + Type: []string{"string"}, + Format: "", + }, + }, + "watch": { + SchemaProps: spec.SchemaProps{ + Description: "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "allowWatchBookmarks": { + SchemaProps: spec.SchemaProps{ + Description: "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "resourceVersion": { + SchemaProps: spec.SchemaProps{ + Description: "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", + Type: []string{"string"}, + Format: "", + }, + }, + "resourceVersionMatch": { + SchemaProps: spec.SchemaProps{ + Description: "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", + Type: []string{"string"}, + Format: "", + }, + }, + "timeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "limit": { + SchemaProps: spec.SchemaProps{ + Description: "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "continue": { + SchemaProps: spec.SchemaProps{ + Description: "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", + Type: []string{"string"}, + Format: "", + }, + }, + "sendInitialEvents": { + SchemaProps: spec.SchemaProps{ + Description: "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_ManagedFieldsEntry(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource that the fieldset applies to.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "manager": { + SchemaProps: spec.SchemaProps{ + Description: "Manager is an identifier of the workflow managing these fields.", + Type: []string{"string"}, + Format: "", + }, + }, + "operation": { + SchemaProps: spec.SchemaProps{ + Description: "Operation is the type of operation which lead to this ManagedFieldsEntry being created. The only valid values for this field are 'Apply' and 'Update'.", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the version of this resource that this field set applies to. The format is \"group/version\" just like the top-level APIVersion field. It is necessary to track the version of a field set because it cannot be automatically converted.", + Type: []string{"string"}, + Format: "", + }, + }, + "time": { + SchemaProps: spec.SchemaProps{ + Description: "Time is the timestamp of when the ManagedFields entry was added. The timestamp will also be updated if a field is added, the manager changes any of the owned fields value or removes a field. The timestamp does not update when a field is removed from the entry because another manager took it over.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "fieldsType": { + SchemaProps: spec.SchemaProps{ + Description: "FieldsType is the discriminator for the different fields format and version. There is currently only one possible value: \"FieldsV1\"", + Type: []string{"string"}, + Format: "", + }, + }, + "fieldsV1": { + SchemaProps: spec.SchemaProps{ + Description: "FieldsV1 holds the first JSON version format as described in the \"FieldsV1\" type.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1"), + }, + }, + "subresource": { + SchemaProps: spec.SchemaProps{ + Description: "Subresource is the name of the subresource used to update that object, or empty string if the object was updated through the main resource. The value of this field is used to distinguish between managers, even if they share the same name. For example, a status update will be distinct from a regular update using the same manager name. Note that the APIVersion field is not related to the Subresource field and it always corresponds to the version of the main resource.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} + +func schema_pkg_apis_meta_v1_MicroTime(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MicroTime is version of Time with microsecond level precision.", + Type: v1.MicroTime{}.OpenAPISchemaType(), + Format: v1.MicroTime{}.OpenAPISchemaFormat(), + }, + }, + } +} + +func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names", + Type: []string{"string"}, + Format: "", + }, + }, + "generateName": { + SchemaProps: spec.SchemaProps{ + Description: "GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will return a 409.\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency", + Type: []string{"string"}, + Format: "", + }, + }, + "namespace": { + SchemaProps: spec.SchemaProps{ + Description: "Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces", + Type: []string{"string"}, + Format: "", + }, + }, + "selfLink": { + SchemaProps: spec.SchemaProps{ + Description: "Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.", + Type: []string{"string"}, + Format: "", + }, + }, + "uid": { + SchemaProps: spec.SchemaProps{ + Description: "UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", + Type: []string{"string"}, + Format: "", + }, + }, + "resourceVersion": { + SchemaProps: spec.SchemaProps{ + Description: "An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", + Type: []string{"string"}, + Format: "", + }, + }, + "generation": { + SchemaProps: spec.SchemaProps{ + Description: "A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "creationTimestamp": { + SchemaProps: spec.SchemaProps{ + Description: "CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "deletionTimestamp": { + SchemaProps: spec.SchemaProps{ + Description: "DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "deletionGracePeriodSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "labels": { + SchemaProps: spec.SchemaProps{ + Description: "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "annotations": { + SchemaProps: spec.SchemaProps{ + Description: "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "ownerReferences": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "uid", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "uid", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference"), + }, + }, + }, + }, + }, + "finalizers": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "set", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "managedFields": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry", "k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} + +func schema_pkg_apis_meta_v1_OwnerReference(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "API version of the referent.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "uid": { + SchemaProps: spec.SchemaProps{ + Description: "UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "controller": { + SchemaProps: spec.SchemaProps{ + Description: "If true, this reference points to the managing controller.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "blockOwnerDeletion": { + SchemaProps: spec.SchemaProps{ + Description: "If true, AND if the owner has the \"foregroundDeletion\" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. See https://kubernetes.io/docs/concepts/architecture/garbage-collection/#foreground-deletion for how the garbage collector interacts with this field and enforces the foreground deletion. Defaults to false. To set this field, a user needs \"delete\" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + Required: []string{"apiVersion", "kind", "name", "uid"}, + }, + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-map-type": "atomic", + }, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_PartialObjectMetadata(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PartialObjectMetadata is a generic representation of any object with ObjectMeta. It allows clients to get access to a particular ObjectMeta schema without knowing the details of the version.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_pkg_apis_meta_v1_PartialObjectMetadataList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PartialObjectMetadataList contains a list of objects containing only their metadata", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "items contains each of the included items.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata"}, + } +} + +func schema_pkg_apis_meta_v1_Patch(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.", + Type: []string{"object"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_PatchOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PatchOptions may be provided when patching an API object. PatchOptions is meant to be a superset of UpdateOptions.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "dryRun": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "force": { + SchemaProps: spec.SchemaProps{ + Description: "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "fieldManager": { + SchemaProps: spec.SchemaProps{ + Description: "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", + Type: []string{"string"}, + Format: "", + }, + }, + "fieldValidation": { + SchemaProps: spec.SchemaProps{ + Description: "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_Preconditions(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "uid": { + SchemaProps: spec.SchemaProps{ + Description: "Specifies the target UID.", + Type: []string{"string"}, + Format: "", + }, + }, + "resourceVersion": { + SchemaProps: spec.SchemaProps{ + Description: "Specifies the target ResourceVersion", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_RootPaths(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "RootPaths lists the paths available at root. For example: \"/healthz\", \"/apis\".", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "paths": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "paths are the paths available at root.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"paths"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_ServerAddressByClientCIDR(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "clientCIDR": { + SchemaProps: spec.SchemaProps{ + Description: "The CIDR with which clients can match their IP to figure out the server address that they should use.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "serverAddress": { + SchemaProps: spec.SchemaProps{ + Description: "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"clientCIDR", "serverAddress"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_Status(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Status is a return value for calls that don't return other objects.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "Status of the operation. One of: \"Success\" or \"Failure\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", + Type: []string{"string"}, + Format: "", + }, + }, + "message": { + SchemaProps: spec.SchemaProps{ + Description: "A human-readable description of the status of this operation.", + Type: []string{"string"}, + Format: "", + }, + }, + "reason": { + SchemaProps: spec.SchemaProps{ + Description: "A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.", + Type: []string{"string"}, + Format: "", + }, + }, + "details": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails"), + }, + }, + "code": { + SchemaProps: spec.SchemaProps{ + Description: "Suggested HTTP return code for this status, 0 if not set.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails"}, + } +} + +func schema_pkg_apis_meta_v1_StatusCause(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "reason": { + SchemaProps: spec.SchemaProps{ + Description: "A machine-readable description of the cause of the error. If this value is empty there is no information available.", + Type: []string{"string"}, + Format: "", + }, + }, + "message": { + SchemaProps: spec.SchemaProps{ + Description: "A human-readable description of the cause of the error. This field may be presented as-is to a reader.", + Type: []string{"string"}, + Format: "", + }, + }, + "field": { + SchemaProps: spec.SchemaProps{ + Description: "The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\"", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_StatusDetails(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).", + Type: []string{"string"}, + Format: "", + }, + }, + "group": { + SchemaProps: spec.SchemaProps{ + Description: "The group attribute of the resource associated with the status StatusReason.", + Type: []string{"string"}, + Format: "", + }, + }, + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "uid": { + SchemaProps: spec.SchemaProps{ + Description: "UID of the resource. (when there is a single resource which can be described). More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", + Type: []string{"string"}, + Format: "", + }, + }, + "causes": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause"), + }, + }, + }, + }, + }, + "retryAfterSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause"}, + } +} + +func schema_pkg_apis_meta_v1_Table(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Table is a tabular representation of a set of API resources. The server transforms the object into a set of preferred columns for quickly reviewing the objects.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "columnDefinitions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "columnDefinitions describes each column in the returned items array. The number of cells per row will always match the number of column definitions.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition"), + }, + }, + }, + }, + }, + "rows": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "rows is the list of items in the table.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TableRow"), + }, + }, + }, + }, + }, + }, + Required: []string{"columnDefinitions", "rows"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition", "k8s.io/apimachinery/pkg/apis/meta/v1.TableRow"}, + } +} + +func schema_pkg_apis_meta_v1_TableColumnDefinition(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TableColumnDefinition contains information about a column returned in the Table.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name is a human readable name for the column.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "type": { + SchemaProps: spec.SchemaProps{ + Description: "type is an OpenAPI type definition for this column, such as number, integer, string, or array. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "format": { + SchemaProps: spec.SchemaProps{ + Description: "format is an optional OpenAPI type modifier for this column. A format modifies the type and imposes additional rules, like date or time formatting for a string. The 'name' format is applied to the primary identifier column which has type 'string' to assist in clients identifying column is the resource name. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "description": { + SchemaProps: spec.SchemaProps{ + Description: "description is a human readable description of this column.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "priority": { + SchemaProps: spec.SchemaProps{ + Description: "priority is an integer defining the relative importance of this column compared to others. Lower numbers are considered higher priority. Columns that may be omitted in limited space scenarios should be given a higher priority.", + Default: 0, + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + Required: []string{"name", "type", "format", "description", "priority"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_TableOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TableOptions are used when a Table is requested by the caller.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "includeObject": { + SchemaProps: spec.SchemaProps{ + Description: "includeObject decides whether to include each object along with its columnar information. Specifying \"None\" will return no object, specifying \"Object\" will return the full object contents, and specifying \"Metadata\" (the default) will return the object's metadata in the PartialObjectMetadata kind in version v1beta1 of the meta.k8s.io API group.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_TableRow(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TableRow is an individual row in a table.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "cells": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "cells will be as wide as the column definitions array and may contain strings, numbers (float64 or int64), booleans, simple maps, lists, or null. See the type field of the column definition for a more detailed description.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Format: "", + }, + }, + }, + }, + }, + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "conditions describe additional status of a row that are relevant for a human user. These conditions apply to the row, not to the object, and will be specific to table output. The only defined condition type is 'Completed', for a row that indicates a resource that has run to completion and can be given less visual priority.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition"), + }, + }, + }, + }, + }, + "object": { + SchemaProps: spec.SchemaProps{ + Description: "This field contains the requested additional information about each object based on the includeObject policy when requesting the Table. If \"None\", this field is empty, if \"Object\" this will be the default serialization of the object for the current API version, and if \"Metadata\" (the default) will contain the object metadata. Check the returned kind and apiVersion of the object before parsing. The media type of the object will always match the enclosing list - if this as a JSON table, these will be JSON encoded objects.", + Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), + }, + }, + }, + Required: []string{"cells"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, + } +} + +func schema_pkg_apis_meta_v1_TableRowCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TableRowCondition allows a row to be marked with additional information.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Description: "Type of row condition. The only defined value is 'Completed' indicating that the object this row represents has reached a completed state and may be given less visual priority than other rows. Clients are not required to honor any conditions but should be consistent where possible about handling the conditions.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "Status of the condition, one of True, False, Unknown.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "reason": { + SchemaProps: spec.SchemaProps{ + Description: "(brief) machine readable reason for the condition's last transition.", + Type: []string{"string"}, + Format: "", + }, + }, + "message": { + SchemaProps: spec.SchemaProps{ + Description: "Human readable message indicating details about last transition.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"type", "status"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_Time(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.", + Type: v1.Time{}.OpenAPISchemaType(), + Format: v1.Time{}.OpenAPISchemaFormat(), + }, + }, + } +} + +func schema_pkg_apis_meta_v1_Timestamp(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Timestamp is a struct that is equivalent to Time, but intended for protobuf marshalling/unmarshalling. It is generated into a serialization that matches Time. Do not use in Go structs.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "seconds": { + SchemaProps: spec.SchemaProps{ + Description: "Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.", + Default: 0, + Type: []string{"integer"}, + Format: "int64", + }, + }, + "nanos": { + SchemaProps: spec.SchemaProps{ + Description: "Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. This field may be limited in precision depending on context.", + Default: 0, + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + Required: []string{"seconds", "nanos"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_TypeMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TypeMeta describes an individual object in an API response or request with strings representing the type of the object and its API schema version. Structures that are versioned or persisted should inline TypeMeta.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_UpdateOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "UpdateOptions may be provided when updating an API object. All fields in UpdateOptions should also be present in PatchOptions.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "dryRun": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "fieldManager": { + SchemaProps: spec.SchemaProps{ + Description: "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", + Type: []string{"string"}, + Format: "", + }, + }, + "fieldValidation": { + SchemaProps: spec.SchemaProps{ + Description: "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_WatchEvent(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Event represents a single event to a watched resource.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "object": { + SchemaProps: spec.SchemaProps{ + Description: "Object is:\n * If Type is Added or Modified: the new state of the object.\n * If Type is Deleted: the state of the object immediately before deletion.\n * If Type is Error: *Status is recommended; other types may make sense\n depending on context.", + Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), + }, + }, + }, + Required: []string{"type", "object"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/runtime.RawExtension"}, + } +} + +func schema_k8sio_apimachinery_pkg_runtime_RawExtension(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.Object `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// External package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// On the wire, the JSON will look something like this:\n\n\t{\n\t\t\"kind\":\"MyAPIObject\",\n\t\t\"apiVersion\":\"v1\",\n\t\t\"myPlugin\": {\n\t\t\t\"kind\":\"PluginA\",\n\t\t\t\"aOption\":\"foo\",\n\t\t},\n\t}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)", + Type: []string{"object"}, + }, + }, + } +} + +func schema_k8sio_apimachinery_pkg_runtime_TypeMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TypeMeta is shared by all top level objects. The proper way to use it is to inline it in your type, like this:\n\n\ttype MyAwesomeAPIObject struct {\n\t runtime.TypeMeta `json:\",inline\"`\n\t ... // other fields\n\t}\n\nfunc (obj *MyAwesomeAPIObject) SetGroupVersionKind(gvk *metav1.GroupVersionKind) { metav1.UpdateTypeMeta(obj,gvk) }; GroupVersionKind() *GroupVersionKind\n\nTypeMeta is provided here for convenience. You may use it directly from this package or define your own with the same fields.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "kind": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_k8sio_apimachinery_pkg_runtime_Unknown(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Unknown allows api objects with unknown types to be passed-through. This can be used to deal with the API objects from a plug-in. Unknown objects still have functioning TypeMeta features-- kind, version, etc. metadata and field mutatation.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "kind": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "ContentEncoding": { + SchemaProps: spec.SchemaProps{ + Description: "ContentEncoding is encoding used to encode 'Raw' data. Unspecified means no encoding.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "ContentType": { + SchemaProps: spec.SchemaProps{ + Description: "ContentType is serialization method used to serialize 'Raw'. Unspecified means ContentTypeJSON.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"ContentEncoding", "ContentType"}, + }, + }, + } +} + +func schema_k8sio_apimachinery_pkg_version_Info(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Info contains versioning information. how we'll want to distribute that information.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "major": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "minor": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "gitVersion": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "gitCommit": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "gitTreeState": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "buildDate": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "goVersion": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "compiler": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "platform": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"major", "minor", "gitVersion", "gitCommit", "gitTreeState", "buildDate", "goVersion", "compiler", "platform"}, + }, + }, + } +} + +func schema_sigsk8sio_gateway_api_apisx_v1alpha2_BackendTrafficPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "BackendTrafficPolicy defines the configuration for how traffic to a target backend should be handled.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "Spec defines the desired state of BackendTrafficPolicy.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha2.BackendTrafficPolicySpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "Status defines the current state of BackendTrafficPolicy.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyStatus"), + }, + }, + }, + Required: []string{"spec"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyStatus", "sigs.k8s.io/gateway-api/apisx/v1alpha2.BackendTrafficPolicySpec"}, + } +} + +func schema_sigsk8sio_gateway_api_apisx_v1alpha2_BackendTrafficPolicyList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "BackendTrafficPolicyList contains a list of BackendTrafficPolicies", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha2.BackendTrafficPolicy"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/gateway-api/apisx/v1alpha2.BackendTrafficPolicy"}, + } +} + +func schema_sigsk8sio_gateway_api_apisx_v1alpha2_BackendTrafficPolicySpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "BackendTrafficPolicySpec define the desired state of BackendTrafficPolicy Note: there is no Override or Default policy configuration.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "targetRefs": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "group", + "kind", + "name", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "TargetRef identifies an API object to apply policy to. Currently, Backends (i.e. Service, ServiceImport, or any implementation-specific backendRef) are the only valid API target references.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.LocalPolicyTargetReference"), + }, + }, + }, + }, + }, + "retry": { + SchemaProps: spec.SchemaProps{ + Description: "RetryConstraint defines the configuration for when to allow or prevent further retries to a target backend by dynamically calculating a 'retry budget'. This budget is calculated based on the percentage of incoming traffic composed of retries over a given time interval. Once the budget is exceeded, additional retries will be rejected by the backend.\n\nFor example, if the retry budget interval is 10 seconds, there have been 1000 active requests in the past 10 seconds, and the allowed percentage of requests that can be retried is 20% (the default), then 200 of those requests may be composed of retries. Active requests will only be considered for the duration of the interval when calculating the retry budget.\n\nConfiguring a RetryConstraint in BackendTrafficPolicy is compatible with HTTPRoute Retry settings for each HTTPRouteRule that targets the same backend. While the HTTPRouteRule Retry stanza can specify whether a request should be retried and the number of retry attempts each client may perform, RetryConstraint helps prevent cascading failures, such as retry storms, during periods of consistent failures.\n\nAfter the retry budget has been exceeded, additional retries to the backend must return a 503 response to the client.\n\nAdditional configurations for defining a constraint on retries MAY be defined in the future.\n\nSupport: Extended\n\n", + Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha2.RetryConstraint"), + }, + }, + "sessionPersistence": { + SchemaProps: spec.SchemaProps{ + Description: "SessionPersistence defines and configures session persistence for the backend.\n\nSupport: Extended", + Ref: ref("sigs.k8s.io/gateway-api/apis/v1.SessionPersistence"), + }, + }, + }, + Required: []string{"targetRefs"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/gateway-api/apis/v1.SessionPersistence", "sigs.k8s.io/gateway-api/apis/v1alpha2.LocalPolicyTargetReference", "sigs.k8s.io/gateway-api/apisx/v1alpha2.RetryConstraint"}, + } +} + +func schema_sigsk8sio_gateway_api_apisx_v1alpha2_RequestRate(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "RequestRate expresses a rate of requests over a given period of time.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "count": { + SchemaProps: spec.SchemaProps{ + Description: "Count specifies the number of requests per time interval.\n\nSupport: Extended", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "interval": { + SchemaProps: spec.SchemaProps{ + Description: "Interval specifies the divisor of the rate of requests, the amount of time during which the given count of requests occur.\n\nSupport: Extended", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_sigsk8sio_gateway_api_apisx_v1alpha2_RetryConstraint(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "RetryConstraint defines the configuration for when to retry a request.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "budgetPercent": { + SchemaProps: spec.SchemaProps{ + Description: "BudgetPercent defines the maximum percentage of active requests that may be made up of retries.\n\nSupport: Extended", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "budgetInterval": { + SchemaProps: spec.SchemaProps{ + Description: "BudgetInterval defines the duration in which requests will be considered for calculating the budget for retries.\n\nSupport: Extended", + Type: []string{"string"}, + Format: "", + }, + }, + "minRetryRate": { + SchemaProps: spec.SchemaProps{ + Description: "MinRetryRate defines the minimum rate of retries that will be allowable over a specified duration of time.\n\nThis ensures that requests can still be retried during periods of low traffic, where the budget for retries may be calculated as a very low value.\n\nSupport: Extended", + Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha2.RequestRate"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/gateway-api/apisx/v1alpha2.RequestRate"}, + } +} diff --git a/apis/v1alpha2/backendtrafficpolicy_types.go b/apisx/v1alpha2/backendtrafficpolicy.go similarity index 100% rename from apis/v1alpha2/backendtrafficpolicy_types.go rename to apisx/v1alpha2/backendtrafficpolicy.go diff --git a/apisx/v1alpha2/doc.go b/apisx/v1alpha2/doc.go new file mode 100644 index 0000000000..f0040c2d02 --- /dev/null +++ b/apisx/v1alpha2/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2025 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package v1alpha2 contains API Schema definitions for the gateway.networking.k8s-x.io +// API group. +// +// +k8s:openapi-gen=true +// +kubebuilder:object:generate=true +// +groupName=gateway.networking.k8s-x.io +package v1alpha2 diff --git a/apisx/v1alpha2/shared_types.go b/apisx/v1alpha2/shared_types.go new file mode 100644 index 0000000000..d558a28819 --- /dev/null +++ b/apisx/v1alpha2/shared_types.go @@ -0,0 +1,46 @@ +/* +Copyright 2025 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha2 + +import v1 "sigs.k8s.io/gateway-api/apis/v1" +import v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" + +type ( + // +k8s:deepcopy-gen=false + SessionPersistence = v1.SessionPersistence + // +k8s:deepcopy-gen=false + Duration = v1.Duration + // +k8s:deepcopy-gen=false + PolicyStatus = v1alpha2.PolicyStatus + // +k8s:deepcopy-gen=false + LocalPolicyTargetReference = v1alpha2.LocalPolicyTargetReference +) + +// RequestRate expresses a rate of requests over a given period of time. +type RequestRate struct { + // Count specifies the number of requests per time interval. + // + // Support: Extended + // +kubebuilder:validation:Minimum=0 + Count *int `json:"count,omitempty"` + + // Interval specifies the divisor of the rate of requests, the amount of + // time during which the given count of requests occur. + // + // Support: Extended + Interval *Duration `json:"interval,omitempty"` +} diff --git a/apisx/v1alpha2/zz_generated.deepcopy.go b/apisx/v1alpha2/zz_generated.deepcopy.go new file mode 100644 index 0000000000..92268a7fac --- /dev/null +++ b/apisx/v1alpha2/zz_generated.deepcopy.go @@ -0,0 +1,171 @@ +//go:build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/gateway-api/apis/v1" + apisv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackendTrafficPolicy) DeepCopyInto(out *BackendTrafficPolicy) { + *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 BackendTrafficPolicy. +func (in *BackendTrafficPolicy) DeepCopy() *BackendTrafficPolicy { + if in == nil { + return nil + } + out := new(BackendTrafficPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BackendTrafficPolicy) 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 *BackendTrafficPolicyList) DeepCopyInto(out *BackendTrafficPolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]BackendTrafficPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendTrafficPolicyList. +func (in *BackendTrafficPolicyList) DeepCopy() *BackendTrafficPolicyList { + if in == nil { + return nil + } + out := new(BackendTrafficPolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BackendTrafficPolicyList) 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 *BackendTrafficPolicySpec) DeepCopyInto(out *BackendTrafficPolicySpec) { + *out = *in + if in.TargetRefs != nil { + in, out := &in.TargetRefs, &out.TargetRefs + *out = make([]apisv1alpha2.LocalPolicyTargetReference, len(*in)) + copy(*out, *in) + } + if in.RetryConstraint != nil { + in, out := &in.RetryConstraint, &out.RetryConstraint + *out = new(RetryConstraint) + (*in).DeepCopyInto(*out) + } + if in.SessionPersistence != nil { + in, out := &in.SessionPersistence, &out.SessionPersistence + *out = new(v1.SessionPersistence) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendTrafficPolicySpec. +func (in *BackendTrafficPolicySpec) DeepCopy() *BackendTrafficPolicySpec { + if in == nil { + return nil + } + out := new(BackendTrafficPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RequestRate) DeepCopyInto(out *RequestRate) { + *out = *in + if in.Count != nil { + in, out := &in.Count, &out.Count + *out = new(int) + **out = **in + } + if in.Interval != nil { + in, out := &in.Interval, &out.Interval + *out = new(v1.Duration) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequestRate. +func (in *RequestRate) DeepCopy() *RequestRate { + if in == nil { + return nil + } + out := new(RequestRate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RetryConstraint) DeepCopyInto(out *RetryConstraint) { + *out = *in + if in.BudgetPercent != nil { + in, out := &in.BudgetPercent, &out.BudgetPercent + *out = new(int) + **out = **in + } + if in.BudgetInterval != nil { + in, out := &in.BudgetInterval, &out.BudgetInterval + *out = new(v1.Duration) + **out = **in + } + if in.MinRetryRate != nil { + in, out := &in.MinRetryRate, &out.MinRetryRate + *out = new(RequestRate) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetryConstraint. +func (in *RetryConstraint) DeepCopy() *RetryConstraint { + if in == nil { + return nil + } + out := new(RetryConstraint) + in.DeepCopyInto(out) + return out +} diff --git a/apisx/v1alpha2/zz_generated.register.go b/apisx/v1alpha2/zz_generated.register.go new file mode 100644 index 0000000000..76ec2c9672 --- /dev/null +++ b/apisx/v1alpha2/zz_generated.register.go @@ -0,0 +1,70 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by register-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// GroupName specifies the group name used to register the objects. +const GroupName = "gateway.networking.k8s-x.io" + +// GroupVersion specifies the group and the version used to register the objects. +var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v1alpha2"} + +// SchemeGroupVersion is group version used to register these objects +// Deprecated: use GroupVersion instead. +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha2"} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. + SchemeBuilder runtime.SchemeBuilder + localSchemeBuilder = &SchemeBuilder + // Deprecated: use Install instead + AddToScheme = localSchemeBuilder.AddToScheme + Install = localSchemeBuilder.AddToScheme +) + +func init() { + // We only register manually written functions here. The registration of the + // generated functions takes place in the generated files. The separation + // makes the code compile even when the generated files are missing. + localSchemeBuilder.Register(addKnownTypes) +} + +// Adds the list of known types to Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &BackendTrafficPolicy{}, + &BackendTrafficPolicyList{}, + ) + // AddToGroupVersion allows the serialization of client types like ListOptions. + v1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/cmd/modelschema/main.go b/cmd/modelschema/main.go index a04294ace5..314ed9b72d 100644 --- a/cmd/modelschema/main.go +++ b/cmd/modelschema/main.go @@ -21,10 +21,12 @@ package main import ( "encoding/json" "fmt" + //"maps" "os" "strings" stable "sigs.k8s.io/gateway-api/apis/openapi" + //experimental "sigs.k8s.io/gateway-api/apisx/openapi" "k8s.io/kube-openapi/pkg/common" "k8s.io/kube-openapi/pkg/validation/spec" @@ -44,6 +46,8 @@ func output() error { return spec.MustCreateRef(fmt.Sprintf("#/definitions/%s", friendlyName(name))) } defs := stable.GetOpenAPIDefinitions(refFunc) + //maps.Copy(defs, experimental.GetOpenAPIDefinitions(refFunc)) + schemaDefs := make(map[string]spec.Schema, len(defs)) for k, v := range defs { // Replace top-level schema with v2 if a v2 schema is embedded diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha2/apis_client.go b/pkg/client/clientset/versioned/typed/apis/v1alpha2/apis_client.go index c24039215d..8431bb1688 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha2/apis_client.go +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha2/apis_client.go @@ -29,7 +29,6 @@ import ( type GatewayV1alpha2Interface interface { RESTClient() rest.Interface BackendLBPoliciesGetter - BackendTrafficPoliciesGetter GRPCRoutesGetter ReferenceGrantsGetter TCPRoutesGetter @@ -46,10 +45,6 @@ func (c *GatewayV1alpha2Client) BackendLBPolicies(namespace string) BackendLBPol return newBackendLBPolicies(c, namespace) } -func (c *GatewayV1alpha2Client) BackendTrafficPolicies(namespace string) BackendTrafficPolicyInterface { - return newBackendTrafficPolicies(c, namespace) -} - func (c *GatewayV1alpha2Client) GRPCRoutes(namespace string) GRPCRouteInterface { return newGRPCRoutes(c, namespace) } diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_apis_client.go b/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_apis_client.go index b50a66de8b..7ea0de6477 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_apis_client.go +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_apis_client.go @@ -32,10 +32,6 @@ func (c *FakeGatewayV1alpha2) BackendLBPolicies(namespace string) v1alpha2.Backe return &FakeBackendLBPolicies{c, namespace} } -func (c *FakeGatewayV1alpha2) BackendTrafficPolicies(namespace string) v1alpha2.BackendTrafficPolicyInterface { - return &FakeBackendTrafficPolicies{c, namespace} -} - func (c *FakeGatewayV1alpha2) GRPCRoutes(namespace string) v1alpha2.GRPCRouteInterface { return &FakeGRPCRoutes{c, namespace} } diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha2/generated_expansion.go b/pkg/client/clientset/versioned/typed/apis/v1alpha2/generated_expansion.go index c7a03b33fa..c0fe07b497 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha2/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha2/generated_expansion.go @@ -20,8 +20,6 @@ package v1alpha2 type BackendLBPolicyExpansion interface{} -type BackendTrafficPolicyExpansion interface{} - type GRPCRouteExpansion interface{} type ReferenceGrantExpansion interface{} diff --git a/pkg/client/informers/externalversions/apis/v1alpha2/interface.go b/pkg/client/informers/externalversions/apis/v1alpha2/interface.go index cd253ab0ae..8f21c3d8e6 100644 --- a/pkg/client/informers/externalversions/apis/v1alpha2/interface.go +++ b/pkg/client/informers/externalversions/apis/v1alpha2/interface.go @@ -26,8 +26,6 @@ import ( type Interface interface { // BackendLBPolicies returns a BackendLBPolicyInformer. BackendLBPolicies() BackendLBPolicyInformer - // BackendTrafficPolicies returns a BackendTrafficPolicyInformer. - BackendTrafficPolicies() BackendTrafficPolicyInformer // GRPCRoutes returns a GRPCRouteInformer. GRPCRoutes() GRPCRouteInformer // ReferenceGrants returns a ReferenceGrantInformer. @@ -56,11 +54,6 @@ func (v *version) BackendLBPolicies() BackendLBPolicyInformer { return &backendLBPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// BackendTrafficPolicies returns a BackendTrafficPolicyInformer. -func (v *version) BackendTrafficPolicies() BackendTrafficPolicyInformer { - return &backendTrafficPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - // GRPCRoutes returns a GRPCRouteInformer. func (v *version) GRPCRoutes() GRPCRouteInformer { return &gRPCRouteInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index 88f2ce2ce3..283d2475b2 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -68,8 +68,6 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource // Group=gateway.networking.k8s.io, Version=v1alpha2 case v1alpha2.SchemeGroupVersion.WithResource("backendlbpolicies"): return &genericInformer{resource: resource.GroupResource(), informer: f.Gateway().V1alpha2().BackendLBPolicies().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("backendtrafficpolicies"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Gateway().V1alpha2().BackendTrafficPolicies().Informer()}, nil case v1alpha2.SchemeGroupVersion.WithResource("grpcroutes"): return &genericInformer{resource: resource.GroupResource(), informer: f.Gateway().V1alpha2().GRPCRoutes().Informer()}, nil case v1alpha2.SchemeGroupVersion.WithResource("referencegrants"): diff --git a/pkg/client/listers/apis/v1alpha2/expansion_generated.go b/pkg/client/listers/apis/v1alpha2/expansion_generated.go index 98516d30c3..d311d49157 100644 --- a/pkg/client/listers/apis/v1alpha2/expansion_generated.go +++ b/pkg/client/listers/apis/v1alpha2/expansion_generated.go @@ -26,14 +26,6 @@ type BackendLBPolicyListerExpansion interface{} // BackendLBPolicyNamespaceLister. type BackendLBPolicyNamespaceListerExpansion interface{} -// BackendTrafficPolicyListerExpansion allows custom methods to be added to -// BackendTrafficPolicyLister. -type BackendTrafficPolicyListerExpansion interface{} - -// BackendTrafficPolicyNamespaceListerExpansion allows custom methods to be added to -// BackendTrafficPolicyNamespaceLister. -type BackendTrafficPolicyNamespaceListerExpansion interface{} - // GRPCRouteListerExpansion allows custom methods to be added to // GRPCRouteLister. type GRPCRouteListerExpansion interface{} diff --git a/pkg/clientx/clientset/versioned/clientset.go b/pkg/clientx/clientset/versioned/clientset.go new file mode 100644 index 0000000000..bcd9673959 --- /dev/null +++ b/pkg/clientx/clientset/versioned/clientset.go @@ -0,0 +1,120 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package versioned + +import ( + "fmt" + "net/http" + + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" + gatewayv1alpha2 "sigs.k8s.io/gateway-api/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + GatewayV1alpha2() gatewayv1alpha2.GatewayV1alpha2Interface +} + +// Clientset contains the clients for groups. +type Clientset struct { + *discovery.DiscoveryClient + gatewayV1alpha2 *gatewayv1alpha2.GatewayV1alpha2Client +} + +// GatewayV1alpha2 retrieves the GatewayV1alpha2Client +func (c *Clientset) GatewayV1alpha2() gatewayv1alpha2.GatewayV1alpha2Interface { + return c.gatewayV1alpha2 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + if c == nil { + return nil + } + return c.DiscoveryClient +} + +// NewForConfig creates a new Clientset for the given config. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfig will generate a rate-limiter in configShallowCopy. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*Clientset, error) { + configShallowCopy := *c + + if configShallowCopy.UserAgent == "" { + configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() + } + + // share the transport between all clients + httpClient, err := rest.HTTPClientFor(&configShallowCopy) + if err != nil { + return nil, err + } + + return NewForConfigAndClient(&configShallowCopy, httpClient) +} + +// NewForConfigAndClient creates a new Clientset for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. +func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { + configShallowCopy := *c + if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + if configShallowCopy.Burst <= 0 { + return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + } + configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) + } + + var cs Clientset + var err error + cs.gatewayV1alpha2, err = gatewayv1alpha2.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + return &cs, nil +} + +// NewForConfigOrDie creates a new Clientset for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *Clientset { + cs, err := NewForConfig(c) + if err != nil { + panic(err) + } + return cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.gatewayV1alpha2 = gatewayv1alpha2.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/pkg/clientx/clientset/versioned/fake/clientset_generated.go b/pkg/clientx/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 0000000000..d34e83fbd6 --- /dev/null +++ b/pkg/clientx/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,122 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" + applyconfiguration "sigs.k8s.io/gateway-api/apisx/applyconfiguration" + clientset "sigs.k8s.io/gateway-api/pkg/clientx/clientset/versioned" + gatewayv1alpha2 "sigs.k8s.io/gateway-api/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2" + fakegatewayv1alpha2 "sigs.k8s.io/gateway-api/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake" +) + +// NewSimpleClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +// +// DEPRECATED: NewClientset replaces this with support for field management, which significantly improves +// server side apply testing. NewClientset is only available when apply configurations are generated (e.g. +// via --with-applyconfig). +func NewSimpleClientset(objects ...runtime.Object) *Clientset { + o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +// Clientset implements clientset.Interface. Meant to be embedded into a +// struct to get a default implementation. This makes faking out just the method +// you want to test easier. +type Clientset struct { + testing.Fake + discovery *fakediscovery.FakeDiscovery + tracker testing.ObjectTracker +} + +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +// NewClientset 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 +// for a real clientset and is mostly useful in simple unit tests. +func NewClientset(objects ...runtime.Object) *Clientset { + o := testing.NewFieldManagedObjectTracker( + scheme, + codecs.UniversalDecoder(), + applyconfiguration.NewTypeConverter(scheme), + ) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +var ( + _ clientset.Interface = &Clientset{} + _ testing.FakeClient = &Clientset{} +) + +// GatewayV1alpha2 retrieves the GatewayV1alpha2Client +func (c *Clientset) GatewayV1alpha2() gatewayv1alpha2.GatewayV1alpha2Interface { + return &fakegatewayv1alpha2.FakeGatewayV1alpha2{Fake: &c.Fake} +} diff --git a/pkg/clientx/clientset/versioned/fake/doc.go b/pkg/clientx/clientset/versioned/fake/doc.go new file mode 100644 index 0000000000..9b99e71670 --- /dev/null +++ b/pkg/clientx/clientset/versioned/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/pkg/clientx/clientset/versioned/fake/register.go b/pkg/clientx/clientset/versioned/fake/register.go new file mode 100644 index 0000000000..00545e05f4 --- /dev/null +++ b/pkg/clientx/clientset/versioned/fake/register.go @@ -0,0 +1,56 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + gatewayv1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +var localSchemeBuilder = runtime.SchemeBuilder{ + gatewayv1alpha2.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(scheme)) +} diff --git a/pkg/clientx/clientset/versioned/scheme/doc.go b/pkg/clientx/clientset/versioned/scheme/doc.go new file mode 100644 index 0000000000..7dc3756168 --- /dev/null +++ b/pkg/clientx/clientset/versioned/scheme/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/pkg/clientx/clientset/versioned/scheme/register.go b/pkg/clientx/clientset/versioned/scheme/register.go new file mode 100644 index 0000000000..74ac3ad54a --- /dev/null +++ b/pkg/clientx/clientset/versioned/scheme/register.go @@ -0,0 +1,56 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package scheme + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + gatewayv1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + gatewayv1alpha2.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(Scheme)) +} diff --git a/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/apisx_client.go b/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/apisx_client.go new file mode 100644 index 0000000000..1bd8a8caa0 --- /dev/null +++ b/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/apisx_client.go @@ -0,0 +1,107 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + "net/http" + + rest "k8s.io/client-go/rest" + v1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" + "sigs.k8s.io/gateway-api/pkg/clientx/clientset/versioned/scheme" +) + +type GatewayV1alpha2Interface interface { + RESTClient() rest.Interface + BackendTrafficPoliciesGetter +} + +// GatewayV1alpha2Client is used to interact with features provided by the gateway.networking.k8s-x.io group. +type GatewayV1alpha2Client struct { + restClient rest.Interface +} + +func (c *GatewayV1alpha2Client) BackendTrafficPolicies(namespace string) BackendTrafficPolicyInterface { + return newBackendTrafficPolicies(c, namespace) +} + +// NewForConfig creates a new GatewayV1alpha2Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*GatewayV1alpha2Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new GatewayV1alpha2Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*GatewayV1alpha2Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &GatewayV1alpha2Client{client}, nil +} + +// NewForConfigOrDie creates a new GatewayV1alpha2Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *GatewayV1alpha2Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new GatewayV1alpha2Client for the given RESTClient. +func New(c rest.Interface) *GatewayV1alpha2Client { + return &GatewayV1alpha2Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha2.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *GatewayV1alpha2Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/backendtrafficpolicy.go b/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/backendtrafficpolicy.go new file mode 100644 index 0000000000..5ff0a5219e --- /dev/null +++ b/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/backendtrafficpolicy.go @@ -0,0 +1,73 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" + apisxv1alpha2 "sigs.k8s.io/gateway-api/apisx/applyconfiguration/apisx/v1alpha2" + v1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" + scheme "sigs.k8s.io/gateway-api/pkg/clientx/clientset/versioned/scheme" +) + +// BackendTrafficPoliciesGetter has a method to return a BackendTrafficPolicyInterface. +// A group's client should implement this interface. +type BackendTrafficPoliciesGetter interface { + BackendTrafficPolicies(namespace string) BackendTrafficPolicyInterface +} + +// BackendTrafficPolicyInterface has methods to work with BackendTrafficPolicy resources. +type BackendTrafficPolicyInterface interface { + Create(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.CreateOptions) (*v1alpha2.BackendTrafficPolicy, error) + Update(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.UpdateOptions) (*v1alpha2.BackendTrafficPolicy, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.UpdateOptions) (*v1alpha2.BackendTrafficPolicy, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.BackendTrafficPolicy, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.BackendTrafficPolicyList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.BackendTrafficPolicy, err error) + Apply(ctx context.Context, backendTrafficPolicy *apisxv1alpha2.BackendTrafficPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendTrafficPolicy, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, backendTrafficPolicy *apisxv1alpha2.BackendTrafficPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendTrafficPolicy, err error) + BackendTrafficPolicyExpansion +} + +// backendTrafficPolicies implements BackendTrafficPolicyInterface +type backendTrafficPolicies struct { + *gentype.ClientWithListAndApply[*v1alpha2.BackendTrafficPolicy, *v1alpha2.BackendTrafficPolicyList, *apisxv1alpha2.BackendTrafficPolicyApplyConfiguration] +} + +// newBackendTrafficPolicies returns a BackendTrafficPolicies +func newBackendTrafficPolicies(c *GatewayV1alpha2Client, namespace string) *backendTrafficPolicies { + return &backendTrafficPolicies{ + gentype.NewClientWithListAndApply[*v1alpha2.BackendTrafficPolicy, *v1alpha2.BackendTrafficPolicyList, *apisxv1alpha2.BackendTrafficPolicyApplyConfiguration]( + "backendtrafficpolicies", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha2.BackendTrafficPolicy { return &v1alpha2.BackendTrafficPolicy{} }, + func() *v1alpha2.BackendTrafficPolicyList { return &v1alpha2.BackendTrafficPolicyList{} }), + } +} diff --git a/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/doc.go b/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/doc.go new file mode 100644 index 0000000000..baaf2d9853 --- /dev/null +++ b/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha2 diff --git a/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake/doc.go b/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake/doc.go new file mode 100644 index 0000000000..16f4439906 --- /dev/null +++ b/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake/fake_apisx_client.go b/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake/fake_apisx_client.go new file mode 100644 index 0000000000..e10c727845 --- /dev/null +++ b/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake/fake_apisx_client.go @@ -0,0 +1,40 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + v1alpha2 "sigs.k8s.io/gateway-api/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2" +) + +type FakeGatewayV1alpha2 struct { + *testing.Fake +} + +func (c *FakeGatewayV1alpha2) BackendTrafficPolicies(namespace string) v1alpha2.BackendTrafficPolicyInterface { + return &FakeBackendTrafficPolicies{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeGatewayV1alpha2) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake/fake_backendtrafficpolicy.go b/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake/fake_backendtrafficpolicy.go new file mode 100644 index 0000000000..cee9f4fbe4 --- /dev/null +++ b/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake/fake_backendtrafficpolicy.go @@ -0,0 +1,197 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1 "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" + apisxv1alpha2 "sigs.k8s.io/gateway-api/apisx/applyconfiguration/apisx/v1alpha2" + v1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" +) + +// FakeBackendTrafficPolicies implements BackendTrafficPolicyInterface +type FakeBackendTrafficPolicies struct { + Fake *FakeGatewayV1alpha2 + ns string +} + +var backendtrafficpoliciesResource = v1alpha2.SchemeGroupVersion.WithResource("backendtrafficpolicies") + +var backendtrafficpoliciesKind = v1alpha2.SchemeGroupVersion.WithKind("BackendTrafficPolicy") + +// Get takes name of the backendTrafficPolicy, and returns the corresponding backendTrafficPolicy object, and an error if there is any. +func (c *FakeBackendTrafficPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { + emptyResult := &v1alpha2.BackendTrafficPolicy{} + obj, err := c.Fake. + Invokes(testing.NewGetActionWithOptions(backendtrafficpoliciesResource, c.ns, name, options), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha2.BackendTrafficPolicy), err +} + +// List takes label and field selectors, and returns the list of BackendTrafficPolicies that match those selectors. +func (c *FakeBackendTrafficPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.BackendTrafficPolicyList, err error) { + emptyResult := &v1alpha2.BackendTrafficPolicyList{} + obj, err := c.Fake. + Invokes(testing.NewListActionWithOptions(backendtrafficpoliciesResource, backendtrafficpoliciesKind, c.ns, opts), emptyResult) + + if obj == nil { + return emptyResult, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha2.BackendTrafficPolicyList{ListMeta: obj.(*v1alpha2.BackendTrafficPolicyList).ListMeta} + for _, item := range obj.(*v1alpha2.BackendTrafficPolicyList).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 backendTrafficPolicies. +func (c *FakeBackendTrafficPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchActionWithOptions(backendtrafficpoliciesResource, c.ns, opts)) + +} + +// Create takes the representation of a backendTrafficPolicy and creates it. Returns the server's representation of the backendTrafficPolicy, and an error, if there is any. +func (c *FakeBackendTrafficPolicies) Create(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.CreateOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { + emptyResult := &v1alpha2.BackendTrafficPolicy{} + obj, err := c.Fake. + Invokes(testing.NewCreateActionWithOptions(backendtrafficpoliciesResource, c.ns, backendTrafficPolicy, opts), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha2.BackendTrafficPolicy), err +} + +// Update takes the representation of a backendTrafficPolicy and updates it. Returns the server's representation of the backendTrafficPolicy, and an error, if there is any. +func (c *FakeBackendTrafficPolicies) Update(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.UpdateOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { + emptyResult := &v1alpha2.BackendTrafficPolicy{} + obj, err := c.Fake. + Invokes(testing.NewUpdateActionWithOptions(backendtrafficpoliciesResource, c.ns, backendTrafficPolicy, opts), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha2.BackendTrafficPolicy), 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 *FakeBackendTrafficPolicies) UpdateStatus(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.UpdateOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { + emptyResult := &v1alpha2.BackendTrafficPolicy{} + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceActionWithOptions(backendtrafficpoliciesResource, "status", c.ns, backendTrafficPolicy, opts), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha2.BackendTrafficPolicy), err +} + +// Delete takes name of the backendTrafficPolicy and deletes it. Returns an error if one occurs. +func (c *FakeBackendTrafficPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(backendtrafficpoliciesResource, c.ns, name, opts), &v1alpha2.BackendTrafficPolicy{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeBackendTrafficPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionActionWithOptions(backendtrafficpoliciesResource, c.ns, opts, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha2.BackendTrafficPolicyList{}) + return err +} + +// Patch applies the patch and returns the patched backendTrafficPolicy. +func (c *FakeBackendTrafficPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.BackendTrafficPolicy, err error) { + emptyResult := &v1alpha2.BackendTrafficPolicy{} + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceActionWithOptions(backendtrafficpoliciesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha2.BackendTrafficPolicy), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied backendTrafficPolicy. +func (c *FakeBackendTrafficPolicies) Apply(ctx context.Context, backendTrafficPolicy *apisxv1alpha2.BackendTrafficPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { + if backendTrafficPolicy == nil { + return nil, fmt.Errorf("backendTrafficPolicy provided to Apply must not be nil") + } + data, err := json.Marshal(backendTrafficPolicy) + if err != nil { + return nil, err + } + name := backendTrafficPolicy.Name + if name == nil { + return nil, fmt.Errorf("backendTrafficPolicy.Name must be provided to Apply") + } + emptyResult := &v1alpha2.BackendTrafficPolicy{} + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceActionWithOptions(backendtrafficpoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha2.BackendTrafficPolicy), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeBackendTrafficPolicies) ApplyStatus(ctx context.Context, backendTrafficPolicy *apisxv1alpha2.BackendTrafficPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { + if backendTrafficPolicy == nil { + return nil, fmt.Errorf("backendTrafficPolicy provided to Apply must not be nil") + } + data, err := json.Marshal(backendTrafficPolicy) + if err != nil { + return nil, err + } + name := backendTrafficPolicy.Name + if name == nil { + return nil, fmt.Errorf("backendTrafficPolicy.Name must be provided to Apply") + } + emptyResult := &v1alpha2.BackendTrafficPolicy{} + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceActionWithOptions(backendtrafficpoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha2.BackendTrafficPolicy), err +} diff --git a/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/generated_expansion.go b/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/generated_expansion.go new file mode 100644 index 0000000000..2ca07ad3bf --- /dev/null +++ b/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/generated_expansion.go @@ -0,0 +1,21 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha2 + +type BackendTrafficPolicyExpansion interface{} diff --git a/pkg/clientx/informers/externalversions/apisx/interface.go b/pkg/clientx/informers/externalversions/apisx/interface.go new file mode 100644 index 0000000000..0b7ed24fe5 --- /dev/null +++ b/pkg/clientx/informers/externalversions/apisx/interface.go @@ -0,0 +1,46 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package apisx + +import ( + v1alpha2 "sigs.k8s.io/gateway-api/pkg/clientx/informers/externalversions/apisx/v1alpha2" + internalinterfaces "sigs.k8s.io/gateway-api/pkg/clientx/informers/externalversions/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1alpha2 provides access to shared informers for resources in V1alpha2. + V1alpha2() v1alpha2.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1alpha2 returns a new v1alpha2.Interface. +func (g *group) V1alpha2() v1alpha2.Interface { + return v1alpha2.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/pkg/clientx/informers/externalversions/apisx/v1alpha2/backendtrafficpolicy.go b/pkg/clientx/informers/externalversions/apisx/v1alpha2/backendtrafficpolicy.go new file mode 100644 index 0000000000..0d944706ea --- /dev/null +++ b/pkg/clientx/informers/externalversions/apisx/v1alpha2/backendtrafficpolicy.go @@ -0,0 +1,90 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + "context" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + apisxv1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" + versioned "sigs.k8s.io/gateway-api/pkg/clientx/clientset/versioned" + internalinterfaces "sigs.k8s.io/gateway-api/pkg/clientx/informers/externalversions/internalinterfaces" + v1alpha2 "sigs.k8s.io/gateway-api/pkg/clientx/listers/apisx/v1alpha2" +) + +// BackendTrafficPolicyInformer provides access to a shared informer and lister for +// BackendTrafficPolicies. +type BackendTrafficPolicyInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha2.BackendTrafficPolicyLister +} + +type backendTrafficPolicyInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewBackendTrafficPolicyInformer constructs a new informer for BackendTrafficPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewBackendTrafficPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredBackendTrafficPolicyInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredBackendTrafficPolicyInformer constructs a new informer for BackendTrafficPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredBackendTrafficPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GatewayV1alpha2().BackendTrafficPolicies(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.GatewayV1alpha2().BackendTrafficPolicies(namespace).Watch(context.TODO(), options) + }, + }, + &apisxv1alpha2.BackendTrafficPolicy{}, + resyncPeriod, + indexers, + ) +} + +func (f *backendTrafficPolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredBackendTrafficPolicyInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *backendTrafficPolicyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apisxv1alpha2.BackendTrafficPolicy{}, f.defaultInformer) +} + +func (f *backendTrafficPolicyInformer) Lister() v1alpha2.BackendTrafficPolicyLister { + return v1alpha2.NewBackendTrafficPolicyLister(f.Informer().GetIndexer()) +} diff --git a/pkg/clientx/informers/externalversions/apisx/v1alpha2/interface.go b/pkg/clientx/informers/externalversions/apisx/v1alpha2/interface.go new file mode 100644 index 0000000000..6c901cbd9c --- /dev/null +++ b/pkg/clientx/informers/externalversions/apisx/v1alpha2/interface.go @@ -0,0 +1,45 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + internalinterfaces "sigs.k8s.io/gateway-api/pkg/clientx/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // BackendTrafficPolicies returns a BackendTrafficPolicyInformer. + BackendTrafficPolicies() BackendTrafficPolicyInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// BackendTrafficPolicies returns a BackendTrafficPolicyInformer. +func (v *version) BackendTrafficPolicies() BackendTrafficPolicyInformer { + return &backendTrafficPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/pkg/clientx/informers/externalversions/factory.go b/pkg/clientx/informers/externalversions/factory.go new file mode 100644 index 0000000000..e1e5b181b6 --- /dev/null +++ b/pkg/clientx/informers/externalversions/factory.go @@ -0,0 +1,262 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + reflect "reflect" + sync "sync" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" + versioned "sigs.k8s.io/gateway-api/pkg/clientx/clientset/versioned" + apisx "sigs.k8s.io/gateway-api/pkg/clientx/informers/externalversions/apisx" + internalinterfaces "sigs.k8s.io/gateway-api/pkg/clientx/informers/externalversions/internalinterfaces" +) + +// SharedInformerOption defines the functional option type for SharedInformerFactory. +type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory + +type sharedInformerFactory struct { + client versioned.Interface + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc + lock sync.Mutex + defaultResync time.Duration + customResync map[reflect.Type]time.Duration + transform cache.TransformFunc + + informers map[reflect.Type]cache.SharedIndexInformer + // startedInformers is used for tracking which informers have been started. + // This allows Start() to be called multiple times safely. + startedInformers map[reflect.Type]bool + // wg tracks how many goroutines were started. + wg sync.WaitGroup + // shuttingDown is true when Shutdown has been called. It may still be running + // because it needs to wait for goroutines. + shuttingDown bool +} + +// WithCustomResyncConfig sets a custom resync period for the specified informer types. +func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + for k, v := range resyncConfig { + factory.customResync[reflect.TypeOf(k)] = v + } + return factory + } +} + +// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. +func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.tweakListOptions = tweakListOptions + return factory + } +} + +// WithNamespace limits the SharedInformerFactory to the specified namespace. +func WithNamespace(namespace string) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.namespace = namespace + return factory + } +} + +// WithTransform sets a transform on all informers. +func WithTransform(transform cache.TransformFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.transform = transform + return factory + } +} + +// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. +func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync) +} + +// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. +// Listers obtained via this SharedInformerFactory will be subject to the same filters +// as specified here. +// Deprecated: Please use NewSharedInformerFactoryWithOptions instead +func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) +} + +// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. +func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { + factory := &sharedInformerFactory{ + client: client, + namespace: v1.NamespaceAll, + defaultResync: defaultResync, + informers: make(map[reflect.Type]cache.SharedIndexInformer), + startedInformers: make(map[reflect.Type]bool), + customResync: make(map[reflect.Type]time.Duration), + } + + // Apply all options + for _, opt := range options { + factory = opt(factory) + } + + return factory +} + +func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { + f.lock.Lock() + defer f.lock.Unlock() + + if f.shuttingDown { + return + } + + for informerType, informer := range f.informers { + if !f.startedInformers[informerType] { + f.wg.Add(1) + // We need a new variable in each loop iteration, + // otherwise the goroutine would use the loop variable + // and that keeps changing. + informer := informer + go func() { + defer f.wg.Done() + informer.Run(stopCh) + }() + f.startedInformers[informerType] = true + } + } +} + +func (f *sharedInformerFactory) Shutdown() { + f.lock.Lock() + f.shuttingDown = true + f.lock.Unlock() + + // Will return immediately if there is nothing to wait for. + f.wg.Wait() +} + +func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { + informers := func() map[reflect.Type]cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informers := map[reflect.Type]cache.SharedIndexInformer{} + for informerType, informer := range f.informers { + if f.startedInformers[informerType] { + informers[informerType] = informer + } + } + return informers + }() + + res := map[reflect.Type]bool{} + for informType, informer := range informers { + res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) + } + return res +} + +// InformerFor returns the SharedIndexInformer for obj using an internal +// client. +func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informerType := reflect.TypeOf(obj) + informer, exists := f.informers[informerType] + if exists { + return informer + } + + resyncPeriod, exists := f.customResync[informerType] + if !exists { + resyncPeriod = f.defaultResync + } + + informer = newFunc(f.client, resyncPeriod) + informer.SetTransform(f.transform) + f.informers[informerType] = informer + + return informer +} + +// SharedInformerFactory provides shared informers for resources in all known +// API group versions. +// +// It is typically used like this: +// +// ctx, cancel := context.Background() +// defer cancel() +// factory := NewSharedInformerFactory(client, resyncPeriod) +// defer factory.WaitForStop() // Returns immediately if nothing was started. +// genericInformer := factory.ForResource(resource) +// typedInformer := factory.SomeAPIGroup().V1().SomeType() +// factory.Start(ctx.Done()) // Start processing these informers. +// synced := factory.WaitForCacheSync(ctx.Done()) +// for v, ok := range synced { +// if !ok { +// fmt.Fprintf(os.Stderr, "caches failed to sync: %v", v) +// return +// } +// } +// +// // Creating informers can also be created after Start, but then +// // Start must be called again: +// anotherGenericInformer := factory.ForResource(resource) +// factory.Start(ctx.Done()) +type SharedInformerFactory interface { + internalinterfaces.SharedInformerFactory + + // Start initializes all requested informers. They are handled in goroutines + // which run until the stop channel gets closed. + // Warning: Start does not block. When run in a go-routine, it will race with a later WaitForCacheSync. + Start(stopCh <-chan struct{}) + + // Shutdown marks a factory as shutting down. At that point no new + // informers can be started anymore and Start will return without + // doing anything. + // + // In addition, Shutdown blocks until all goroutines have terminated. For that + // to happen, the close channel(s) that they were started with must be closed, + // either before Shutdown gets called or while it is waiting. + // + // Shutdown may be called multiple times, even concurrently. All such calls will + // block until all goroutines have terminated. + Shutdown() + + // WaitForCacheSync blocks until all started informers' caches were synced + // or the stop channel gets closed. + WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + + // ForResource gives generic access to a shared informer of the matching type. + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + + // InformerFor returns the SharedIndexInformer for obj using an internal + // client. + InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer + + Gateway() apisx.Interface +} + +func (f *sharedInformerFactory) Gateway() apisx.Interface { + return apisx.New(f, f.namespace, f.tweakListOptions) +} diff --git a/pkg/clientx/informers/externalversions/generic.go b/pkg/clientx/informers/externalversions/generic.go new file mode 100644 index 0000000000..36bcda90c0 --- /dev/null +++ b/pkg/clientx/informers/externalversions/generic.go @@ -0,0 +1,62 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + "fmt" + + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" + v1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" +) + +// GenericInformer is type of SharedIndexInformer which will locate and delegate to other +// sharedInformers based on type +type GenericInformer interface { + Informer() cache.SharedIndexInformer + Lister() cache.GenericLister +} + +type genericInformer struct { + informer cache.SharedIndexInformer + resource schema.GroupResource +} + +// Informer returns the SharedIndexInformer. +func (f *genericInformer) Informer() cache.SharedIndexInformer { + return f.informer +} + +// Lister returns the GenericLister. +func (f *genericInformer) Lister() cache.GenericLister { + return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) +} + +// ForResource gives generic access to a shared informer of the matching type +// TODO extend this to unknown resources with a client pool +func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { + switch resource { + // Group=gateway.networking.k8s-x.io, Version=v1alpha2 + case v1alpha2.SchemeGroupVersion.WithResource("backendtrafficpolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Gateway().V1alpha2().BackendTrafficPolicies().Informer()}, nil + + } + + return nil, fmt.Errorf("no informer found for %v", resource) +} diff --git a/pkg/clientx/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/clientx/informers/externalversions/internalinterfaces/factory_interfaces.go new file mode 100644 index 0000000000..62ea99f2d0 --- /dev/null +++ b/pkg/clientx/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -0,0 +1,40 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package internalinterfaces + +import ( + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + cache "k8s.io/client-go/tools/cache" + versioned "sigs.k8s.io/gateway-api/pkg/clientx/clientset/versioned" +) + +// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. +type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer + +// SharedInformerFactory a small interface to allow for adding an informer without an import cycle +type SharedInformerFactory interface { + Start(stopCh <-chan struct{}) + InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer +} + +// TweakListOptionsFunc is a function that transforms a v1.ListOptions. +type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/pkg/clientx/listers/apisx/v1alpha2/backendtrafficpolicy.go b/pkg/clientx/listers/apisx/v1alpha2/backendtrafficpolicy.go new file mode 100644 index 0000000000..8e8f95ba67 --- /dev/null +++ b/pkg/clientx/listers/apisx/v1alpha2/backendtrafficpolicy.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" + "k8s.io/client-go/tools/cache" + v1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" +) + +// BackendTrafficPolicyLister helps list BackendTrafficPolicies. +// All objects returned here must be treated as read-only. +type BackendTrafficPolicyLister interface { + // List lists all BackendTrafficPolicies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha2.BackendTrafficPolicy, err error) + // BackendTrafficPolicies returns an object that can list and get BackendTrafficPolicies. + BackendTrafficPolicies(namespace string) BackendTrafficPolicyNamespaceLister + BackendTrafficPolicyListerExpansion +} + +// backendTrafficPolicyLister implements the BackendTrafficPolicyLister interface. +type backendTrafficPolicyLister struct { + listers.ResourceIndexer[*v1alpha2.BackendTrafficPolicy] +} + +// NewBackendTrafficPolicyLister returns a new BackendTrafficPolicyLister. +func NewBackendTrafficPolicyLister(indexer cache.Indexer) BackendTrafficPolicyLister { + return &backendTrafficPolicyLister{listers.New[*v1alpha2.BackendTrafficPolicy](indexer, v1alpha2.Resource("backendtrafficpolicy"))} +} + +// BackendTrafficPolicies returns an object that can list and get BackendTrafficPolicies. +func (s *backendTrafficPolicyLister) BackendTrafficPolicies(namespace string) BackendTrafficPolicyNamespaceLister { + return backendTrafficPolicyNamespaceLister{listers.NewNamespaced[*v1alpha2.BackendTrafficPolicy](s.ResourceIndexer, namespace)} +} + +// BackendTrafficPolicyNamespaceLister helps list and get BackendTrafficPolicies. +// All objects returned here must be treated as read-only. +type BackendTrafficPolicyNamespaceLister interface { + // List lists all BackendTrafficPolicies in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha2.BackendTrafficPolicy, err error) + // Get retrieves the BackendTrafficPolicy from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha2.BackendTrafficPolicy, error) + BackendTrafficPolicyNamespaceListerExpansion +} + +// backendTrafficPolicyNamespaceLister implements the BackendTrafficPolicyNamespaceLister +// interface. +type backendTrafficPolicyNamespaceLister struct { + listers.ResourceIndexer[*v1alpha2.BackendTrafficPolicy] +} diff --git a/pkg/clientx/listers/apisx/v1alpha2/expansion_generated.go b/pkg/clientx/listers/apisx/v1alpha2/expansion_generated.go new file mode 100644 index 0000000000..ff3d49e565 --- /dev/null +++ b/pkg/clientx/listers/apisx/v1alpha2/expansion_generated.go @@ -0,0 +1,27 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha2 + +// BackendTrafficPolicyListerExpansion allows custom methods to be added to +// BackendTrafficPolicyLister. +type BackendTrafficPolicyListerExpansion interface{} + +// BackendTrafficPolicyNamespaceListerExpansion allows custom methods to be added to +// BackendTrafficPolicyNamespaceLister. +type BackendTrafficPolicyNamespaceListerExpansion interface{} From dcc5729ad5c264c56efc9566b020db70392991a3 Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Thu, 13 Feb 2025 09:02:44 -0500 Subject: [PATCH 13/32] Delete files that were generated before moving to apisx --- .../apis/v1alpha2/backendtrafficpolicy.go | 264 ------------------ .../apis/v1alpha2/backendtrafficpolicyspec.go | 66 ----- .../apis/v1alpha2/requestrate.go | 52 ---- .../apis/v1alpha2/retryconstraint.go | 61 ---- .../apis/v1alpha2/backendtrafficpolicy.go | 73 ----- .../fake/fake_backendtrafficpolicy.go | 197 ------------- .../apis/v1alpha2/backendtrafficpolicy.go | 90 ------ .../apis/v1alpha2/backendtrafficpolicy.go | 70 ----- 8 files changed, 873 deletions(-) delete mode 100644 apis/applyconfiguration/apis/v1alpha2/backendtrafficpolicy.go delete mode 100644 apis/applyconfiguration/apis/v1alpha2/backendtrafficpolicyspec.go delete mode 100644 apis/applyconfiguration/apis/v1alpha2/requestrate.go delete mode 100644 apis/applyconfiguration/apis/v1alpha2/retryconstraint.go delete mode 100644 pkg/client/clientset/versioned/typed/apis/v1alpha2/backendtrafficpolicy.go delete mode 100644 pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_backendtrafficpolicy.go delete mode 100644 pkg/client/informers/externalversions/apis/v1alpha2/backendtrafficpolicy.go delete mode 100644 pkg/client/listers/apis/v1alpha2/backendtrafficpolicy.go diff --git a/apis/applyconfiguration/apis/v1alpha2/backendtrafficpolicy.go b/apis/applyconfiguration/apis/v1alpha2/backendtrafficpolicy.go deleted file mode 100644 index f6ab468e7d..0000000000 --- a/apis/applyconfiguration/apis/v1alpha2/backendtrafficpolicy.go +++ /dev/null @@ -1,264 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - managedfields "k8s.io/apimachinery/pkg/util/managedfields" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" - internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" - apisv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" -) - -// BackendTrafficPolicyApplyConfiguration represents a declarative configuration of the BackendTrafficPolicy type for use -// with apply. -type BackendTrafficPolicyApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *BackendTrafficPolicySpecApplyConfiguration `json:"spec,omitempty"` - Status *PolicyStatusApplyConfiguration `json:"status,omitempty"` -} - -// BackendTrafficPolicy constructs a declarative configuration of the BackendTrafficPolicy type for use with -// apply. -func BackendTrafficPolicy(name, namespace string) *BackendTrafficPolicyApplyConfiguration { - b := &BackendTrafficPolicyApplyConfiguration{} - b.WithName(name) - b.WithNamespace(namespace) - b.WithKind("BackendTrafficPolicy") - b.WithAPIVersion("gateway.networking.k8s.io/v1alpha2") - return b -} - -// ExtractBackendTrafficPolicy extracts the applied configuration owned by fieldManager from -// backendTrafficPolicy. If no managedFields are found in backendTrafficPolicy for fieldManager, a -// BackendTrafficPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable), -// APIVersion and Kind populated. It is possible that no managed fields were found for because other -// field managers have taken ownership of all the fields previously owned by fieldManager, or because -// the fieldManager never owned fields any fields. -// backendTrafficPolicy must be a unmodified BackendTrafficPolicy API object that was retrieved from the Kubernetes API. -// ExtractBackendTrafficPolicy provides a way to perform a extract/modify-in-place/apply workflow. -// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously -// applied if another fieldManager has updated or force applied any of the previously applied fields. -// Experimental! -func ExtractBackendTrafficPolicy(backendTrafficPolicy *apisv1alpha2.BackendTrafficPolicy, fieldManager string) (*BackendTrafficPolicyApplyConfiguration, error) { - return extractBackendTrafficPolicy(backendTrafficPolicy, fieldManager, "") -} - -// ExtractBackendTrafficPolicyStatus is the same as ExtractBackendTrafficPolicy except -// that it extracts the status subresource applied configuration. -// Experimental! -func ExtractBackendTrafficPolicyStatus(backendTrafficPolicy *apisv1alpha2.BackendTrafficPolicy, fieldManager string) (*BackendTrafficPolicyApplyConfiguration, error) { - return extractBackendTrafficPolicy(backendTrafficPolicy, fieldManager, "status") -} - -func extractBackendTrafficPolicy(backendTrafficPolicy *apisv1alpha2.BackendTrafficPolicy, fieldManager string, subresource string) (*BackendTrafficPolicyApplyConfiguration, error) { - b := &BackendTrafficPolicyApplyConfiguration{} - err := managedfields.ExtractInto(backendTrafficPolicy, internal.Parser().Type("io.k8s.sigs.gateway-api.apis.v1alpha2.BackendTrafficPolicy"), fieldManager, b, subresource) - if err != nil { - return nil, err - } - b.WithName(backendTrafficPolicy.Name) - b.WithNamespace(backendTrafficPolicy.Namespace) - - b.WithKind("BackendTrafficPolicy") - b.WithAPIVersion("gateway.networking.k8s.io/v1alpha2") - return b, nil -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithKind(value string) *BackendTrafficPolicyApplyConfiguration { - b.Kind = &value - return b -} - -// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIVersion field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithAPIVersion(value string) *BackendTrafficPolicyApplyConfiguration { - b.APIVersion = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithName(value string) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value - return b -} - -// WithGenerateName sets the GenerateName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GenerateName field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithGenerateName(value string) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithNamespace(value string) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value - return b -} - -// WithUID sets the UID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the UID field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithUID(value types.UID) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value - return b -} - -// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceVersion field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithResourceVersion(value string) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value - return b -} - -// WithGeneration sets the Generation field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Generation field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithGeneration(value int64) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value - return b -} - -// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value - return b -} - -// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value - return b -} - -// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value - return b -} - -// WithLabels puts the entries into the Labels field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Labels field, -// overwriting an existing map entries in Labels field with the same key. -func (b *BackendTrafficPolicyApplyConfiguration) WithLabels(entries map[string]string) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Labels[k] = v - } - return b -} - -// WithAnnotations puts the entries into the Annotations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Annotations field, -// overwriting an existing map entries in Annotations field with the same key. -func (b *BackendTrafficPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Annotations[k] = v - } - return b -} - -// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the OwnerReferences field. -func (b *BackendTrafficPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - if values[i] == nil { - panic("nil value passed to WithOwnerReferences") - } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) - } - return b -} - -// WithFinalizers adds the given value to the Finalizers field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Finalizers field. -func (b *BackendTrafficPolicyApplyConfiguration) WithFinalizers(values ...string) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) - } - return b -} - -func (b *BackendTrafficPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { - if b.ObjectMetaApplyConfiguration == nil { - b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} - } -} - -// WithSpec sets the Spec field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Spec field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithSpec(value *BackendTrafficPolicySpecApplyConfiguration) *BackendTrafficPolicyApplyConfiguration { - b.Spec = value - return b -} - -// WithStatus sets the Status field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Status field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithStatus(value *PolicyStatusApplyConfiguration) *BackendTrafficPolicyApplyConfiguration { - b.Status = value - return b -} - -// GetName retrieves the value of the Name field in the declarative configuration. -func (b *BackendTrafficPolicyApplyConfiguration) GetName() *string { - b.ensureObjectMetaApplyConfigurationExists() - return b.Name -} diff --git a/apis/applyconfiguration/apis/v1alpha2/backendtrafficpolicyspec.go b/apis/applyconfiguration/apis/v1alpha2/backendtrafficpolicyspec.go deleted file mode 100644 index e24d652a10..0000000000 --- a/apis/applyconfiguration/apis/v1alpha2/backendtrafficpolicyspec.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" -) - -// BackendTrafficPolicySpecApplyConfiguration represents a declarative configuration of the BackendTrafficPolicySpec type for use -// with apply. -type BackendTrafficPolicySpecApplyConfiguration struct { - TargetRefs []LocalPolicyTargetReferenceApplyConfiguration `json:"targetRefs,omitempty"` - RetryConstraint *RetryConstraintApplyConfiguration `json:"retry,omitempty"` - SessionPersistence *v1.SessionPersistenceApplyConfiguration `json:"sessionPersistence,omitempty"` -} - -// BackendTrafficPolicySpecApplyConfiguration constructs a declarative configuration of the BackendTrafficPolicySpec type for use with -// apply. -func BackendTrafficPolicySpec() *BackendTrafficPolicySpecApplyConfiguration { - return &BackendTrafficPolicySpecApplyConfiguration{} -} - -// WithTargetRefs adds the given value to the TargetRefs field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the TargetRefs field. -func (b *BackendTrafficPolicySpecApplyConfiguration) WithTargetRefs(values ...*LocalPolicyTargetReferenceApplyConfiguration) *BackendTrafficPolicySpecApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithTargetRefs") - } - b.TargetRefs = append(b.TargetRefs, *values[i]) - } - return b -} - -// WithRetryConstraint sets the RetryConstraint field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the RetryConstraint field is set to the value of the last call. -func (b *BackendTrafficPolicySpecApplyConfiguration) WithRetryConstraint(value *RetryConstraintApplyConfiguration) *BackendTrafficPolicySpecApplyConfiguration { - b.RetryConstraint = value - return b -} - -// WithSessionPersistence sets the SessionPersistence field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the SessionPersistence field is set to the value of the last call. -func (b *BackendTrafficPolicySpecApplyConfiguration) WithSessionPersistence(value *v1.SessionPersistenceApplyConfiguration) *BackendTrafficPolicySpecApplyConfiguration { - b.SessionPersistence = value - return b -} diff --git a/apis/applyconfiguration/apis/v1alpha2/requestrate.go b/apis/applyconfiguration/apis/v1alpha2/requestrate.go deleted file mode 100644 index e71fcd534a..0000000000 --- a/apis/applyconfiguration/apis/v1alpha2/requestrate.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - v1 "sigs.k8s.io/gateway-api/apis/v1" -) - -// RequestRateApplyConfiguration represents a declarative configuration of the RequestRate type for use -// with apply. -type RequestRateApplyConfiguration struct { - Count *int `json:"count,omitempty"` - Interval *v1.Duration `json:"interval,omitempty"` -} - -// RequestRateApplyConfiguration constructs a declarative configuration of the RequestRate type for use with -// apply. -func RequestRate() *RequestRateApplyConfiguration { - return &RequestRateApplyConfiguration{} -} - -// WithCount sets the Count field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Count field is set to the value of the last call. -func (b *RequestRateApplyConfiguration) WithCount(value int) *RequestRateApplyConfiguration { - b.Count = &value - return b -} - -// WithInterval sets the Interval field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Interval field is set to the value of the last call. -func (b *RequestRateApplyConfiguration) WithInterval(value v1.Duration) *RequestRateApplyConfiguration { - b.Interval = &value - return b -} diff --git a/apis/applyconfiguration/apis/v1alpha2/retryconstraint.go b/apis/applyconfiguration/apis/v1alpha2/retryconstraint.go deleted file mode 100644 index 36f0068138..0000000000 --- a/apis/applyconfiguration/apis/v1alpha2/retryconstraint.go +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - v1 "sigs.k8s.io/gateway-api/apis/v1" -) - -// RetryConstraintApplyConfiguration represents a declarative configuration of the RetryConstraint type for use -// with apply. -type RetryConstraintApplyConfiguration struct { - BudgetPercent *int `json:"budgetPercent,omitempty"` - BudgetInterval *v1.Duration `json:"budgetInterval,omitempty"` - MinRetryRate *RequestRateApplyConfiguration `json:"minRetryRate,omitempty"` -} - -// RetryConstraintApplyConfiguration constructs a declarative configuration of the RetryConstraint type for use with -// apply. -func RetryConstraint() *RetryConstraintApplyConfiguration { - return &RetryConstraintApplyConfiguration{} -} - -// WithBudgetPercent sets the BudgetPercent field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the BudgetPercent field is set to the value of the last call. -func (b *RetryConstraintApplyConfiguration) WithBudgetPercent(value int) *RetryConstraintApplyConfiguration { - b.BudgetPercent = &value - return b -} - -// WithBudgetInterval sets the BudgetInterval field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the BudgetInterval field is set to the value of the last call. -func (b *RetryConstraintApplyConfiguration) WithBudgetInterval(value v1.Duration) *RetryConstraintApplyConfiguration { - b.BudgetInterval = &value - return b -} - -// WithMinRetryRate sets the MinRetryRate field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the MinRetryRate field is set to the value of the last call. -func (b *RetryConstraintApplyConfiguration) WithMinRetryRate(value *RequestRateApplyConfiguration) *RetryConstraintApplyConfiguration { - b.MinRetryRate = value - return b -} diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha2/backendtrafficpolicy.go b/pkg/client/clientset/versioned/typed/apis/v1alpha2/backendtrafficpolicy.go deleted file mode 100644 index cda9a3272d..0000000000 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha2/backendtrafficpolicy.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - gentype "k8s.io/client-go/gentype" - apisv1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" - v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" - scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" -) - -// BackendTrafficPoliciesGetter has a method to return a BackendTrafficPolicyInterface. -// A group's client should implement this interface. -type BackendTrafficPoliciesGetter interface { - BackendTrafficPolicies(namespace string) BackendTrafficPolicyInterface -} - -// BackendTrafficPolicyInterface has methods to work with BackendTrafficPolicy resources. -type BackendTrafficPolicyInterface interface { - Create(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.CreateOptions) (*v1alpha2.BackendTrafficPolicy, error) - Update(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.UpdateOptions) (*v1alpha2.BackendTrafficPolicy, error) - // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.UpdateOptions) (*v1alpha2.BackendTrafficPolicy, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.BackendTrafficPolicy, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.BackendTrafficPolicyList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.BackendTrafficPolicy, err error) - Apply(ctx context.Context, backendTrafficPolicy *apisv1alpha2.BackendTrafficPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendTrafficPolicy, err error) - // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). - ApplyStatus(ctx context.Context, backendTrafficPolicy *apisv1alpha2.BackendTrafficPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendTrafficPolicy, err error) - BackendTrafficPolicyExpansion -} - -// backendTrafficPolicies implements BackendTrafficPolicyInterface -type backendTrafficPolicies struct { - *gentype.ClientWithListAndApply[*v1alpha2.BackendTrafficPolicy, *v1alpha2.BackendTrafficPolicyList, *apisv1alpha2.BackendTrafficPolicyApplyConfiguration] -} - -// newBackendTrafficPolicies returns a BackendTrafficPolicies -func newBackendTrafficPolicies(c *GatewayV1alpha2Client, namespace string) *backendTrafficPolicies { - return &backendTrafficPolicies{ - gentype.NewClientWithListAndApply[*v1alpha2.BackendTrafficPolicy, *v1alpha2.BackendTrafficPolicyList, *apisv1alpha2.BackendTrafficPolicyApplyConfiguration]( - "backendtrafficpolicies", - c.RESTClient(), - scheme.ParameterCodec, - namespace, - func() *v1alpha2.BackendTrafficPolicy { return &v1alpha2.BackendTrafficPolicy{} }, - func() *v1alpha2.BackendTrafficPolicyList { return &v1alpha2.BackendTrafficPolicyList{} }), - } -} diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_backendtrafficpolicy.go b/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_backendtrafficpolicy.go deleted file mode 100644 index a67e1275bf..0000000000 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_backendtrafficpolicy.go +++ /dev/null @@ -1,197 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "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" - apisv1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" - v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" -) - -// FakeBackendTrafficPolicies implements BackendTrafficPolicyInterface -type FakeBackendTrafficPolicies struct { - Fake *FakeGatewayV1alpha2 - ns string -} - -var backendtrafficpoliciesResource = v1alpha2.SchemeGroupVersion.WithResource("backendtrafficpolicies") - -var backendtrafficpoliciesKind = v1alpha2.SchemeGroupVersion.WithKind("BackendTrafficPolicy") - -// Get takes name of the backendTrafficPolicy, and returns the corresponding backendTrafficPolicy object, and an error if there is any. -func (c *FakeBackendTrafficPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { - emptyResult := &v1alpha2.BackendTrafficPolicy{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(backendtrafficpoliciesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BackendTrafficPolicy), err -} - -// List takes label and field selectors, and returns the list of BackendTrafficPolicies that match those selectors. -func (c *FakeBackendTrafficPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.BackendTrafficPolicyList, err error) { - emptyResult := &v1alpha2.BackendTrafficPolicyList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(backendtrafficpoliciesResource, backendtrafficpoliciesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.BackendTrafficPolicyList{ListMeta: obj.(*v1alpha2.BackendTrafficPolicyList).ListMeta} - for _, item := range obj.(*v1alpha2.BackendTrafficPolicyList).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 backendTrafficPolicies. -func (c *FakeBackendTrafficPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(backendtrafficpoliciesResource, c.ns, opts)) - -} - -// Create takes the representation of a backendTrafficPolicy and creates it. Returns the server's representation of the backendTrafficPolicy, and an error, if there is any. -func (c *FakeBackendTrafficPolicies) Create(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.CreateOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { - emptyResult := &v1alpha2.BackendTrafficPolicy{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(backendtrafficpoliciesResource, c.ns, backendTrafficPolicy, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BackendTrafficPolicy), err -} - -// Update takes the representation of a backendTrafficPolicy and updates it. Returns the server's representation of the backendTrafficPolicy, and an error, if there is any. -func (c *FakeBackendTrafficPolicies) Update(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.UpdateOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { - emptyResult := &v1alpha2.BackendTrafficPolicy{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(backendtrafficpoliciesResource, c.ns, backendTrafficPolicy, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BackendTrafficPolicy), 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 *FakeBackendTrafficPolicies) UpdateStatus(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.UpdateOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { - emptyResult := &v1alpha2.BackendTrafficPolicy{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(backendtrafficpoliciesResource, "status", c.ns, backendTrafficPolicy, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BackendTrafficPolicy), err -} - -// Delete takes name of the backendTrafficPolicy and deletes it. Returns an error if one occurs. -func (c *FakeBackendTrafficPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(backendtrafficpoliciesResource, c.ns, name, opts), &v1alpha2.BackendTrafficPolicy{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeBackendTrafficPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(backendtrafficpoliciesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.BackendTrafficPolicyList{}) - return err -} - -// Patch applies the patch and returns the patched backendTrafficPolicy. -func (c *FakeBackendTrafficPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.BackendTrafficPolicy, err error) { - emptyResult := &v1alpha2.BackendTrafficPolicy{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(backendtrafficpoliciesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BackendTrafficPolicy), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied backendTrafficPolicy. -func (c *FakeBackendTrafficPolicies) Apply(ctx context.Context, backendTrafficPolicy *apisv1alpha2.BackendTrafficPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { - if backendTrafficPolicy == nil { - return nil, fmt.Errorf("backendTrafficPolicy provided to Apply must not be nil") - } - data, err := json.Marshal(backendTrafficPolicy) - if err != nil { - return nil, err - } - name := backendTrafficPolicy.Name - if name == nil { - return nil, fmt.Errorf("backendTrafficPolicy.Name must be provided to Apply") - } - emptyResult := &v1alpha2.BackendTrafficPolicy{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(backendtrafficpoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BackendTrafficPolicy), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeBackendTrafficPolicies) ApplyStatus(ctx context.Context, backendTrafficPolicy *apisv1alpha2.BackendTrafficPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { - if backendTrafficPolicy == nil { - return nil, fmt.Errorf("backendTrafficPolicy provided to Apply must not be nil") - } - data, err := json.Marshal(backendTrafficPolicy) - if err != nil { - return nil, err - } - name := backendTrafficPolicy.Name - if name == nil { - return nil, fmt.Errorf("backendTrafficPolicy.Name must be provided to Apply") - } - emptyResult := &v1alpha2.BackendTrafficPolicy{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(backendtrafficpoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BackendTrafficPolicy), err -} diff --git a/pkg/client/informers/externalversions/apis/v1alpha2/backendtrafficpolicy.go b/pkg/client/informers/externalversions/apis/v1alpha2/backendtrafficpolicy.go deleted file mode 100644 index 2afda1c5f7..0000000000 --- a/pkg/client/informers/externalversions/apis/v1alpha2/backendtrafficpolicy.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "context" - time "time" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" - apisv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" - versioned "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned" - internalinterfaces "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/internalinterfaces" - v1alpha2 "sigs.k8s.io/gateway-api/pkg/client/listers/apis/v1alpha2" -) - -// BackendTrafficPolicyInformer provides access to a shared informer and lister for -// BackendTrafficPolicies. -type BackendTrafficPolicyInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha2.BackendTrafficPolicyLister -} - -type backendTrafficPolicyInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewBackendTrafficPolicyInformer constructs a new informer for BackendTrafficPolicy type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewBackendTrafficPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredBackendTrafficPolicyInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredBackendTrafficPolicyInformer constructs a new informer for BackendTrafficPolicy type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredBackendTrafficPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.GatewayV1alpha2().BackendTrafficPolicies(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.GatewayV1alpha2().BackendTrafficPolicies(namespace).Watch(context.TODO(), options) - }, - }, - &apisv1alpha2.BackendTrafficPolicy{}, - resyncPeriod, - indexers, - ) -} - -func (f *backendTrafficPolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredBackendTrafficPolicyInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *backendTrafficPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisv1alpha2.BackendTrafficPolicy{}, f.defaultInformer) -} - -func (f *backendTrafficPolicyInformer) Lister() v1alpha2.BackendTrafficPolicyLister { - return v1alpha2.NewBackendTrafficPolicyLister(f.Informer().GetIndexer()) -} diff --git a/pkg/client/listers/apis/v1alpha2/backendtrafficpolicy.go b/pkg/client/listers/apis/v1alpha2/backendtrafficpolicy.go deleted file mode 100644 index 5c79f7300b..0000000000 --- a/pkg/client/listers/apis/v1alpha2/backendtrafficpolicy.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" - v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" -) - -// BackendTrafficPolicyLister helps list BackendTrafficPolicies. -// All objects returned here must be treated as read-only. -type BackendTrafficPolicyLister interface { - // List lists all BackendTrafficPolicies in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.BackendTrafficPolicy, err error) - // BackendTrafficPolicies returns an object that can list and get BackendTrafficPolicies. - BackendTrafficPolicies(namespace string) BackendTrafficPolicyNamespaceLister - BackendTrafficPolicyListerExpansion -} - -// backendTrafficPolicyLister implements the BackendTrafficPolicyLister interface. -type backendTrafficPolicyLister struct { - listers.ResourceIndexer[*v1alpha2.BackendTrafficPolicy] -} - -// NewBackendTrafficPolicyLister returns a new BackendTrafficPolicyLister. -func NewBackendTrafficPolicyLister(indexer cache.Indexer) BackendTrafficPolicyLister { - return &backendTrafficPolicyLister{listers.New[*v1alpha2.BackendTrafficPolicy](indexer, v1alpha2.Resource("backendtrafficpolicy"))} -} - -// BackendTrafficPolicies returns an object that can list and get BackendTrafficPolicies. -func (s *backendTrafficPolicyLister) BackendTrafficPolicies(namespace string) BackendTrafficPolicyNamespaceLister { - return backendTrafficPolicyNamespaceLister{listers.NewNamespaced[*v1alpha2.BackendTrafficPolicy](s.ResourceIndexer, namespace)} -} - -// BackendTrafficPolicyNamespaceLister helps list and get BackendTrafficPolicies. -// All objects returned here must be treated as read-only. -type BackendTrafficPolicyNamespaceLister interface { - // List lists all BackendTrafficPolicies in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.BackendTrafficPolicy, err error) - // Get retrieves the BackendTrafficPolicy from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.BackendTrafficPolicy, error) - BackendTrafficPolicyNamespaceListerExpansion -} - -// backendTrafficPolicyNamespaceLister implements the BackendTrafficPolicyNamespaceLister -// interface. -type backendTrafficPolicyNamespaceLister struct { - listers.ResourceIndexer[*v1alpha2.BackendTrafficPolicy] -} From ededf821d5f584102a5bb6c1fe0fc9840c76e960 Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Thu, 13 Feb 2025 09:04:44 -0500 Subject: [PATCH 14/32] undo commenting --- cmd/modelschema/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/modelschema/main.go b/cmd/modelschema/main.go index 314ed9b72d..42dd9e497b 100644 --- a/cmd/modelschema/main.go +++ b/cmd/modelschema/main.go @@ -21,12 +21,12 @@ package main import ( "encoding/json" "fmt" - //"maps" + "maps" "os" "strings" stable "sigs.k8s.io/gateway-api/apis/openapi" - //experimental "sigs.k8s.io/gateway-api/apisx/openapi" + experimental "sigs.k8s.io/gateway-api/apisx/openapi" "k8s.io/kube-openapi/pkg/common" "k8s.io/kube-openapi/pkg/validation/spec" @@ -46,7 +46,7 @@ func output() error { return spec.MustCreateRef(fmt.Sprintf("#/definitions/%s", friendlyName(name))) } defs := stable.GetOpenAPIDefinitions(refFunc) - //maps.Copy(defs, experimental.GetOpenAPIDefinitions(refFunc)) + maps.Copy(defs, experimental.GetOpenAPIDefinitions(refFunc)) schemaDefs := make(map[string]spec.Schema, len(defs)) for k, v := range defs { From 1c2d82600abda3e52696818b80e3edc7376cbc49 Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Thu, 27 Feb 2025 11:47:19 -0500 Subject: [PATCH 15/32] Working to fix code gen following merge --- apis/openapi/zz_generated.openapi.go | 8034 ----------------- .../apisx/v1alpha2/backendtrafficpolicy.go | 265 - .../v1alpha2/backendtrafficpolicyspec.go | 64 - .../apisx/v1alpha2/requestrate.go | 52 - .../apisx/v1alpha2/retryconstraint.go | 61 - apisx/applyconfiguration/internal/internal.go | 72 - apisx/applyconfiguration/utils.go | 50 - apisx/openapi/zz_generated.openapi.go | 2893 ------ apisx/v1alpha2/doc.go | 1 + pkg/client/clientset/versioned/clientset.go | 16 +- .../versioned/fake/clientset_generated.go | 10 +- .../clientset/versioned/fake/register.go | 4 +- .../clientset/versioned/scheme/register.go | 4 +- .../typed/apisx/v1alpha2/apisx_client.go | 30 +- .../apisx/v1alpha2/backendtrafficpolicy.go | 2 +- .../apisx/v1alpha2/fake/fake_apisx_client.go | 6 +- .../fake/fake_backendtrafficpolicy.go | 2 +- .../apisx/v1alpha2/backendtrafficpolicy.go | 4 +- pkg/clientx/clientset/versioned/clientset.go | 120 - .../versioned/fake/clientset_generated.go | 122 - pkg/clientx/clientset/versioned/fake/doc.go | 20 - .../clientset/versioned/fake/register.go | 56 - pkg/clientx/clientset/versioned/scheme/doc.go | 20 - .../clientset/versioned/scheme/register.go | 56 - .../typed/apisx/v1alpha2/apisx_client.go | 107 - .../apisx/v1alpha2/backendtrafficpolicy.go | 73 - .../versioned/typed/apisx/v1alpha2/doc.go | 20 - .../typed/apisx/v1alpha2/fake/doc.go | 20 - .../apisx/v1alpha2/fake/fake_apisx_client.go | 40 - .../fake/fake_backendtrafficpolicy.go | 197 - .../apisx/v1alpha2/generated_expansion.go | 21 - .../externalversions/apisx/interface.go | 46 - .../apisx/v1alpha2/backendtrafficpolicy.go | 90 - .../apisx/v1alpha2/interface.go | 45 - .../informers/externalversions/factory.go | 262 - .../informers/externalversions/generic.go | 62 - .../internalinterfaces/factory_interfaces.go | 40 - .../apisx/v1alpha2/backendtrafficpolicy.go | 70 - .../apisx/v1alpha2/expansion_generated.go | 27 - 39 files changed, 40 insertions(+), 13044 deletions(-) delete mode 100644 apis/openapi/zz_generated.openapi.go delete mode 100644 apisx/applyconfiguration/apisx/v1alpha2/backendtrafficpolicy.go delete mode 100644 apisx/applyconfiguration/apisx/v1alpha2/backendtrafficpolicyspec.go delete mode 100644 apisx/applyconfiguration/apisx/v1alpha2/requestrate.go delete mode 100644 apisx/applyconfiguration/apisx/v1alpha2/retryconstraint.go delete mode 100644 apisx/applyconfiguration/internal/internal.go delete mode 100644 apisx/applyconfiguration/utils.go delete mode 100644 apisx/openapi/zz_generated.openapi.go delete mode 100644 pkg/clientx/clientset/versioned/clientset.go delete mode 100644 pkg/clientx/clientset/versioned/fake/clientset_generated.go delete mode 100644 pkg/clientx/clientset/versioned/fake/doc.go delete mode 100644 pkg/clientx/clientset/versioned/fake/register.go delete mode 100644 pkg/clientx/clientset/versioned/scheme/doc.go delete mode 100644 pkg/clientx/clientset/versioned/scheme/register.go delete mode 100644 pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/apisx_client.go delete mode 100644 pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/backendtrafficpolicy.go delete mode 100644 pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/doc.go delete mode 100644 pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake/doc.go delete mode 100644 pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake/fake_apisx_client.go delete mode 100644 pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake/fake_backendtrafficpolicy.go delete mode 100644 pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/generated_expansion.go delete mode 100644 pkg/clientx/informers/externalversions/apisx/interface.go delete mode 100644 pkg/clientx/informers/externalversions/apisx/v1alpha2/backendtrafficpolicy.go delete mode 100644 pkg/clientx/informers/externalversions/apisx/v1alpha2/interface.go delete mode 100644 pkg/clientx/informers/externalversions/factory.go delete mode 100644 pkg/clientx/informers/externalversions/generic.go delete mode 100644 pkg/clientx/informers/externalversions/internalinterfaces/factory_interfaces.go delete mode 100644 pkg/clientx/listers/apisx/v1alpha2/backendtrafficpolicy.go delete mode 100644 pkg/clientx/listers/apisx/v1alpha2/expansion_generated.go diff --git a/apis/openapi/zz_generated.openapi.go b/apis/openapi/zz_generated.openapi.go deleted file mode 100644 index 2b2a0b6ded..0000000000 --- a/apis/openapi/zz_generated.openapi.go +++ /dev/null @@ -1,8034 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by openapi-gen. DO NOT EDIT. - -package openapi - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - common "k8s.io/kube-openapi/pkg/common" - spec "k8s.io/kube-openapi/pkg/validation/spec" -) - -func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { - return map[string]common.OpenAPIDefinition{ - "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup": schema_pkg_apis_meta_v1_APIGroup(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroupList": schema_pkg_apis_meta_v1_APIGroupList(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIResource": schema_pkg_apis_meta_v1_APIResource(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIResourceList": schema_pkg_apis_meta_v1_APIResourceList(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIVersions": schema_pkg_apis_meta_v1_APIVersions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ApplyOptions": schema_pkg_apis_meta_v1_ApplyOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Condition": schema_pkg_apis_meta_v1_Condition(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.CreateOptions": schema_pkg_apis_meta_v1_CreateOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.DeleteOptions": schema_pkg_apis_meta_v1_DeleteOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Duration": schema_pkg_apis_meta_v1_Duration(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.FieldSelectorRequirement": schema_pkg_apis_meta_v1_FieldSelectorRequirement(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1": schema_pkg_apis_meta_v1_FieldsV1(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GetOptions": schema_pkg_apis_meta_v1_GetOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupKind": schema_pkg_apis_meta_v1_GroupKind(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupResource": schema_pkg_apis_meta_v1_GroupResource(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersion": schema_pkg_apis_meta_v1_GroupVersion(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery": schema_pkg_apis_meta_v1_GroupVersionForDiscovery(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionKind": schema_pkg_apis_meta_v1_GroupVersionKind(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionResource": schema_pkg_apis_meta_v1_GroupVersionResource(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.InternalEvent": schema_pkg_apis_meta_v1_InternalEvent(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector": schema_pkg_apis_meta_v1_LabelSelector(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement": schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.List": schema_pkg_apis_meta_v1_List(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta": schema_pkg_apis_meta_v1_ListMeta(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ListOptions": schema_pkg_apis_meta_v1_ListOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry": schema_pkg_apis_meta_v1_ManagedFieldsEntry(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime": schema_pkg_apis_meta_v1_MicroTime(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta": schema_pkg_apis_meta_v1_ObjectMeta(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference": schema_pkg_apis_meta_v1_OwnerReference(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata": schema_pkg_apis_meta_v1_PartialObjectMetadata(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadataList": schema_pkg_apis_meta_v1_PartialObjectMetadataList(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Patch": schema_pkg_apis_meta_v1_Patch(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.PatchOptions": schema_pkg_apis_meta_v1_PatchOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions": schema_pkg_apis_meta_v1_Preconditions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.RootPaths": schema_pkg_apis_meta_v1_RootPaths(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR": schema_pkg_apis_meta_v1_ServerAddressByClientCIDR(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Status": schema_pkg_apis_meta_v1_Status(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause": schema_pkg_apis_meta_v1_StatusCause(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails": schema_pkg_apis_meta_v1_StatusDetails(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Table": schema_pkg_apis_meta_v1_Table(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition": schema_pkg_apis_meta_v1_TableColumnDefinition(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TableOptions": schema_pkg_apis_meta_v1_TableOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TableRow": schema_pkg_apis_meta_v1_TableRow(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition": schema_pkg_apis_meta_v1_TableRowCondition(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Time": schema_pkg_apis_meta_v1_Time(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Timestamp": schema_pkg_apis_meta_v1_Timestamp(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta": schema_pkg_apis_meta_v1_TypeMeta(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.UpdateOptions": schema_pkg_apis_meta_v1_UpdateOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.WatchEvent": schema_pkg_apis_meta_v1_WatchEvent(ref), - "k8s.io/apimachinery/pkg/runtime.RawExtension": schema_k8sio_apimachinery_pkg_runtime_RawExtension(ref), - "k8s.io/apimachinery/pkg/runtime.TypeMeta": schema_k8sio_apimachinery_pkg_runtime_TypeMeta(ref), - "k8s.io/apimachinery/pkg/runtime.Unknown": schema_k8sio_apimachinery_pkg_runtime_Unknown(ref), - "k8s.io/apimachinery/pkg/version.Info": schema_k8sio_apimachinery_pkg_version_Info(ref), - "sigs.k8s.io/gateway-api/apis/v1.AllowedListeners": schema_sigsk8sio_gateway_api_apis_v1_AllowedListeners(ref), - "sigs.k8s.io/gateway-api/apis/v1.AllowedRoutes": schema_sigsk8sio_gateway_api_apis_v1_AllowedRoutes(ref), - "sigs.k8s.io/gateway-api/apis/v1.BackendObjectReference": schema_sigsk8sio_gateway_api_apis_v1_BackendObjectReference(ref), - "sigs.k8s.io/gateway-api/apis/v1.BackendRef": schema_sigsk8sio_gateway_api_apis_v1_BackendRef(ref), - "sigs.k8s.io/gateway-api/apis/v1.CommonRouteSpec": schema_sigsk8sio_gateway_api_apis_v1_CommonRouteSpec(ref), - "sigs.k8s.io/gateway-api/apis/v1.CookieConfig": schema_sigsk8sio_gateway_api_apis_v1_CookieConfig(ref), - "sigs.k8s.io/gateway-api/apis/v1.Fraction": schema_sigsk8sio_gateway_api_apis_v1_Fraction(ref), - "sigs.k8s.io/gateway-api/apis/v1.FrontendTLSValidation": schema_sigsk8sio_gateway_api_apis_v1_FrontendTLSValidation(ref), - "sigs.k8s.io/gateway-api/apis/v1.GRPCBackendRef": schema_sigsk8sio_gateway_api_apis_v1_GRPCBackendRef(ref), - "sigs.k8s.io/gateway-api/apis/v1.GRPCHeaderMatch": schema_sigsk8sio_gateway_api_apis_v1_GRPCHeaderMatch(ref), - "sigs.k8s.io/gateway-api/apis/v1.GRPCMethodMatch": schema_sigsk8sio_gateway_api_apis_v1_GRPCMethodMatch(ref), - "sigs.k8s.io/gateway-api/apis/v1.GRPCRoute": schema_sigsk8sio_gateway_api_apis_v1_GRPCRoute(ref), - "sigs.k8s.io/gateway-api/apis/v1.GRPCRouteFilter": schema_sigsk8sio_gateway_api_apis_v1_GRPCRouteFilter(ref), - "sigs.k8s.io/gateway-api/apis/v1.GRPCRouteList": schema_sigsk8sio_gateway_api_apis_v1_GRPCRouteList(ref), - "sigs.k8s.io/gateway-api/apis/v1.GRPCRouteMatch": schema_sigsk8sio_gateway_api_apis_v1_GRPCRouteMatch(ref), - "sigs.k8s.io/gateway-api/apis/v1.GRPCRouteRule": schema_sigsk8sio_gateway_api_apis_v1_GRPCRouteRule(ref), - "sigs.k8s.io/gateway-api/apis/v1.GRPCRouteSpec": schema_sigsk8sio_gateway_api_apis_v1_GRPCRouteSpec(ref), - "sigs.k8s.io/gateway-api/apis/v1.GRPCRouteStatus": schema_sigsk8sio_gateway_api_apis_v1_GRPCRouteStatus(ref), - "sigs.k8s.io/gateway-api/apis/v1.Gateway": schema_sigsk8sio_gateway_api_apis_v1_Gateway(ref), - "sigs.k8s.io/gateway-api/apis/v1.GatewayAddress": schema_sigsk8sio_gateway_api_apis_v1_GatewayAddress(ref), - "sigs.k8s.io/gateway-api/apis/v1.GatewayBackendTLS": schema_sigsk8sio_gateway_api_apis_v1_GatewayBackendTLS(ref), - "sigs.k8s.io/gateway-api/apis/v1.GatewayClass": schema_sigsk8sio_gateway_api_apis_v1_GatewayClass(ref), - "sigs.k8s.io/gateway-api/apis/v1.GatewayClassList": schema_sigsk8sio_gateway_api_apis_v1_GatewayClassList(ref), - "sigs.k8s.io/gateway-api/apis/v1.GatewayClassSpec": schema_sigsk8sio_gateway_api_apis_v1_GatewayClassSpec(ref), - "sigs.k8s.io/gateway-api/apis/v1.GatewayClassStatus": schema_sigsk8sio_gateway_api_apis_v1_GatewayClassStatus(ref), - "sigs.k8s.io/gateway-api/apis/v1.GatewayInfrastructure": schema_sigsk8sio_gateway_api_apis_v1_GatewayInfrastructure(ref), - "sigs.k8s.io/gateway-api/apis/v1.GatewayList": schema_sigsk8sio_gateway_api_apis_v1_GatewayList(ref), - "sigs.k8s.io/gateway-api/apis/v1.GatewaySpec": schema_sigsk8sio_gateway_api_apis_v1_GatewaySpec(ref), - "sigs.k8s.io/gateway-api/apis/v1.GatewayStatus": schema_sigsk8sio_gateway_api_apis_v1_GatewayStatus(ref), - "sigs.k8s.io/gateway-api/apis/v1.GatewayStatusAddress": schema_sigsk8sio_gateway_api_apis_v1_GatewayStatusAddress(ref), - "sigs.k8s.io/gateway-api/apis/v1.GatewayTLSConfig": schema_sigsk8sio_gateway_api_apis_v1_GatewayTLSConfig(ref), - "sigs.k8s.io/gateway-api/apis/v1.HTTPBackendRef": schema_sigsk8sio_gateway_api_apis_v1_HTTPBackendRef(ref), - "sigs.k8s.io/gateway-api/apis/v1.HTTPHeader": schema_sigsk8sio_gateway_api_apis_v1_HTTPHeader(ref), - "sigs.k8s.io/gateway-api/apis/v1.HTTPHeaderFilter": schema_sigsk8sio_gateway_api_apis_v1_HTTPHeaderFilter(ref), - "sigs.k8s.io/gateway-api/apis/v1.HTTPHeaderMatch": schema_sigsk8sio_gateway_api_apis_v1_HTTPHeaderMatch(ref), - "sigs.k8s.io/gateway-api/apis/v1.HTTPPathMatch": schema_sigsk8sio_gateway_api_apis_v1_HTTPPathMatch(ref), - "sigs.k8s.io/gateway-api/apis/v1.HTTPPathModifier": schema_sigsk8sio_gateway_api_apis_v1_HTTPPathModifier(ref), - "sigs.k8s.io/gateway-api/apis/v1.HTTPQueryParamMatch": schema_sigsk8sio_gateway_api_apis_v1_HTTPQueryParamMatch(ref), - "sigs.k8s.io/gateway-api/apis/v1.HTTPRequestMirrorFilter": schema_sigsk8sio_gateway_api_apis_v1_HTTPRequestMirrorFilter(ref), - "sigs.k8s.io/gateway-api/apis/v1.HTTPRequestRedirectFilter": schema_sigsk8sio_gateway_api_apis_v1_HTTPRequestRedirectFilter(ref), - "sigs.k8s.io/gateway-api/apis/v1.HTTPRoute": schema_sigsk8sio_gateway_api_apis_v1_HTTPRoute(ref), - "sigs.k8s.io/gateway-api/apis/v1.HTTPRouteFilter": schema_sigsk8sio_gateway_api_apis_v1_HTTPRouteFilter(ref), - "sigs.k8s.io/gateway-api/apis/v1.HTTPRouteList": schema_sigsk8sio_gateway_api_apis_v1_HTTPRouteList(ref), - "sigs.k8s.io/gateway-api/apis/v1.HTTPRouteMatch": schema_sigsk8sio_gateway_api_apis_v1_HTTPRouteMatch(ref), - "sigs.k8s.io/gateway-api/apis/v1.HTTPRouteRetry": schema_sigsk8sio_gateway_api_apis_v1_HTTPRouteRetry(ref), - "sigs.k8s.io/gateway-api/apis/v1.HTTPRouteRule": schema_sigsk8sio_gateway_api_apis_v1_HTTPRouteRule(ref), - "sigs.k8s.io/gateway-api/apis/v1.HTTPRouteSpec": schema_sigsk8sio_gateway_api_apis_v1_HTTPRouteSpec(ref), - "sigs.k8s.io/gateway-api/apis/v1.HTTPRouteStatus": schema_sigsk8sio_gateway_api_apis_v1_HTTPRouteStatus(ref), - "sigs.k8s.io/gateway-api/apis/v1.HTTPRouteTimeouts": schema_sigsk8sio_gateway_api_apis_v1_HTTPRouteTimeouts(ref), - "sigs.k8s.io/gateway-api/apis/v1.HTTPURLRewriteFilter": schema_sigsk8sio_gateway_api_apis_v1_HTTPURLRewriteFilter(ref), - "sigs.k8s.io/gateway-api/apis/v1.Listener": schema_sigsk8sio_gateway_api_apis_v1_Listener(ref), - "sigs.k8s.io/gateway-api/apis/v1.ListenerNamespaces": schema_sigsk8sio_gateway_api_apis_v1_ListenerNamespaces(ref), - "sigs.k8s.io/gateway-api/apis/v1.ListenerStatus": schema_sigsk8sio_gateway_api_apis_v1_ListenerStatus(ref), - "sigs.k8s.io/gateway-api/apis/v1.LocalObjectReference": schema_sigsk8sio_gateway_api_apis_v1_LocalObjectReference(ref), - "sigs.k8s.io/gateway-api/apis/v1.LocalParametersReference": schema_sigsk8sio_gateway_api_apis_v1_LocalParametersReference(ref), - "sigs.k8s.io/gateway-api/apis/v1.ObjectReference": schema_sigsk8sio_gateway_api_apis_v1_ObjectReference(ref), - "sigs.k8s.io/gateway-api/apis/v1.ParametersReference": schema_sigsk8sio_gateway_api_apis_v1_ParametersReference(ref), - "sigs.k8s.io/gateway-api/apis/v1.ParentReference": schema_sigsk8sio_gateway_api_apis_v1_ParentReference(ref), - "sigs.k8s.io/gateway-api/apis/v1.RouteGroupKind": schema_sigsk8sio_gateway_api_apis_v1_RouteGroupKind(ref), - "sigs.k8s.io/gateway-api/apis/v1.RouteNamespaces": schema_sigsk8sio_gateway_api_apis_v1_RouteNamespaces(ref), - "sigs.k8s.io/gateway-api/apis/v1.RouteParentStatus": schema_sigsk8sio_gateway_api_apis_v1_RouteParentStatus(ref), - "sigs.k8s.io/gateway-api/apis/v1.RouteStatus": schema_sigsk8sio_gateway_api_apis_v1_RouteStatus(ref), - "sigs.k8s.io/gateway-api/apis/v1.SecretObjectReference": schema_sigsk8sio_gateway_api_apis_v1_SecretObjectReference(ref), - "sigs.k8s.io/gateway-api/apis/v1.SessionPersistence": schema_sigsk8sio_gateway_api_apis_v1_SessionPersistence(ref), - "sigs.k8s.io/gateway-api/apis/v1.SupportedFeature": schema_sigsk8sio_gateway_api_apis_v1_SupportedFeature(ref), - "sigs.k8s.io/gateway-api/apis/v1.supportedFeatureInternal": schema_sigsk8sio_gateway_api_apis_v1_supportedFeatureInternal(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendLBPolicy": schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendLBPolicy(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendLBPolicyList": schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendLBPolicyList(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendLBPolicySpec": schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendLBPolicySpec(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.GRPCRoute": schema_sigsk8sio_gateway_api_apis_v1alpha2_GRPCRoute(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.GRPCRouteList": schema_sigsk8sio_gateway_api_apis_v1alpha2_GRPCRouteList(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.LocalPolicyTargetReference": schema_sigsk8sio_gateway_api_apis_v1alpha2_LocalPolicyTargetReference(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.LocalPolicyTargetReferenceWithSectionName": schema_sigsk8sio_gateway_api_apis_v1alpha2_LocalPolicyTargetReferenceWithSectionName(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.NamespacedPolicyTargetReference": schema_sigsk8sio_gateway_api_apis_v1alpha2_NamespacedPolicyTargetReference(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyAncestorStatus": schema_sigsk8sio_gateway_api_apis_v1alpha2_PolicyAncestorStatus(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyStatus": schema_sigsk8sio_gateway_api_apis_v1alpha2_PolicyStatus(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.ReferenceGrant": schema_sigsk8sio_gateway_api_apis_v1alpha2_ReferenceGrant(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.ReferenceGrantList": schema_sigsk8sio_gateway_api_apis_v1alpha2_ReferenceGrantList(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.TCPRoute": schema_sigsk8sio_gateway_api_apis_v1alpha2_TCPRoute(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.TCPRouteList": schema_sigsk8sio_gateway_api_apis_v1alpha2_TCPRouteList(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.TCPRouteRule": schema_sigsk8sio_gateway_api_apis_v1alpha2_TCPRouteRule(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.TCPRouteSpec": schema_sigsk8sio_gateway_api_apis_v1alpha2_TCPRouteSpec(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.TCPRouteStatus": schema_sigsk8sio_gateway_api_apis_v1alpha2_TCPRouteStatus(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.TLSRoute": schema_sigsk8sio_gateway_api_apis_v1alpha2_TLSRoute(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.TLSRouteList": schema_sigsk8sio_gateway_api_apis_v1alpha2_TLSRouteList(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.TLSRouteRule": schema_sigsk8sio_gateway_api_apis_v1alpha2_TLSRouteRule(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.TLSRouteSpec": schema_sigsk8sio_gateway_api_apis_v1alpha2_TLSRouteSpec(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.TLSRouteStatus": schema_sigsk8sio_gateway_api_apis_v1alpha2_TLSRouteStatus(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.UDPRoute": schema_sigsk8sio_gateway_api_apis_v1alpha2_UDPRoute(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.UDPRouteList": schema_sigsk8sio_gateway_api_apis_v1alpha2_UDPRouteList(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.UDPRouteRule": schema_sigsk8sio_gateway_api_apis_v1alpha2_UDPRouteRule(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.UDPRouteSpec": schema_sigsk8sio_gateway_api_apis_v1alpha2_UDPRouteSpec(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha2.UDPRouteStatus": schema_sigsk8sio_gateway_api_apis_v1alpha2_UDPRouteStatus(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha3.BackendTLSPolicy": schema_sigsk8sio_gateway_api_apis_v1alpha3_BackendTLSPolicy(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha3.BackendTLSPolicyList": schema_sigsk8sio_gateway_api_apis_v1alpha3_BackendTLSPolicyList(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha3.BackendTLSPolicySpec": schema_sigsk8sio_gateway_api_apis_v1alpha3_BackendTLSPolicySpec(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha3.BackendTLSPolicyValidation": schema_sigsk8sio_gateway_api_apis_v1alpha3_BackendTLSPolicyValidation(ref), - "sigs.k8s.io/gateway-api/apis/v1alpha3.SubjectAltName": schema_sigsk8sio_gateway_api_apis_v1alpha3_SubjectAltName(ref), - "sigs.k8s.io/gateway-api/apis/v1beta1.Gateway": schema_sigsk8sio_gateway_api_apis_v1beta1_Gateway(ref), - "sigs.k8s.io/gateway-api/apis/v1beta1.GatewayClass": schema_sigsk8sio_gateway_api_apis_v1beta1_GatewayClass(ref), - "sigs.k8s.io/gateway-api/apis/v1beta1.GatewayClassList": schema_sigsk8sio_gateway_api_apis_v1beta1_GatewayClassList(ref), - "sigs.k8s.io/gateway-api/apis/v1beta1.GatewayList": schema_sigsk8sio_gateway_api_apis_v1beta1_GatewayList(ref), - "sigs.k8s.io/gateway-api/apis/v1beta1.HTTPRoute": schema_sigsk8sio_gateway_api_apis_v1beta1_HTTPRoute(ref), - "sigs.k8s.io/gateway-api/apis/v1beta1.HTTPRouteList": schema_sigsk8sio_gateway_api_apis_v1beta1_HTTPRouteList(ref), - "sigs.k8s.io/gateway-api/apis/v1beta1.ReferenceGrant": schema_sigsk8sio_gateway_api_apis_v1beta1_ReferenceGrant(ref), - "sigs.k8s.io/gateway-api/apis/v1beta1.ReferenceGrantFrom": schema_sigsk8sio_gateway_api_apis_v1beta1_ReferenceGrantFrom(ref), - "sigs.k8s.io/gateway-api/apis/v1beta1.ReferenceGrantList": schema_sigsk8sio_gateway_api_apis_v1beta1_ReferenceGrantList(ref), - "sigs.k8s.io/gateway-api/apis/v1beta1.ReferenceGrantSpec": schema_sigsk8sio_gateway_api_apis_v1beta1_ReferenceGrantSpec(ref), - "sigs.k8s.io/gateway-api/apis/v1beta1.ReferenceGrantTo": schema_sigsk8sio_gateway_api_apis_v1beta1_ReferenceGrantTo(ref), - "sigs.k8s.io/gateway-api/apisx/v1alpha1.ListenerEntry": schema_sigsk8sio_gateway_api_apisx_v1alpha1_ListenerEntry(ref), - "sigs.k8s.io/gateway-api/apisx/v1alpha1.ListenerEntryStatus": schema_sigsk8sio_gateway_api_apisx_v1alpha1_ListenerEntryStatus(ref), - "sigs.k8s.io/gateway-api/apisx/v1alpha1.ListenerSet": schema_sigsk8sio_gateway_api_apisx_v1alpha1_ListenerSet(ref), - "sigs.k8s.io/gateway-api/apisx/v1alpha1.ListenerSetList": schema_sigsk8sio_gateway_api_apisx_v1alpha1_ListenerSetList(ref), - "sigs.k8s.io/gateway-api/apisx/v1alpha1.ListenerSetSpec": schema_sigsk8sio_gateway_api_apisx_v1alpha1_ListenerSetSpec(ref), - "sigs.k8s.io/gateway-api/apisx/v1alpha1.ListenerSetStatus": schema_sigsk8sio_gateway_api_apisx_v1alpha1_ListenerSetStatus(ref), - "sigs.k8s.io/gateway-api/apisx/v1alpha1.ParentGatewayReference": schema_sigsk8sio_gateway_api_apisx_v1alpha1_ParentGatewayReference(ref), - } -} - -func schema_pkg_apis_meta_v1_APIGroup(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "APIGroup contains the name, the supported versions, and the preferred version of a group.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "name is the name of the group.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "versions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "versions are the versions supported in this group.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery"), - }, - }, - }, - }, - }, - "preferredVersion": { - SchemaProps: spec.SchemaProps{ - Description: "preferredVersion is the version preferred by the API server, which probably is the storage version.", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery"), - }, - }, - "serverAddressByClientCIDRs": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"), - }, - }, - }, - }, - }, - }, - Required: []string{"name", "versions"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery", "k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"}, - } -} - -func schema_pkg_apis_meta_v1_APIGroupList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "APIGroupList is a list of APIGroup, to allow clients to discover the API at /apis.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "groups": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "groups is a list of APIGroup.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup"), - }, - }, - }, - }, - }, - }, - Required: []string{"groups"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup"}, - } -} - -func schema_pkg_apis_meta_v1_APIResource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "APIResource specifies the name of a resource and whether it is namespaced.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "name is the plural name of the resource.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "singularName": { - SchemaProps: spec.SchemaProps{ - Description: "singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "namespaced": { - SchemaProps: spec.SchemaProps{ - Description: "namespaced indicates if a resource is namespaced or not.", - Default: false, - Type: []string{"boolean"}, - Format: "", - }, - }, - "group": { - SchemaProps: spec.SchemaProps{ - Description: "group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\".", - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Description: "version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\".", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "verbs": { - SchemaProps: spec.SchemaProps{ - Description: "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "shortNames": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "shortNames is a list of suggested short names of the resource.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "categories": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "categories is a list of the grouped resources this resource belongs to (e.g. 'all')", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "storageVersionHash": { - SchemaProps: spec.SchemaProps{ - Description: "The hash value of the storage version, the version this resource is converted to when written to the data store. Value must be treated as opaque by clients. Only equality comparison on the value is valid. This is an alpha feature and may change or be removed in the future. The field is populated by the apiserver only if the StorageVersionHash feature gate is enabled. This field will remain optional even if it graduates.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name", "singularName", "namespaced", "kind", "verbs"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_APIResourceList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "groupVersion": { - SchemaProps: spec.SchemaProps{ - Description: "groupVersion is the group and version this APIResourceList is for.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "resources": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "resources contains the name of the resources and if they are namespaced.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.APIResource"), - }, - }, - }, - }, - }, - }, - Required: []string{"groupVersion", "resources"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.APIResource"}, - } -} - -func schema_pkg_apis_meta_v1_APIVersions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "APIVersions lists the versions that are available, to allow clients to discover the API at /api, which is the root path of the legacy v1 API.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "versions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "versions are the api versions that are available.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "serverAddressByClientCIDRs": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"), - }, - }, - }, - }, - }, - }, - Required: []string{"versions", "serverAddressByClientCIDRs"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"}, - } -} - -func schema_pkg_apis_meta_v1_ApplyOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ApplyOptions may be provided when applying an API object. FieldManager is required for apply requests. ApplyOptions is equivalent to PatchOptions. It is provided as a convenience with documentation that speaks specifically to how the options fields relate to apply.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "dryRun": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "force": { - SchemaProps: spec.SchemaProps{ - Description: "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people.", - Default: false, - Type: []string{"boolean"}, - Format: "", - }, - }, - "fieldManager": { - SchemaProps: spec.SchemaProps{ - Description: "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"force", "fieldManager"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_Condition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Condition contains details for one aspect of the current state of this API Resource.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "type of condition in CamelCase or in foo.example.com/CamelCase.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "status of the condition, one of True, False, Unknown.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "observedGeneration": { - SchemaProps: spec.SchemaProps{ - Description: "observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "lastTransitionTime": { - SchemaProps: spec.SchemaProps{ - Description: "lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "message is a human readable message indicating details about the transition. This may be an empty string.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "status", "lastTransitionTime", "reason", "message"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_pkg_apis_meta_v1_CreateOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CreateOptions may be provided when creating an API object.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "dryRun": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "fieldManager": { - SchemaProps: spec.SchemaProps{ - Description: "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", - Type: []string{"string"}, - Format: "", - }, - }, - "fieldValidation": { - SchemaProps: spec.SchemaProps{ - Description: "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_DeleteOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DeleteOptions may be provided when deleting an API object.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "gracePeriodSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "preconditions": { - SchemaProps: spec.SchemaProps{ - Description: "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions"), - }, - }, - "orphanDependents": { - SchemaProps: spec.SchemaProps{ - Description: "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "propagationPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", - Type: []string{"string"}, - Format: "", - }, - }, - "dryRun": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions"}, - } -} - -func schema_pkg_apis_meta_v1_Duration(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Duration is a wrapper around time.Duration which supports correct marshaling to YAML and JSON. In particular, it marshals into strings, which can be used as map keys in json.", - Type: v1.Duration{}.OpenAPISchemaType(), - Format: v1.Duration{}.OpenAPISchemaFormat(), - }, - }, - } -} - -func schema_pkg_apis_meta_v1_FieldSelectorRequirement(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "FieldSelectorRequirement is a selector that contains values, a key, and an operator that relates the key and values.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "key": { - SchemaProps: spec.SchemaProps{ - Description: "key is the field selector key that the requirement applies to.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "operator": { - SchemaProps: spec.SchemaProps{ - Description: "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. The list of operators may grow in the future.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "values": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"key", "operator"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_FieldsV1(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format.\n\nEach key is either a '.' representing the field itself, and will always map to an empty set, or a string representing a sub-field or item. The string will follow one of these four formats: 'f:', where is the name of a field in a struct, or key in a map 'v:', where is the exact json formatted value of a list item 'i:', where is position of a item in a list 'k:', where is a map of a list item's key fields to their unique values If a key maps to an empty Fields value, the field that key represents is part of the set.\n\nThe exact format is defined in sigs.k8s.io/structured-merge-diff", - Type: []string{"object"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GetOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GetOptions is the standard query options to the standard REST get call.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceVersion": { - SchemaProps: spec.SchemaProps{ - Description: "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GroupKind(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GroupKind specifies a Group and a Kind, but does not force a version. This is useful for identifying concepts during lookup stages without having partially valid types", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "kind"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GroupResource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GroupResource specifies a Group and a Resource, but does not force a version. This is useful for identifying concepts during lookup stages without having partially valid types", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "resource": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "resource"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GroupVersion(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GroupVersion contains the \"group\" and the \"version\", which uniquely identifies the API.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "version"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GroupVersionForDiscovery(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensibility.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "groupVersion": { - SchemaProps: spec.SchemaProps{ - Description: "groupVersion specifies the API group and version in the form \"group/version\"", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Description: "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"groupVersion", "version"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GroupVersionKind(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GroupVersionKind unambiguously identifies a kind. It doesn't anonymously include GroupVersion to avoid automatic coercion. It doesn't use a GroupVersion to avoid custom marshalling", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "version", "kind"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GroupVersionResource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GroupVersionResource unambiguously identifies a resource. It doesn't anonymously include GroupVersion to avoid automatic coercion. It doesn't use a GroupVersion to avoid custom marshalling", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "resource": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "version", "resource"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_InternalEvent(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "InternalEvent makes watch.Event versioned", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "Type": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "Object": { - SchemaProps: spec.SchemaProps{ - Description: "Object is:\n * If Type is Added or Modified: the new state of the object.\n * If Type is Deleted: the state of the object immediately before deletion.\n * If Type is Bookmark: the object (instance of a type being watched) where\n only ResourceVersion field is set. On successful restart of watch from a\n bookmark resourceVersion, client is guaranteed to not get repeat event\n nor miss any events.\n * If Type is Error: *api.Status is recommended; other types may make sense\n depending on context.", - Ref: ref("k8s.io/apimachinery/pkg/runtime.Object"), - }, - }, - }, - Required: []string{"Type", "Object"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/runtime.Object"}, - } -} - -func schema_pkg_apis_meta_v1_LabelSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "matchLabels": { - SchemaProps: spec.SchemaProps{ - Description: "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "matchExpressions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "matchExpressions is a list of label selector requirements. The requirements are ANDed.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement"), - }, - }, - }, - }, - }, - }, - }, - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-map-type": "atomic", - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement"}, - } -} - -func schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "key": { - SchemaProps: spec.SchemaProps{ - Description: "key is the label key that the selector applies to.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "operator": { - SchemaProps: spec.SchemaProps{ - Description: "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "values": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"key", "operator"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_List(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "List holds a list of objects, which may not be known by the server.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of objects", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, - } -} - -func schema_pkg_apis_meta_v1_ListMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "selfLink": { - SchemaProps: spec.SchemaProps{ - Description: "Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceVersion": { - SchemaProps: spec.SchemaProps{ - Description: "String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", - Type: []string{"string"}, - Format: "", - }, - }, - "continue": { - SchemaProps: spec.SchemaProps{ - Description: "continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message.", - Type: []string{"string"}, - Format: "", - }, - }, - "remainingItemCount": { - SchemaProps: spec.SchemaProps{ - Description: "remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_ListOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ListOptions is the query options to a standard REST list call.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "labelSelector": { - SchemaProps: spec.SchemaProps{ - Description: "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - Type: []string{"string"}, - Format: "", - }, - }, - "fieldSelector": { - SchemaProps: spec.SchemaProps{ - Description: "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - Type: []string{"string"}, - Format: "", - }, - }, - "watch": { - SchemaProps: spec.SchemaProps{ - Description: "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "allowWatchBookmarks": { - SchemaProps: spec.SchemaProps{ - Description: "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "resourceVersion": { - SchemaProps: spec.SchemaProps{ - Description: "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceVersionMatch": { - SchemaProps: spec.SchemaProps{ - Description: "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - Type: []string{"string"}, - Format: "", - }, - }, - "timeoutSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "limit": { - SchemaProps: spec.SchemaProps{ - Description: "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "continue": { - SchemaProps: spec.SchemaProps{ - Description: "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - Type: []string{"string"}, - Format: "", - }, - }, - "sendInitialEvents": { - SchemaProps: spec.SchemaProps{ - Description: "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_ManagedFieldsEntry(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource that the fieldset applies to.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "manager": { - SchemaProps: spec.SchemaProps{ - Description: "Manager is an identifier of the workflow managing these fields.", - Type: []string{"string"}, - Format: "", - }, - }, - "operation": { - SchemaProps: spec.SchemaProps{ - Description: "Operation is the type of operation which lead to this ManagedFieldsEntry being created. The only valid values for this field are 'Apply' and 'Update'.", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the version of this resource that this field set applies to. The format is \"group/version\" just like the top-level APIVersion field. It is necessary to track the version of a field set because it cannot be automatically converted.", - Type: []string{"string"}, - Format: "", - }, - }, - "time": { - SchemaProps: spec.SchemaProps{ - Description: "Time is the timestamp of when the ManagedFields entry was added. The timestamp will also be updated if a field is added, the manager changes any of the owned fields value or removes a field. The timestamp does not update when a field is removed from the entry because another manager took it over.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "fieldsType": { - SchemaProps: spec.SchemaProps{ - Description: "FieldsType is the discriminator for the different fields format and version. There is currently only one possible value: \"FieldsV1\"", - Type: []string{"string"}, - Format: "", - }, - }, - "fieldsV1": { - SchemaProps: spec.SchemaProps{ - Description: "FieldsV1 holds the first JSON version format as described in the \"FieldsV1\" type.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1"), - }, - }, - "subresource": { - SchemaProps: spec.SchemaProps{ - Description: "Subresource is the name of the subresource used to update that object, or empty string if the object was updated through the main resource. The value of this field is used to distinguish between managers, even if they share the same name. For example, a status update will be distinct from a regular update using the same manager name. Note that the APIVersion field is not related to the Subresource field and it always corresponds to the version of the main resource.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_pkg_apis_meta_v1_MicroTime(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "MicroTime is version of Time with microsecond level precision.", - Type: v1.MicroTime{}.OpenAPISchemaType(), - Format: v1.MicroTime{}.OpenAPISchemaFormat(), - }, - }, - } -} - -func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names", - Type: []string{"string"}, - Format: "", - }, - }, - "generateName": { - SchemaProps: spec.SchemaProps{ - Description: "GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will return a 409.\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency", - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Description: "Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces", - Type: []string{"string"}, - Format: "", - }, - }, - "selfLink": { - SchemaProps: spec.SchemaProps{ - Description: "Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.", - Type: []string{"string"}, - Format: "", - }, - }, - "uid": { - SchemaProps: spec.SchemaProps{ - Description: "UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceVersion": { - SchemaProps: spec.SchemaProps{ - Description: "An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", - Type: []string{"string"}, - Format: "", - }, - }, - "generation": { - SchemaProps: spec.SchemaProps{ - Description: "A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "creationTimestamp": { - SchemaProps: spec.SchemaProps{ - Description: "CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "deletionTimestamp": { - SchemaProps: spec.SchemaProps{ - Description: "DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "deletionGracePeriodSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "labels": { - SchemaProps: spec.SchemaProps{ - Description: "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "annotations": { - SchemaProps: spec.SchemaProps{ - Description: "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "ownerReferences": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "uid", - }, - "x-kubernetes-list-type": "map", - "x-kubernetes-patch-merge-key": "uid", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference"), - }, - }, - }, - }, - }, - "finalizers": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "set", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "managedFields": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry", "k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_pkg_apis_meta_v1_OwnerReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "API version of the referent.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "uid": { - SchemaProps: spec.SchemaProps{ - Description: "UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "controller": { - SchemaProps: spec.SchemaProps{ - Description: "If true, this reference points to the managing controller.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "blockOwnerDeletion": { - SchemaProps: spec.SchemaProps{ - Description: "If true, AND if the owner has the \"foregroundDeletion\" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. See https://kubernetes.io/docs/concepts/architecture/garbage-collection/#foreground-deletion for how the garbage collector interacts with this field and enforces the foreground deletion. Defaults to false. To set this field, a user needs \"delete\" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"apiVersion", "kind", "name", "uid"}, - }, - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-map-type": "atomic", - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_PartialObjectMetadata(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PartialObjectMetadata is a generic representation of any object with ObjectMeta. It allows clients to get access to a particular ObjectMeta schema without knowing the details of the version.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_meta_v1_PartialObjectMetadataList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PartialObjectMetadataList contains a list of objects containing only their metadata", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "items contains each of the included items.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata"}, - } -} - -func schema_pkg_apis_meta_v1_Patch(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.", - Type: []string{"object"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_PatchOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PatchOptions may be provided when patching an API object. PatchOptions is meant to be a superset of UpdateOptions.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "dryRun": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "force": { - SchemaProps: spec.SchemaProps{ - Description: "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "fieldManager": { - SchemaProps: spec.SchemaProps{ - Description: "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", - Type: []string{"string"}, - Format: "", - }, - }, - "fieldValidation": { - SchemaProps: spec.SchemaProps{ - Description: "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_Preconditions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "uid": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies the target UID.", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceVersion": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies the target ResourceVersion", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_RootPaths(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RootPaths lists the paths available at root. For example: \"/healthz\", \"/apis\".", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "paths": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "paths are the paths available at root.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"paths"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_ServerAddressByClientCIDR(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "clientCIDR": { - SchemaProps: spec.SchemaProps{ - Description: "The CIDR with which clients can match their IP to figure out the server address that they should use.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "serverAddress": { - SchemaProps: spec.SchemaProps{ - Description: "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"clientCIDR", "serverAddress"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_Status(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Status is a return value for calls that don't return other objects.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status of the operation. One of: \"Success\" or \"Failure\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "A human-readable description of the status of this operation.", - Type: []string{"string"}, - Format: "", - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.", - Type: []string{"string"}, - Format: "", - }, - }, - "details": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails"), - }, - }, - "code": { - SchemaProps: spec.SchemaProps{ - Description: "Suggested HTTP return code for this status, 0 if not set.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails"}, - } -} - -func schema_pkg_apis_meta_v1_StatusCause(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "A machine-readable description of the cause of the error. If this value is empty there is no information available.", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "A human-readable description of the cause of the error. This field may be presented as-is to a reader.", - Type: []string{"string"}, - Format: "", - }, - }, - "field": { - SchemaProps: spec.SchemaProps{ - Description: "The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\"", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_StatusDetails(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).", - Type: []string{"string"}, - Format: "", - }, - }, - "group": { - SchemaProps: spec.SchemaProps{ - Description: "The group attribute of the resource associated with the status StatusReason.", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "uid": { - SchemaProps: spec.SchemaProps{ - Description: "UID of the resource. (when there is a single resource which can be described). More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", - Type: []string{"string"}, - Format: "", - }, - }, - "causes": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause"), - }, - }, - }, - }, - }, - "retryAfterSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause"}, - } -} - -func schema_pkg_apis_meta_v1_Table(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Table is a tabular representation of a set of API resources. The server transforms the object into a set of preferred columns for quickly reviewing the objects.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "columnDefinitions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "columnDefinitions describes each column in the returned items array. The number of cells per row will always match the number of column definitions.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition"), - }, - }, - }, - }, - }, - "rows": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "rows is the list of items in the table.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TableRow"), - }, - }, - }, - }, - }, - }, - Required: []string{"columnDefinitions", "rows"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition", "k8s.io/apimachinery/pkg/apis/meta/v1.TableRow"}, - } -} - -func schema_pkg_apis_meta_v1_TableColumnDefinition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TableColumnDefinition contains information about a column returned in the Table.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "name is a human readable name for the column.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "type": { - SchemaProps: spec.SchemaProps{ - Description: "type is an OpenAPI type definition for this column, such as number, integer, string, or array. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "format": { - SchemaProps: spec.SchemaProps{ - Description: "format is an optional OpenAPI type modifier for this column. A format modifies the type and imposes additional rules, like date or time formatting for a string. The 'name' format is applied to the primary identifier column which has type 'string' to assist in clients identifying column is the resource name. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "description": { - SchemaProps: spec.SchemaProps{ - Description: "description is a human readable description of this column.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "priority": { - SchemaProps: spec.SchemaProps{ - Description: "priority is an integer defining the relative importance of this column compared to others. Lower numbers are considered higher priority. Columns that may be omitted in limited space scenarios should be given a higher priority.", - Default: 0, - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"name", "type", "format", "description", "priority"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_TableOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TableOptions are used when a Table is requested by the caller.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "includeObject": { - SchemaProps: spec.SchemaProps{ - Description: "includeObject decides whether to include each object along with its columnar information. Specifying \"None\" will return no object, specifying \"Object\" will return the full object contents, and specifying \"Metadata\" (the default) will return the object's metadata in the PartialObjectMetadata kind in version v1beta1 of the meta.k8s.io API group.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_TableRow(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TableRow is an individual row in a table.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "cells": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "cells will be as wide as the column definitions array and may contain strings, numbers (float64 or int64), booleans, simple maps, lists, or null. See the type field of the column definition for a more detailed description.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Format: "", - }, - }, - }, - }, - }, - "conditions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "conditions describe additional status of a row that are relevant for a human user. These conditions apply to the row, not to the object, and will be specific to table output. The only defined condition type is 'Completed', for a row that indicates a resource that has run to completion and can be given less visual priority.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition"), - }, - }, - }, - }, - }, - "object": { - SchemaProps: spec.SchemaProps{ - Description: "This field contains the requested additional information about each object based on the includeObject policy when requesting the Table. If \"None\", this field is empty, if \"Object\" this will be the default serialization of the object for the current API version, and if \"Metadata\" (the default) will contain the object metadata. Check the returned kind and apiVersion of the object before parsing. The media type of the object will always match the enclosing list - if this as a JSON table, these will be JSON encoded objects.", - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), - }, - }, - }, - Required: []string{"cells"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, - } -} - -func schema_pkg_apis_meta_v1_TableRowCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TableRowCondition allows a row to be marked with additional information.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type of row condition. The only defined value is 'Completed' indicating that the object this row represents has reached a completed state and may be given less visual priority than other rows. Clients are not required to honor any conditions but should be consistent where possible about handling the conditions.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status of the condition, one of True, False, Unknown.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "(brief) machine readable reason for the condition's last transition.", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "Human readable message indicating details about last transition.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "status"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_Time(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.", - Type: v1.Time{}.OpenAPISchemaType(), - Format: v1.Time{}.OpenAPISchemaFormat(), - }, - }, - } -} - -func schema_pkg_apis_meta_v1_Timestamp(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Timestamp is a struct that is equivalent to Time, but intended for protobuf marshalling/unmarshalling. It is generated into a serialization that matches Time. Do not use in Go structs.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "seconds": { - SchemaProps: spec.SchemaProps{ - Description: "Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.", - Default: 0, - Type: []string{"integer"}, - Format: "int64", - }, - }, - "nanos": { - SchemaProps: spec.SchemaProps{ - Description: "Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. This field may be limited in precision depending on context.", - Default: 0, - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"seconds", "nanos"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_TypeMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TypeMeta describes an individual object in an API response or request with strings representing the type of the object and its API schema version. Structures that are versioned or persisted should inline TypeMeta.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_UpdateOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "UpdateOptions may be provided when updating an API object. All fields in UpdateOptions should also be present in PatchOptions.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "dryRun": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "fieldManager": { - SchemaProps: spec.SchemaProps{ - Description: "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", - Type: []string{"string"}, - Format: "", - }, - }, - "fieldValidation": { - SchemaProps: spec.SchemaProps{ - Description: "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_WatchEvent(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Event represents a single event to a watched resource.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "object": { - SchemaProps: spec.SchemaProps{ - Description: "Object is:\n * If Type is Added or Modified: the new state of the object.\n * If Type is Deleted: the state of the object immediately before deletion.\n * If Type is Error: *Status is recommended; other types may make sense\n depending on context.", - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), - }, - }, - }, - Required: []string{"type", "object"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/runtime.RawExtension"}, - } -} - -func schema_k8sio_apimachinery_pkg_runtime_RawExtension(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.Object `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// External package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// On the wire, the JSON will look something like this:\n\n\t{\n\t\t\"kind\":\"MyAPIObject\",\n\t\t\"apiVersion\":\"v1\",\n\t\t\"myPlugin\": {\n\t\t\t\"kind\":\"PluginA\",\n\t\t\t\"aOption\":\"foo\",\n\t\t},\n\t}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)", - Type: []string{"object"}, - }, - }, - } -} - -func schema_k8sio_apimachinery_pkg_runtime_TypeMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TypeMeta is shared by all top level objects. The proper way to use it is to inline it in your type, like this:\n\n\ttype MyAwesomeAPIObject struct {\n\t runtime.TypeMeta `json:\",inline\"`\n\t ... // other fields\n\t}\n\nfunc (obj *MyAwesomeAPIObject) SetGroupVersionKind(gvk *metav1.GroupVersionKind) { metav1.UpdateTypeMeta(obj,gvk) }; GroupVersionKind() *GroupVersionKind\n\nTypeMeta is provided here for convenience. You may use it directly from this package or define your own with the same fields.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_apimachinery_pkg_runtime_Unknown(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Unknown allows api objects with unknown types to be passed-through. This can be used to deal with the API objects from a plug-in. Unknown objects still have functioning TypeMeta features-- kind, version, etc. metadata and field mutatation.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "ContentEncoding": { - SchemaProps: spec.SchemaProps{ - Description: "ContentEncoding is encoding used to encode 'Raw' data. Unspecified means no encoding.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "ContentType": { - SchemaProps: spec.SchemaProps{ - Description: "ContentType is serialization method used to serialize 'Raw'. Unspecified means ContentTypeJSON.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"ContentEncoding", "ContentType"}, - }, - }, - } -} - -func schema_k8sio_apimachinery_pkg_version_Info(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Info contains versioning information. how we'll want to distribute that information.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "major": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "minor": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "gitVersion": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "gitCommit": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "gitTreeState": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "buildDate": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "goVersion": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "compiler": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "platform": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"major", "minor", "gitVersion", "gitCommit", "gitTreeState", "buildDate", "goVersion", "compiler", "platform"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_AllowedListeners(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "AllowedListeners defines which ListenerSets can be attached to this Gateway.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "namespaces": { - SchemaProps: spec.SchemaProps{ - Description: "Namespaces defines which namespaces ListenerSets can be attached to this Gateway. While this feature is experimental, the default value is to allow no ListenerSets.", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.ListenerNamespaces"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.ListenerNamespaces"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_AllowedRoutes(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "namespaces": { - SchemaProps: spec.SchemaProps{ - Description: "Namespaces indicates namespaces from which Routes may be attached to this Listener. This is restricted to the namespace of this Gateway by default.\n\nSupport: Core", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.RouteNamespaces"), - }, - }, - "kinds": { - SchemaProps: spec.SchemaProps{ - Description: "Kinds specifies the groups and kinds of Routes that are allowed to bind to this Gateway Listener. When unspecified or empty, the kinds of Routes selected are determined using the Listener protocol.\n\nA RouteGroupKind MUST correspond to kinds of Routes that are compatible with the application protocol specified in the Listener's Protocol field. If an implementation does not support or recognize this resource type, it MUST set the \"ResolvedRefs\" condition to False for this Listener with the \"InvalidRouteKinds\" reason.\n\nSupport: Core", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.RouteGroupKind"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.RouteGroupKind", "sigs.k8s.io/gateway-api/apis/v1.RouteNamespaces"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_BackendObjectReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "BackendObjectReference defines how an ObjectReference that is specific to BackendRef. It includes a few additional fields and features than a regular ObjectReference.\n\nNote that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details.\n\nThe API object must be valid in the cluster; the Group and Kind must be registered in the cluster for this reference to be valid.\n\nReferences to objects with invalid Group and Kind are not valid, and must be rejected by the implementation, with appropriate Conditions set on the containing object.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Description: "Group is the group of the referent. For example, \"gateway.networking.k8s.io\". When unspecified or empty string, core API group is inferred.", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is the Kubernetes resource kind of the referent. For example \"Service\".\n\nDefaults to \"Service\" when not specified.\n\nExternalName services can refer to CNAME DNS records that may live outside of the cluster and as such are difficult to reason about in terms of conformance. They also may not be safe to forward to (see CVE-2021-25740 for more information). Implementations SHOULD NOT support ExternalName Services.\n\nSupport: Core (Services with a type other than ExternalName)\n\nSupport: Implementation-specific (Services with type ExternalName)", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the referent.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Description: "Namespace is the namespace of the backend. When unspecified, the local namespace is inferred.\n\nNote that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details.\n\nSupport: Core", - Type: []string{"string"}, - Format: "", - }, - }, - "port": { - SchemaProps: spec.SchemaProps{ - Description: "Port specifies the destination port number to use for this resource. Port is required when the referent is a Kubernetes Service. In this case, the port number is the service port number, not the target port. For other resources, destination port might be derived from the referent resource or this field.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"name"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_BackendRef(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "BackendRef defines how a Route should forward a request to a Kubernetes resource.\n\nNote that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Description: "Group is the group of the referent. For example, \"gateway.networking.k8s.io\". When unspecified or empty string, core API group is inferred.", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is the Kubernetes resource kind of the referent. For example \"Service\".\n\nDefaults to \"Service\" when not specified.\n\nExternalName services can refer to CNAME DNS records that may live outside of the cluster and as such are difficult to reason about in terms of conformance. They also may not be safe to forward to (see CVE-2021-25740 for more information). Implementations SHOULD NOT support ExternalName Services.\n\nSupport: Core (Services with a type other than ExternalName)\n\nSupport: Implementation-specific (Services with type ExternalName)", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the referent.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Description: "Namespace is the namespace of the backend. When unspecified, the local namespace is inferred.\n\nNote that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details.\n\nSupport: Core", - Type: []string{"string"}, - Format: "", - }, - }, - "port": { - SchemaProps: spec.SchemaProps{ - Description: "Port specifies the destination port number to use for this resource. Port is required when the referent is a Kubernetes Service. In this case, the port number is the service port number, not the target port. For other resources, destination port might be derived from the referent resource or this field.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "weight": { - SchemaProps: spec.SchemaProps{ - Description: "Weight specifies the proportion of requests forwarded to the referenced backend. This is computed as weight/(sum of all weights in this BackendRefs list). For non-zero values, there may be some epsilon from the exact proportion defined here depending on the precision an implementation supports. Weight is not a percentage and the sum of weights does not need to equal 100.\n\nIf only one backend is specified and it has a weight greater than 0, 100% of the traffic is forwarded to that backend. If weight is set to 0, no traffic should be forwarded for this entry. If unspecified, weight defaults to 1.\n\nSupport for this field varies based on the context where used.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"name"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_CommonRouteSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CommonRouteSpec defines the common attributes that all Routes MUST include within their spec.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "parentRefs": { - SchemaProps: spec.SchemaProps{ - Description: "ParentRefs references the resources (usually Gateways) that a Route wants to be attached to. Note that the referenced parent resource needs to allow this for the attachment to be complete. For Gateways, that means the Gateway needs to allow attachment from Routes of this kind and namespace. For Services, that means the Service must either be in the same namespace for a \"producer\" route, or the mesh implementation must support and allow \"consumer\" routes for the referenced Service. ReferenceGrant is not applicable for governing ParentRefs to Services - it is not possible to create a \"producer\" route for a Service in a different namespace from the Route.\n\nThere are two kinds of parent resources with \"Core\" support:\n\n* Gateway (Gateway conformance profile) * Service (Mesh conformance profile, ClusterIP Services only)\n\nThis API may be extended in the future to support additional kinds of parent resources.\n\nParentRefs must be _distinct_. This means either that:\n\n* They select different objects. If this is the case, then parentRef\n entries are distinct. In terms of fields, this means that the\n multi-part key defined by `group`, `kind`, `namespace`, and `name` must\n be unique across all parentRef entries in the Route.\n* They do not select different objects, but for each optional field used,\n each ParentRef that selects the same object must set the same set of\n optional fields to different values. If one ParentRef sets a\n combination of optional fields, all must set the same combination.\n\nSome examples:\n\n* If one ParentRef sets `sectionName`, all ParentRefs referencing the\n same object must also set `sectionName`.\n* If one ParentRef sets `port`, all ParentRefs referencing the same\n object must also set `port`.\n* If one ParentRef sets `sectionName` and `port`, all ParentRefs\n referencing the same object must also set `sectionName` and `port`.\n\nIt is possible to separately reference multiple distinct objects that may be collapsed by an implementation. For example, some implementations may choose to merge compatible Gateway Listeners together. If that is the case, the list of routes attached to those resources should also be merged.\n\nNote that for ParentRefs that cross namespace boundaries, there are specific rules. 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 other kinds of cross-namespace reference.\n\n 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.\n\nParentRefs 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 the intended destination of the connections are a Service targeted as a ParentRef of the Route. \n\n ", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.ParentReference"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.ParentReference"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_CookieConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CookieConfig defines the configuration for cookie-based session persistence.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "lifetimeType": { - SchemaProps: spec.SchemaProps{ - Description: "LifetimeType specifies whether the cookie has a permanent or session-based lifetime. A permanent cookie persists until its specified expiry time, defined by the Expires or Max-Age cookie attributes, while a session cookie is deleted when the current session ends.\n\nWhen set to \"Permanent\", AbsoluteTimeout indicates the cookie's lifetime via the Expires or Max-Age cookie attributes and is required.\n\nWhen set to \"Session\", AbsoluteTimeout indicates the absolute lifetime of the cookie tracked by the gateway and is optional.\n\nDefaults to \"Session\".\n\nSupport: Core for \"Session\" type\n\nSupport: Extended for \"Permanent\" type", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_Fraction(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "numerator": { - SchemaProps: spec.SchemaProps{ - Default: 0, - Type: []string{"integer"}, - Format: "int32", - }, - }, - "denominator": { - SchemaProps: spec.SchemaProps{ - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"numerator"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_FrontendTLSValidation(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "FrontendTLSValidation holds configuration information that can be used to validate the frontend initiating the TLS connection", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "caCertificateRefs": { - SchemaProps: spec.SchemaProps{ - Description: "CACertificateRefs contains one or more references to Kubernetes objects that contain TLS certificates of the Certificate Authorities that can be used as a trust anchor to validate the certificates presented by the client.\n\nA single CA certificate reference to a Kubernetes ConfigMap has \"Core\" support. Implementations MAY choose to support attaching multiple CA certificates to a Listener, but this behavior is implementation-specific.\n\nSupport: Core - A single reference to a Kubernetes ConfigMap with the CA certificate in a key named `ca.crt`.\n\nSupport: Implementation-specific (More than one reference, or other kinds of resources).\n\nReferences to a resource in a different namespace are invalid UNLESS there is a ReferenceGrant in the target namespace that allows the certificate to be attached. If a ReferenceGrant does not allow this reference, the \"ResolvedRefs\" condition MUST be set to False for this listener with the \"RefNotPermitted\" reason.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.ObjectReference"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.ObjectReference"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_GRPCBackendRef(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GRPCBackendRef defines how a GRPCRoute forwards a gRPC request.\n\nNote that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details.\n\n\n\nWhen the BackendRef points to a Kubernetes Service, implementations SHOULD honor the appProtocol field if it is set for the target Service Port.\n\nImplementations supporting appProtocol SHOULD recognize the Kubernetes Standard Application Protocols defined in KEP-3726.\n\nIf a Service appProtocol isn't specified, an implementation MAY infer the backend protocol through its own means. Implementations MAY infer the protocol from the Route type referring to the backend Service.\n\nIf a Route is not able to send traffic to the backend using the specified protocol then the backend is considered invalid. Implementations MUST set the \"ResolvedRefs\" condition to \"False\" with the \"UnsupportedProtocol\" reason.\n\n", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Description: "Group is the group of the referent. For example, \"gateway.networking.k8s.io\". When unspecified or empty string, core API group is inferred.", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is the Kubernetes resource kind of the referent. For example \"Service\".\n\nDefaults to \"Service\" when not specified.\n\nExternalName services can refer to CNAME DNS records that may live outside of the cluster and as such are difficult to reason about in terms of conformance. They also may not be safe to forward to (see CVE-2021-25740 for more information). Implementations SHOULD NOT support ExternalName Services.\n\nSupport: Core (Services with a type other than ExternalName)\n\nSupport: Implementation-specific (Services with type ExternalName)", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the referent.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Description: "Namespace is the namespace of the backend. When unspecified, the local namespace is inferred.\n\nNote that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details.\n\nSupport: Core", - Type: []string{"string"}, - Format: "", - }, - }, - "port": { - SchemaProps: spec.SchemaProps{ - Description: "Port specifies the destination port number to use for this resource. Port is required when the referent is a Kubernetes Service. In this case, the port number is the service port number, not the target port. For other resources, destination port might be derived from the referent resource or this field.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "weight": { - SchemaProps: spec.SchemaProps{ - Description: "Weight specifies the proportion of requests forwarded to the referenced backend. This is computed as weight/(sum of all weights in this BackendRefs list). For non-zero values, there may be some epsilon from the exact proportion defined here depending on the precision an implementation supports. Weight is not a percentage and the sum of weights does not need to equal 100.\n\nIf only one backend is specified and it has a weight greater than 0, 100% of the traffic is forwarded to that backend. If weight is set to 0, no traffic should be forwarded for this entry. If unspecified, weight defaults to 1.\n\nSupport for this field varies based on the context where used.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "filters": { - SchemaProps: spec.SchemaProps{ - Description: "Filters defined at this level MUST be executed if and only if the request is being forwarded to the backend defined here.\n\nSupport: Implementation-specific (For broader support of filters, use the Filters field in GRPCRouteRule.)", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GRPCRouteFilter"), - }, - }, - }, - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.GRPCRouteFilter"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_GRPCHeaderMatch(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GRPCHeaderMatch describes how to select a gRPC route by matching gRPC request headers.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type specifies how to match against the value of the header.", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the gRPC Header to be matched.\n\nIf multiple entries specify equivalent header names, only the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, \"foo\" and \"Foo\" are considered equivalent.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "value": { - SchemaProps: spec.SchemaProps{ - Description: "Value is the value of the gRPC Header to be matched.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name", "value"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_GRPCMethodMatch(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GRPCMethodMatch describes how to select a gRPC route by matching the gRPC request service and/or method.\n\nAt least one of Service and Method MUST be a non-empty string.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type specifies how to match against the service and/or method. Support: Core (Exact with service and method specified)\n\nSupport: Implementation-specific (Exact with method specified but no service specified)\n\nSupport: Implementation-specific (RegularExpression)", - Type: []string{"string"}, - Format: "", - }, - }, - "service": { - SchemaProps: spec.SchemaProps{ - Description: "Value of the service to match against. If left empty or omitted, will match any service.\n\nAt least one of Service and Method MUST be a non-empty string.", - Type: []string{"string"}, - Format: "", - }, - }, - "method": { - SchemaProps: spec.SchemaProps{ - Description: "Value of the method to match against. If left empty or omitted, will match all services.\n\nAt least one of Service and Method MUST be a non-empty string.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_GRPCRoute(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GRPCRoute provides a way to route gRPC requests. This includes the capability to match requests by hostname, gRPC service, gRPC method, or HTTP/2 header. Filters can be used to specify additional processing steps. Backends specify where matching requests will be routed.\n\nGRPCRoute falls under extended support within the Gateway API. Within the following specification, the word \"MUST\" indicates that an implementation supporting GRPCRoute must conform to the indicated requirement, but an implementation not supporting this route type need not follow the requirement unless explicitly indicated.\n\nImplementations supporting `GRPCRoute` with the `HTTPS` `ProtocolType` MUST accept HTTP/2 connections without an initial upgrade from HTTP/1.1, i.e. via ALPN. If the implementation does not support this, then it MUST set the \"Accepted\" condition to \"False\" for the affected listener with a reason of \"UnsupportedProtocol\". Implementations MAY also accept HTTP/2 connections with an upgrade from HTTP/1.\n\nImplementations supporting `GRPCRoute` with the `HTTP` `ProtocolType` MUST support HTTP/2 over cleartext TCP (h2c, https://www.rfc-editor.org/rfc/rfc7540#section-3.1) without an initial upgrade from HTTP/1.1, i.e. with prior knowledge (https://www.rfc-editor.org/rfc/rfc7540#section-3.4). If the implementation does not support this, then it MUST set the \"Accepted\" condition to \"False\" for the affected listener with a reason of \"UnsupportedProtocol\". Implementations MAY also accept HTTP/2 connections with an upgrade from HTTP/1, i.e. without prior knowledge.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the desired state of GRPCRoute.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GRPCRouteSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status defines the current state of GRPCRoute.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GRPCRouteStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/gateway-api/apis/v1.GRPCRouteSpec", "sigs.k8s.io/gateway-api/apis/v1.GRPCRouteStatus"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_GRPCRouteFilter(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GRPCRouteFilter defines processing steps that must be completed during the request or response lifecycle. GRPCRouteFilters are meant as an extension point to express processing that may be done in Gateway implementations. Some examples include request or response modification, implementing authentication strategies, rate-limiting, and traffic shaping. API guarantee/conformance is defined based on the type of the filter.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type identifies the type of filter to apply. As with other API fields, types are classified into three conformance levels:\n\n- Core: Filter types and their corresponding configuration defined by\n \"Support: Core\" in this package, e.g. \"RequestHeaderModifier\". All\n implementations supporting GRPCRoute MUST support core filters.\n\n- Extended: Filter types and their corresponding configuration defined by\n \"Support: Extended\" in this package, e.g. \"RequestMirror\". Implementers\n are encouraged to support extended filters.\n\n- Implementation-specific: Filters that are defined and supported by specific vendors.\n In the future, filters showing convergence in behavior across multiple\n implementations will be considered for inclusion in extended or core\n conformance levels. Filter-specific configuration for such filters\n is specified using the ExtensionRef field. `Type` MUST be set to\n \"ExtensionRef\" for custom filters.\n\nImplementers are encouraged to define custom implementation types to extend the core API with implementation-specific behavior.\n\nIf a reference to a custom filter type cannot be resolved, the filter MUST NOT be skipped. Instead, requests that would have been processed by that filter MUST receive a HTTP error response.\n\n", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "requestHeaderModifier": { - SchemaProps: spec.SchemaProps{ - Description: "RequestHeaderModifier defines a schema for a filter that modifies request headers.\n\nSupport: Core", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPHeaderFilter"), - }, - }, - "responseHeaderModifier": { - SchemaProps: spec.SchemaProps{ - Description: "ResponseHeaderModifier defines a schema for a filter that modifies response headers.\n\nSupport: Extended", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPHeaderFilter"), - }, - }, - "requestMirror": { - SchemaProps: spec.SchemaProps{ - Description: "RequestMirror defines a schema for a filter that mirrors requests. Requests are sent to the specified destination, but responses from that destination are ignored.\n\nThis filter can be used multiple times within the same rule. Note that not all implementations will be able to support mirroring to multiple backends.\n\nSupport: Extended\n\n\n", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPRequestMirrorFilter"), - }, - }, - "extensionRef": { - SchemaProps: spec.SchemaProps{ - Description: "ExtensionRef is an optional, implementation-specific extension to the \"filter\" behavior. For example, resource \"myroutefilter\" in group \"networking.example.net\"). ExtensionRef MUST NOT be used for core and extended filters.\n\nSupport: Implementation-specific\n\nThis filter can be used multiple times within the same rule.", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.LocalObjectReference"), - }, - }, - }, - Required: []string{"type"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.HTTPHeaderFilter", "sigs.k8s.io/gateway-api/apis/v1.HTTPRequestMirrorFilter", "sigs.k8s.io/gateway-api/apis/v1.LocalObjectReference"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_GRPCRouteList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GRPCRouteList contains a list of GRPCRoute.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GRPCRoute"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/gateway-api/apis/v1.GRPCRoute"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_GRPCRouteMatch(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GRPCRouteMatch defines the predicate used to match requests to a given action. Multiple match types are ANDed together, i.e. the match will evaluate to true only if all conditions are satisfied.\n\nFor example, the match below will match a gRPC request only if its service is `foo` AND it contains the `version: v1` header:\n\n``` matches:\n - method:\n type: Exact\n service: \"foo\"\n headers:\n - name: \"version\"\n value \"v1\"\n\n```", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "method": { - SchemaProps: spec.SchemaProps{ - Description: "Method specifies a gRPC request service/method matcher. If this field is not specified, all services and methods will match.", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GRPCMethodMatch"), - }, - }, - "headers": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "name", - }, - "x-kubernetes-list-type": "map", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Headers specifies gRPC request header matchers. Multiple match values are ANDed together, meaning, a request MUST match all the specified headers to select the route.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GRPCHeaderMatch"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.GRPCHeaderMatch", "sigs.k8s.io/gateway-api/apis/v1.GRPCMethodMatch"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_GRPCRouteRule(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GRPCRouteRule defines the semantics for matching a gRPC request based on conditions (matches), processing it (filters), and forwarding the request to an API object (backendRefs).", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the route rule. This name MUST be unique within a Route if it is set.\n\nSupport: Extended ", - Type: []string{"string"}, - Format: "", - }, - }, - "matches": { - SchemaProps: spec.SchemaProps{ - Description: "Matches define conditions used for matching the rule against incoming gRPC requests. Each match is independent, i.e. this rule will be matched if **any** one of the matches is satisfied.\n\nFor example, take the following matches configuration:\n\n``` matches: - method:\n service: foo.bar\n headers:\n values:\n version: 2\n- method:\n service: foo.bar.v2\n```\n\nFor a request to match against this rule, it MUST satisfy EITHER of the two conditions:\n\n- service of foo.bar AND contains the header `version: 2` - service of foo.bar.v2\n\nSee the documentation for GRPCRouteMatch on how to specify multiple match conditions to be ANDed together.\n\nIf no matches are specified, the implementation MUST match every gRPC request.\n\nProxy or Load Balancer routing configuration generated from GRPCRoutes MUST prioritize rules based on the following criteria, continuing on ties. Merging MUST not be done between GRPCRoutes and HTTPRoutes. Precedence MUST be given to the rule with the largest number of:\n\n* Characters in a matching non-wildcard hostname. * Characters in a matching hostname. * Characters in a matching service. * Characters in a matching method. * Header matches.\n\nIf ties still exist across multiple Routes, matching precedence MUST be determined in order of the following criteria, continuing on ties:\n\n* The oldest Route based on creation timestamp. * The Route appearing first in alphabetical order by\n \"{namespace}/{name}\".\n\nIf ties still exist within the Route that has been given precedence, matching precedence MUST be granted to the first matching rule meeting the above criteria.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GRPCRouteMatch"), - }, - }, - }, - }, - }, - "filters": { - SchemaProps: spec.SchemaProps{ - Description: "Filters define the filters that are applied to requests that match this rule.\n\nThe effects of ordering of multiple behaviors are currently unspecified. This can change in the future based on feedback during the alpha stage.\n\nConformance-levels at this level are defined based on the type of filter:\n\n- ALL core filters MUST be supported by all implementations that support\n GRPCRoute.\n- Implementers are encouraged to support extended filters. - Implementation-specific custom filters have no API guarantees across\n implementations.\n\nSpecifying the same filter multiple times is not supported unless explicitly indicated in the filter.\n\nIf an implementation cannot support a combination of filters, it must clearly document that limitation. In cases where incompatible or unsupported filters are specified and cause the `Accepted` condition to be set to status `False`, implementations may use the `IncompatibleFilters` reason to specify this configuration error.\n\nSupport: Core", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GRPCRouteFilter"), - }, - }, - }, - }, - }, - "backendRefs": { - SchemaProps: spec.SchemaProps{ - Description: "BackendRefs defines the backend(s) where matching requests should be sent.\n\nFailure behavior here depends on how many BackendRefs are specified and how many are invalid.\n\nIf *all* entries in BackendRefs are invalid, and there are also no filters specified in this route rule, *all* traffic which matches this rule MUST receive an `UNAVAILABLE` status.\n\nSee the GRPCBackendRef definition for the rules about what makes a single GRPCBackendRef invalid.\n\nWhen a GRPCBackendRef is invalid, `UNAVAILABLE` statuses MUST be returned for requests that would have otherwise been routed to an invalid backend. If multiple backends are specified, and some are invalid, the proportion of requests that would otherwise have been routed to an invalid backend MUST receive an `UNAVAILABLE` status.\n\nFor example, if two backends are specified with equal weights, and one is invalid, 50 percent of traffic MUST receive an `UNAVAILABLE` status. Implementations may choose how that 50 percent is determined.\n\nSupport: Core for Kubernetes Service\n\nSupport: Implementation-specific for any other resource\n\nSupport for weight: Core", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GRPCBackendRef"), - }, - }, - }, - }, - }, - "sessionPersistence": { - SchemaProps: spec.SchemaProps{ - Description: "SessionPersistence defines and configures session persistence for the route rule.\n\nSupport: Extended\n\n", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.SessionPersistence"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.GRPCBackendRef", "sigs.k8s.io/gateway-api/apis/v1.GRPCRouteFilter", "sigs.k8s.io/gateway-api/apis/v1.GRPCRouteMatch", "sigs.k8s.io/gateway-api/apis/v1.SessionPersistence"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_GRPCRouteSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GRPCRouteSpec defines the desired state of GRPCRoute", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "parentRefs": { - SchemaProps: spec.SchemaProps{ - Description: "ParentRefs references the resources (usually Gateways) that a Route wants to be attached to. Note that the referenced parent resource needs to allow this for the attachment to be complete. For Gateways, that means the Gateway needs to allow attachment from Routes of this kind and namespace. For Services, that means the Service must either be in the same namespace for a \"producer\" route, or the mesh implementation must support and allow \"consumer\" routes for the referenced Service. ReferenceGrant is not applicable for governing ParentRefs to Services - it is not possible to create a \"producer\" route for a Service in a different namespace from the Route.\n\nThere are two kinds of parent resources with \"Core\" support:\n\n* Gateway (Gateway conformance profile) * Service (Mesh conformance profile, ClusterIP Services only)\n\nThis API may be extended in the future to support additional kinds of parent resources.\n\nParentRefs must be _distinct_. This means either that:\n\n* They select different objects. If this is the case, then parentRef\n entries are distinct. In terms of fields, this means that the\n multi-part key defined by `group`, `kind`, `namespace`, and `name` must\n be unique across all parentRef entries in the Route.\n* They do not select different objects, but for each optional field used,\n each ParentRef that selects the same object must set the same set of\n optional fields to different values. If one ParentRef sets a\n combination of optional fields, all must set the same combination.\n\nSome examples:\n\n* If one ParentRef sets `sectionName`, all ParentRefs referencing the\n same object must also set `sectionName`.\n* If one ParentRef sets `port`, all ParentRefs referencing the same\n object must also set `port`.\n* If one ParentRef sets `sectionName` and `port`, all ParentRefs\n referencing the same object must also set `sectionName` and `port`.\n\nIt is possible to separately reference multiple distinct objects that may be collapsed by an implementation. For example, some implementations may choose to merge compatible Gateway Listeners together. If that is the case, the list of routes attached to those resources should also be merged.\n\nNote that for ParentRefs that cross namespace boundaries, there are specific rules. 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 other kinds of cross-namespace reference.\n\n 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.\n\nParentRefs 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 the intended destination of the connections are a Service targeted as a ParentRef of the Route. \n\n ", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.ParentReference"), - }, - }, - }, - }, - }, - "hostnames": { - SchemaProps: spec.SchemaProps{ - Description: "Hostnames defines a set of hostnames to match against the GRPC Host header to select a GRPCRoute to process the request. This matches the RFC 1123 definition of a hostname with 2 notable exceptions:\n\n1. IPs are not allowed. 2. A hostname may be prefixed with a wildcard label (`*.`). The wildcard\n label MUST appear by itself as the first label.\n\nIf a hostname is specified by both the Listener and GRPCRoute, there MUST be at least one intersecting hostname for the GRPCRoute to be attached to the Listener. For example:\n\n* A Listener with `test.example.com` as the hostname matches GRPCRoutes\n that have either not specified any hostnames, or have specified at\n least one of `test.example.com` or `*.example.com`.\n* A Listener with `*.example.com` as the hostname matches GRPCRoutes\n that have either not specified any hostnames or have specified at least\n one hostname that matches the Listener hostname. For example,\n `test.example.com` and `*.example.com` would both match. On the other\n hand, `example.com` and `test.example.net` would not match.\n\nHostnames that are prefixed with a wildcard label (`*.`) are interpreted as a suffix match. That means that a match for `*.example.com` would match both `test.example.com`, and `foo.test.example.com`, but not `example.com`.\n\nIf both the Listener and GRPCRoute have specified hostnames, any GRPCRoute hostnames that do not match the Listener hostname MUST be ignored. For example, if a Listener specified `*.example.com`, and the GRPCRoute specified `test.example.com` and `test.example.net`, `test.example.net` MUST NOT be considered for a match.\n\nIf both the Listener and GRPCRoute have specified hostnames, and none match with the criteria above, then the GRPCRoute MUST NOT be accepted by the implementation. The implementation MUST raise an 'Accepted' Condition with a status of `False` in the corresponding RouteParentStatus.\n\nIf a Route (A) of type HTTPRoute or GRPCRoute is attached to a Listener and that listener already has another Route (B) of the other type attached and the intersection of the hostnames of A and B is non-empty, then the implementation MUST accept exactly one of these two routes, determined by the following criteria, in order:\n\n* The oldest Route based on creation timestamp. * The Route appearing first in alphabetical order by\n \"{namespace}/{name}\".\n\nThe rejected Route MUST raise an 'Accepted' condition with a status of 'False' in the corresponding RouteParentStatus.\n\nSupport: Core", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "rules": { - SchemaProps: spec.SchemaProps{ - Description: "Rules are a list of GRPC matchers, filters and actions.\n\n", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GRPCRouteRule"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.GRPCRouteRule", "sigs.k8s.io/gateway-api/apis/v1.ParentReference"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_GRPCRouteStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GRPCRouteStatus defines the observed state of GRPCRoute.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "parents": { - SchemaProps: spec.SchemaProps{ - Description: "Parents is a list of parent resources (usually Gateways) that are associated with the route, and the status of the route with respect to each parent. When this route attaches to a parent, the controller that manages the parent must add an entry to this list when the controller first sees the route and should update the entry as appropriate when the route or gateway is modified.\n\nNote that parent references that cannot be resolved by an implementation of this API will not be added to this list. Implementations of this API can only populate Route status for the Gateways/parent resources they are responsible for.\n\nA maximum of 32 Gateways will be represented in this list. An empty list means the route has not been attached to any Gateway.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.RouteParentStatus"), - }, - }, - }, - }, - }, - }, - Required: []string{"parents"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.RouteParentStatus"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_Gateway(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Gateway represents an instance of a service-traffic handling infrastructure by binding Listeners to a set of IP addresses.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the desired state of Gateway.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GatewaySpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status defines the current state of Gateway.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GatewayStatus"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/gateway-api/apis/v1.GatewaySpec", "sigs.k8s.io/gateway-api/apis/v1.GatewayStatus"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_GatewayAddress(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GatewayAddress describes an address that can be bound to a Gateway.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type of the address.", - Type: []string{"string"}, - Format: "", - }, - }, - "value": { - SchemaProps: spec.SchemaProps{ - Description: "Value of the address. The validity of the values will depend on the type and support by the controller.\n\nExamples: `1.2.3.4`, `128::1`, `my-ip-address`.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"value"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_GatewayBackendTLS(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GatewayBackendTLS describes backend TLS configuration for gateway.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "clientCertificateRef": { - SchemaProps: spec.SchemaProps{ - Description: "ClientCertificateRef is a reference to an object that contains a Client Certificate and the associated private key.\n\nReferences to a resource in different namespace are invalid UNLESS there is a ReferenceGrant in the target namespace that allows the certificate to be attached. If a ReferenceGrant does not allow this reference, the \"ResolvedRefs\" condition MUST be set to False for this listener with the \"RefNotPermitted\" reason.\n\nClientCertificateRef can reference to standard Kubernetes resources, i.e. Secret, or implementation-specific custom resources.\n\nThis setting can be overridden on the service level by use of BackendTLSPolicy.\n\nSupport: Core\n\n", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.SecretObjectReference"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.SecretObjectReference"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_GatewayClass(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GatewayClass describes a class of Gateways available to the user for creating Gateway resources.\n\nIt is recommended that this resource be used as a template for Gateways. This means that a Gateway is based on the state of the GatewayClass at the time it was created and changes to the GatewayClass or associated parameters are not propagated down to existing Gateways. This recommendation is intended to limit the blast radius of changes to GatewayClass or associated parameters. If implementations choose to propagate GatewayClass changes to existing Gateways, that MUST be clearly documented by the implementation.\n\nWhenever one or more Gateways are using a GatewayClass, implementations SHOULD add the `gateway-exists-finalizer.gateway.networking.k8s.io` finalizer on the associated GatewayClass. This ensures that a GatewayClass associated with a Gateway is not deleted while in use.\n\nGatewayClass is a Cluster level resource.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the desired state of GatewayClass.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GatewayClassSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status defines the current state of GatewayClass.\n\nImplementations MUST populate status on all GatewayClass resources which specify their controller name.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GatewayClassStatus"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/gateway-api/apis/v1.GatewayClassSpec", "sigs.k8s.io/gateway-api/apis/v1.GatewayClassStatus"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_GatewayClassList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GatewayClassList contains a list of GatewayClass", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GatewayClass"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/gateway-api/apis/v1.GatewayClass"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_GatewayClassSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GatewayClassSpec reflects the configuration of a class of Gateways.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "controllerName": { - SchemaProps: spec.SchemaProps{ - Description: "ControllerName is the name of the controller that is managing Gateways of this class. The value of this field MUST be a domain prefixed path.\n\nExample: \"example.net/gateway-controller\".\n\nThis field is not mutable and cannot be empty.\n\nSupport: Core", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "parametersRef": { - SchemaProps: spec.SchemaProps{ - Description: "ParametersRef is a reference to a resource that contains the configuration parameters corresponding to the GatewayClass. This is optional if the controller does not require any additional configuration.\n\nParametersRef can reference a standard Kubernetes resource, i.e. ConfigMap, or an implementation-specific custom resource. The resource can be cluster-scoped or namespace-scoped.\n\nIf the referent cannot be found, refers to an unsupported kind, or when the data within that resource is malformed, the GatewayClass SHOULD be rejected with the \"Accepted\" status condition set to \"False\" and an \"InvalidParameters\" reason.\n\nA Gateway for this GatewayClass may provide its own `parametersRef`. When both are specified, the merging behavior is implementation specific. It is generally recommended that GatewayClass provides defaults that can be overridden by a Gateway.\n\nSupport: Implementation-specific", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.ParametersReference"), - }, - }, - "description": { - SchemaProps: spec.SchemaProps{ - Description: "Description helps describe a GatewayClass with more details.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"controllerName"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.ParametersReference"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_GatewayClassStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GatewayClassStatus is the current status for the GatewayClass.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "conditions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "type", - }, - "x-kubernetes-list-type": "map", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Conditions is the current status from the controller for this GatewayClass.\n\nControllers should prefer to publish conditions using values of GatewayClassConditionType for the type of each Condition.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), - }, - }, - }, - }, - }, - "supportedFeatures": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "name", - }, - "x-kubernetes-list-type": "map", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "SupportedFeatures is the set of features the GatewayClass support. It MUST be sorted in ascending alphabetical order by the Name key. ", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.SupportedFeature"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Condition", "sigs.k8s.io/gateway-api/apis/v1.SupportedFeature"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_GatewayInfrastructure(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GatewayInfrastructure defines infrastructure level attributes about a Gateway instance.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "labels": { - SchemaProps: spec.SchemaProps{ - Description: "Labels that SHOULD be applied to any resources created in response to this Gateway.\n\nFor implementations creating other Kubernetes objects, this should be the `metadata.labels` field on resources. For other implementations, this refers to any relevant (implementation specific) \"labels\" concepts.\n\nAn implementation may chose to add additional implementation-specific labels as they see fit.\n\nIf an implementation maps these labels to Pods, or any other resource that would need to be recreated when labels change, it SHOULD clearly warn about this behavior in documentation.\n\nSupport: Extended", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "annotations": { - SchemaProps: spec.SchemaProps{ - Description: "Annotations that SHOULD be applied to any resources created in response to this Gateway.\n\nFor implementations creating other Kubernetes objects, this should be the `metadata.annotations` field on resources. For other implementations, this refers to any relevant (implementation specific) \"annotations\" concepts.\n\nAn implementation may chose to add additional implementation-specific annotations as they see fit.\n\nSupport: Extended", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "parametersRef": { - SchemaProps: spec.SchemaProps{ - Description: "ParametersRef is a reference to a resource that contains the configuration parameters corresponding to the Gateway. This is optional if the controller does not require any additional configuration.\n\nThis follows the same semantics as GatewayClass's `parametersRef`, but on a per-Gateway basis\n\nThe Gateway's GatewayClass may provide its own `parametersRef`. When both are specified, the merging behavior is implementation specific. It is generally recommended that GatewayClass provides defaults that can be overridden by a Gateway.\n\nIf the referent cannot be found, refers to an unsupported kind, or when the data within that resource is malformed, the Gateway SHOULD be rejected with the \"Accepted\" status condition set to \"False\" and an \"InvalidParameters\" reason.\n\nSupport: Implementation-specific", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.LocalParametersReference"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.LocalParametersReference"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_GatewayList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GatewayList contains a list of Gateways.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.Gateway"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/gateway-api/apis/v1.Gateway"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_GatewaySpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GatewaySpec defines the desired state of Gateway.\n\nNot all possible combinations of options specified in the Spec are valid. Some invalid configurations can be caught synchronously via CRD validation, but there are many cases that will require asynchronous signaling via the GatewayStatus block.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "gatewayClassName": { - SchemaProps: spec.SchemaProps{ - Description: "GatewayClassName used for this Gateway. This is the name of a GatewayClass resource.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "listeners": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "name", - }, - "x-kubernetes-list-type": "map", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Listeners associated with this Gateway. Listeners define logical endpoints that are bound on this Gateway's addresses. At least one Listener MUST be specified.\n\n## Distinct Listeners\n\nEach Listener in a set of Listeners (for example, in a single Gateway) MUST be _distinct_, in that a traffic flow MUST be able to be assigned to exactly one listener. (This section uses \"set of Listeners\" rather than \"Listeners in a single Gateway\" because implementations MAY merge configuration from multiple Gateways onto a single data plane, and these rules _also_ apply in that case).\n\nPractically, this means that each listener in a set MUST have a unique combination of Port, Protocol, and, if supported by the protocol, Hostname.\n\nSome combinations of port, protocol, and TLS settings are considered Core support and MUST be supported by implementations based on the objects they support:\n\nHTTPRoute\n\n1. HTTPRoute, Port: 80, Protocol: HTTP 2. HTTPRoute, Port: 443, Protocol: HTTPS, TLS Mode: Terminate, TLS keypair provided\n\nTLSRoute\n\n1. TLSRoute, Port: 443, Protocol: TLS, TLS Mode: Passthrough\n\n\"Distinct\" Listeners have the following property:\n\n**The implementation can match inbound requests to a single distinct Listener**.\n\nWhen multiple Listeners share values for fields (for example, two Listeners with the same Port value), the implementation can match requests to only one of the Listeners using other Listener fields.\n\nWhen multiple listeners have the same value for the Protocol field, then each of the Listeners with matching Protocol values MUST have different values for other fields.\n\nThe set of fields that MUST be different for a Listener differs per protocol. The following rules define the rules for what fields MUST be considered for Listeners to be distinct with each protocol currently defined in the Gateway API spec.\n\nThe set of listeners that all share a protocol value MUST have _different_ values for _at least one_ of these fields to be distinct:\n\n* **HTTP, HTTPS, TLS**: Port, Hostname * **TCP, UDP**: Port\n\nOne **very** important rule to call out involves what happens when an implementation:\n\n* Supports TCP protocol Listeners, as well as HTTP, HTTPS, or TLS protocol\n Listeners, and\n* sees HTTP, HTTPS, or TLS protocols with the same `port` as one with TCP\n Protocol.\n\nIn this case all the Listeners that share a port with the TCP Listener are not distinct and so MUST NOT be accepted.\n\nIf an implementation does not support TCP Protocol Listeners, then the previous rule does not apply, and the TCP Listeners SHOULD NOT be accepted.\n\nNote that the `tls` field is not used for determining if a listener is distinct, because Listeners that _only_ differ on TLS config will still conflict in all cases.\n\n### Listeners that are distinct only by Hostname\n\nWhen the Listeners are distinct based only on Hostname, inbound request hostnames MUST match from the most specific to least specific Hostname values to choose the correct Listener and its associated set of Routes.\n\nExact matches MUST be processed before wildcard matches, and wildcard matches MUST be processed before fallback (empty Hostname value) matches. For example, `\"foo.example.com\"` takes precedence over `\"*.example.com\"`, and `\"*.example.com\"` takes precedence over `\"\"`.\n\nAdditionally, if there are multiple wildcard entries, more specific wildcard entries must be processed before less specific wildcard entries. For example, `\"*.foo.example.com\"` takes precedence over `\"*.example.com\"`.\n\nThe precise definition here is that the higher the number of dots in the hostname to the right of the wildcard character, the higher the precedence.\n\nThe wildcard character will match any number of characters _and dots_ to the left, however, so `\"*.example.com\"` will match both `\"foo.bar.example.com\"` _and_ `\"bar.example.com\"`.\n\n## Handling indistinct Listeners\n\nIf a set of Listeners contains Listeners that are not distinct, then those Listeners are _Conflicted_, and the implementation MUST set the \"Conflicted\" condition in the Listener Status to \"True\".\n\nThe words \"indistinct\" and \"conflicted\" are considered equivalent for the purpose of this documentation.\n\nImplementations MAY choose to accept a Gateway with some Conflicted Listeners only if they only accept the partial Listener set that contains no Conflicted Listeners.\n\nSpecifically, an implementation MAY accept a partial Listener set subject to the following rules:\n\n* The implementation MUST NOT pick one conflicting Listener as the winner.\n ALL indistinct Listeners must not be accepted for processing.\n* At least one distinct Listener MUST be present, or else the Gateway effectively\n contains _no_ Listeners, and must be rejected from processing as a whole.\n\nThe implementation MUST set a \"ListenersNotValid\" condition on the Gateway Status when the Gateway contains Conflicted Listeners whether or not they accept the Gateway. That Condition SHOULD clearly indicate in the Message which Listeners are conflicted, and which are Accepted. Additionally, the Listener status for those listeners SHOULD indicate which Listeners are conflicted and not Accepted.\n\n## General Listener behavior\n\nNote that, for all distinct Listeners, requests SHOULD match at most one Listener. For example, if Listeners are defined for \"foo.example.com\" and \"*.example.com\", a request to \"foo.example.com\" SHOULD only be routed using routes attached to the \"foo.example.com\" Listener (and not the \"*.example.com\" Listener).\n\nThis concept is known as \"Listener Isolation\", and it is an Extended feature of Gateway API. Implementations that do not support Listener Isolation MUST clearly document this, and MUST NOT claim support for the `GatewayHTTPListenerIsolation` feature.\n\nImplementations that _do_ support Listener Isolation SHOULD claim support for the Extended `GatewayHTTPListenerIsolation` feature and pass the associated conformance tests.\n\n## Compatible Listeners\n\nA Gateway's Listeners are considered _compatible_ if:\n\n1. They are distinct. 2. The implementation can serve them in compliance with the Addresses\n requirement that all Listeners are available on all assigned\n addresses.\n\nCompatible combinations in Extended support are expected to vary across implementations. A combination that is compatible for one implementation may not be compatible for another.\n\nFor example, an implementation that cannot serve both TCP and UDP listeners on the same address, or cannot mix HTTPS and generic TLS listens on the same port would not consider those cases compatible, even though they are distinct.\n\nImplementations MAY merge separate Gateways onto a single set of Addresses if all Listeners across all Gateways are compatible.\n\nIn a future release the MinItems=1 requirement MAY be dropped.\n\nSupport: Core", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.Listener"), - }, - }, - }, - }, - }, - "addresses": { - SchemaProps: spec.SchemaProps{ - Description: "Addresses requested for this Gateway. This is optional and behavior can depend on the implementation. If a value is set in the spec and the requested address is invalid or unavailable, the implementation MUST indicate this in the associated entry in GatewayStatus.Addresses.\n\nThe Addresses field represents a request for the address(es) on the \"outside of the Gateway\", that traffic bound for this Gateway will use. This could be the IP address or hostname of an external load balancer or other networking infrastructure, or some other address that traffic will be sent to.\n\nIf no Addresses are specified, the implementation MAY schedule the Gateway in an implementation-specific manner, assigning an appropriate set of Addresses.\n\nThe implementation MUST bind all Listeners to every GatewayAddress that it assigns to the Gateway and add a corresponding entry in GatewayStatus.Addresses.\n\nSupport: Extended\n\n", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GatewayAddress"), - }, - }, - }, - }, - }, - "infrastructure": { - SchemaProps: spec.SchemaProps{ - Description: "Infrastructure defines infrastructure level attributes about this Gateway instance.\n\nSupport: Extended", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GatewayInfrastructure"), - }, - }, - "backendTLS": { - SchemaProps: spec.SchemaProps{ - Description: "BackendTLS configures TLS settings for when this Gateway is connecting to backends with TLS.\n\nSupport: Core\n\n", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GatewayBackendTLS"), - }, - }, - "allowedListeners": { - SchemaProps: spec.SchemaProps{ - Description: "AllowedListeners defines which ListenerSets can be attached to this Gateway. While this feature is experimental, the default value is to allow no ListenerSets.\n\n", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.AllowedListeners"), - }, - }, - }, - Required: []string{"gatewayClassName", "listeners"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.AllowedListeners", "sigs.k8s.io/gateway-api/apis/v1.GatewayAddress", "sigs.k8s.io/gateway-api/apis/v1.GatewayBackendTLS", "sigs.k8s.io/gateway-api/apis/v1.GatewayInfrastructure", "sigs.k8s.io/gateway-api/apis/v1.Listener"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_GatewayStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GatewayStatus defines the observed state of Gateway.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "addresses": { - SchemaProps: spec.SchemaProps{ - Description: "Addresses lists the network addresses that have been bound to the Gateway.\n\nThis list may differ from the addresses provided in the spec under some conditions:\n\n * no addresses are specified, all addresses are dynamically assigned\n * a combination of specified and dynamic addresses are assigned\n * a specified address was unusable (e.g. already in use)\n\n", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GatewayStatusAddress"), - }, - }, - }, - }, - }, - "conditions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "type", - }, - "x-kubernetes-list-type": "map", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Conditions describe the current conditions of the Gateway.\n\nImplementations should prefer to express Gateway conditions using the `GatewayConditionType` and `GatewayConditionReason` constants so that operators and tools can converge on a common vocabulary to describe Gateway state.\n\nKnown condition types are:\n\n* \"Accepted\" * \"Programmed\" * \"Ready\"", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), - }, - }, - }, - }, - }, - "listeners": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "name", - }, - "x-kubernetes-list-type": "map", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Listeners provide status for each unique listener port defined in the Spec.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.ListenerStatus"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Condition", "sigs.k8s.io/gateway-api/apis/v1.GatewayStatusAddress", "sigs.k8s.io/gateway-api/apis/v1.ListenerStatus"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_GatewayStatusAddress(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GatewayStatusAddress describes a network address that is bound to a Gateway.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type of the address.", - Type: []string{"string"}, - Format: "", - }, - }, - "value": { - SchemaProps: spec.SchemaProps{ - Description: "Value of the address. The validity of the values will depend on the type and support by the controller.\n\nExamples: `1.2.3.4`, `128::1`, `my-ip-address`.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"value"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_GatewayTLSConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "mode": { - SchemaProps: spec.SchemaProps{ - Description: "Mode defines the TLS behavior for the TLS session initiated by the client. There are two possible modes:\n\n- Terminate: The TLS session between the downstream client and the\n Gateway is terminated at the Gateway. This mode requires certificates\n to be specified in some way, such as populating the certificateRefs\n field.\n- Passthrough: The TLS session is NOT terminated by the Gateway. This\n implies that the Gateway can't decipher the TLS stream except for\n the ClientHello message of the TLS protocol. The certificateRefs field\n is ignored in this mode.\n\nSupport: Core", - Type: []string{"string"}, - Format: "", - }, - }, - "certificateRefs": { - SchemaProps: spec.SchemaProps{ - Description: "CertificateRefs contains a series of references to Kubernetes objects that contains TLS certificates and private keys. These certificates are used to establish a TLS handshake for requests that match the hostname of the associated listener.\n\nA single CertificateRef to a Kubernetes Secret has \"Core\" support. Implementations MAY choose to support attaching multiple certificates to a Listener, but this behavior is implementation-specific.\n\nReferences to a resource in different namespace are invalid UNLESS there is a ReferenceGrant in the target namespace that allows the certificate to be attached. If a ReferenceGrant does not allow this reference, the \"ResolvedRefs\" condition MUST be set to False for this listener with the \"RefNotPermitted\" reason.\n\nThis field is required to have at least one element when the mode is set to \"Terminate\" (default) and is optional otherwise.\n\nCertificateRefs can reference to standard Kubernetes resources, i.e. Secret, or implementation-specific custom resources.\n\nSupport: Core - A single reference to a Kubernetes Secret of type kubernetes.io/tls\n\nSupport: Implementation-specific (More than one reference or other resource types)", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.SecretObjectReference"), - }, - }, - }, - }, - }, - "frontendValidation": { - SchemaProps: spec.SchemaProps{ - Description: "FrontendValidation holds configuration information for validating the frontend (client). Setting this field will require clients to send a client certificate required for validation during the TLS handshake. In browsers this may result in a dialog appearing that requests a user to specify the client certificate. The maximum depth of a certificate chain accepted in verification is Implementation specific.\n\nSupport: Extended\n\n", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.FrontendTLSValidation"), - }, - }, - "options": { - SchemaProps: spec.SchemaProps{ - Description: "Options are a list of key/value pairs to enable extended TLS configuration for each implementation. For example, configuring the minimum TLS version or supported cipher suites.\n\nA set of common keys MAY be defined by the API in the future. To avoid any ambiguity, implementation-specific definitions MUST use domain-prefixed names, such as `example.com/my-custom-option`. Un-prefixed names are reserved for key names defined by Gateway API.\n\nSupport: Implementation-specific", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.FrontendTLSValidation", "sigs.k8s.io/gateway-api/apis/v1.SecretObjectReference"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_HTTPBackendRef(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPBackendRef defines how a HTTPRoute should forward an HTTP request.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Description: "Group is the group of the referent. For example, \"gateway.networking.k8s.io\". When unspecified or empty string, core API group is inferred.", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is the Kubernetes resource kind of the referent. For example \"Service\".\n\nDefaults to \"Service\" when not specified.\n\nExternalName services can refer to CNAME DNS records that may live outside of the cluster and as such are difficult to reason about in terms of conformance. They also may not be safe to forward to (see CVE-2021-25740 for more information). Implementations SHOULD NOT support ExternalName Services.\n\nSupport: Core (Services with a type other than ExternalName)\n\nSupport: Implementation-specific (Services with type ExternalName)", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the referent.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Description: "Namespace is the namespace of the backend. When unspecified, the local namespace is inferred.\n\nNote that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details.\n\nSupport: Core", - Type: []string{"string"}, - Format: "", - }, - }, - "port": { - SchemaProps: spec.SchemaProps{ - Description: "Port specifies the destination port number to use for this resource. Port is required when the referent is a Kubernetes Service. In this case, the port number is the service port number, not the target port. For other resources, destination port might be derived from the referent resource or this field.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "weight": { - SchemaProps: spec.SchemaProps{ - Description: "Weight specifies the proportion of requests forwarded to the referenced backend. This is computed as weight/(sum of all weights in this BackendRefs list). For non-zero values, there may be some epsilon from the exact proportion defined here depending on the precision an implementation supports. Weight is not a percentage and the sum of weights does not need to equal 100.\n\nIf only one backend is specified and it has a weight greater than 0, 100% of the traffic is forwarded to that backend. If weight is set to 0, no traffic should be forwarded for this entry. If unspecified, weight defaults to 1.\n\nSupport for this field varies based on the context where used.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "filters": { - SchemaProps: spec.SchemaProps{ - Description: "Filters defined at this level should be executed if and only if the request is being forwarded to the backend defined here.\n\nSupport: Implementation-specific (For broader support of filters, use the Filters field in HTTPRouteRule.)", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPRouteFilter"), - }, - }, - }, - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.HTTPRouteFilter"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_HTTPHeader(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPHeader represents an HTTP Header name and value as defined by RFC 7230.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the HTTP Header to be matched. Name matching MUST be case-insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).\n\nIf multiple entries specify equivalent header names, the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, \"foo\" and \"Foo\" are considered equivalent.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "value": { - SchemaProps: spec.SchemaProps{ - Description: "Value is the value of HTTP Header to be matched.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name", "value"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_HTTPHeaderFilter(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPHeaderFilter defines a filter that modifies the headers of an HTTP request or response.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "set": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "name", - }, - "x-kubernetes-list-type": "map", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Set overwrites the request with the given header (name, value) before the action.\n\nInput:\n GET /foo HTTP/1.1\n my-header: foo\n\nConfig:\n set:\n - name: \"my-header\"\n value: \"bar\"\n\nOutput:\n GET /foo HTTP/1.1\n my-header: bar", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPHeader"), - }, - }, - }, - }, - }, - "add": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "name", - }, - "x-kubernetes-list-type": "map", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Add adds the given header(s) (name, value) to the request before the action. It appends to any existing values associated with the header name.\n\nInput:\n GET /foo HTTP/1.1\n my-header: foo\n\nConfig:\n add:\n - name: \"my-header\"\n value: \"bar,baz\"\n\nOutput:\n GET /foo HTTP/1.1\n my-header: foo,bar,baz", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPHeader"), - }, - }, - }, - }, - }, - "remove": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "set", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Remove the given header(s) from the HTTP request before the action. The value of Remove is a list of HTTP header names. Note that the header names are case-insensitive (see https://datatracker.ietf.org/doc/html/rfc2616#section-4.2).\n\nInput:\n GET /foo HTTP/1.1\n my-header1: foo\n my-header2: bar\n my-header3: baz\n\nConfig:\n remove: [\"my-header1\", \"my-header3\"]\n\nOutput:\n GET /foo HTTP/1.1\n my-header2: bar", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.HTTPHeader"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_HTTPHeaderMatch(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPHeaderMatch describes how to select a HTTP route by matching HTTP request headers.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type specifies how to match against the value of the header.\n\nSupport: Core (Exact)\n\nSupport: Implementation-specific (RegularExpression)\n\nSince RegularExpression HeaderMatchType has implementation-specific conformance, implementations can support POSIX, PCRE or any other dialects of regular expressions. Please read the implementation's documentation to determine the supported dialect.", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the HTTP Header to be matched. Name matching MUST be case-insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).\n\nIf multiple entries specify equivalent header names, only the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent header name MUST be ignored. Due to the case-insensitivity of header names, \"foo\" and \"Foo\" are considered equivalent.\n\nWhen a header is repeated in an HTTP request, it is implementation-specific behavior as to how this is represented. Generally, proxies should follow the guidance from the RFC: https://www.rfc-editor.org/rfc/rfc7230.html#section-3.2.2 regarding processing a repeated header, with special handling for \"Set-Cookie\".", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "value": { - SchemaProps: spec.SchemaProps{ - Description: "Value is the value of HTTP Header to be matched.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name", "value"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_HTTPPathMatch(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPPathMatch describes how to select a HTTP route by matching the HTTP request path.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type specifies how to match against the path Value.\n\nSupport: Core (Exact, PathPrefix)\n\nSupport: Implementation-specific (RegularExpression)", - Type: []string{"string"}, - Format: "", - }, - }, - "value": { - SchemaProps: spec.SchemaProps{ - Description: "Value of the HTTP path to match against.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_HTTPPathModifier(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPPathModifier defines configuration for path modifiers. ", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type defines the type of path modifier. Additional types may be added in a future release of the API.\n\nNote that values may be added to this enum, implementations must ensure that unknown values will not cause a crash.\n\nUnknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "replaceFullPath": { - SchemaProps: spec.SchemaProps{ - Description: "ReplaceFullPath specifies the value with which to replace the full path of a request during a rewrite or redirect.", - Type: []string{"string"}, - Format: "", - }, - }, - "replacePrefixMatch": { - SchemaProps: spec.SchemaProps{ - Description: "ReplacePrefixMatch specifies the value with which to replace the prefix match of a request during a rewrite or redirect. For example, a request to \"/foo/bar\" with a prefix match of \"/foo\" and a ReplacePrefixMatch of \"/xyz\" would be modified to \"/xyz/bar\".\n\nNote that this matches the behavior of the PathPrefix match type. This matches full path elements. A path element refers to the list of labels in the path split by the `/` separator. When specified, a trailing `/` is ignored. For example, the paths `/abc`, `/abc/`, and `/abc/def` would all match the prefix `/abc`, but the path `/abcd` would not.\n\nReplacePrefixMatch is only compatible with a `PathPrefix` HTTPRouteMatch. Using any other HTTPRouteMatch type on the same HTTPRouteRule will result in the implementation setting the Accepted Condition for the Route to `status: False`.\n\nRequest Path | Prefix Match | Replace Prefix | Modified Path -------------|--------------|----------------|---------- /foo/bar | /foo | /xyz | /xyz/bar /foo/bar | /foo | /xyz/ | /xyz/bar /foo/bar | /foo/ | /xyz | /xyz/bar /foo/bar | /foo/ | /xyz/ | /xyz/bar /foo | /foo | /xyz | /xyz /foo/ | /foo | /xyz | /xyz/ /foo/bar | /foo | | /bar /foo/ | /foo | | / /foo | /foo | | / /foo/ | /foo | / | / /foo | /foo | / | /", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_HTTPQueryParamMatch(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPQueryParamMatch describes how to select a HTTP route by matching HTTP query parameters.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type specifies how to match against the value of the query parameter.\n\nSupport: Extended (Exact)\n\nSupport: Implementation-specific (RegularExpression)\n\nSince RegularExpression QueryParamMatchType has Implementation-specific conformance, implementations can support POSIX, PCRE or any other dialects of regular expressions. Please read the implementation's documentation to determine the supported dialect.", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the HTTP query param to be matched. This must be an exact string match. (See https://tools.ietf.org/html/rfc7230#section-2.7.3).\n\nIf multiple entries specify equivalent query param names, only the first entry with an equivalent name MUST be considered for a match. Subsequent entries with an equivalent query param name MUST be ignored.\n\nIf a query param is repeated in an HTTP request, the behavior is purposely left undefined, since different data planes have different capabilities. However, it is *recommended* that implementations should match against the first value of the param if the data plane supports it, as this behavior is expected in other load balancing contexts outside of the Gateway API.\n\nUsers SHOULD NOT route traffic based on repeated query params to guard themselves against potential differences in the implementations.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "value": { - SchemaProps: spec.SchemaProps{ - Description: "Value is the value of HTTP query param to be matched.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name", "value"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_HTTPRequestMirrorFilter(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPRequestMirrorFilter defines configuration for the RequestMirror filter.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "backendRef": { - SchemaProps: spec.SchemaProps{ - Description: "BackendRef references a resource where mirrored requests are sent.\n\nMirrored requests must be sent only to a single destination endpoint within this BackendRef, irrespective of how many endpoints are present within this BackendRef.\n\nIf the referent cannot be found, this BackendRef is invalid and must be dropped from the Gateway. The controller must ensure the \"ResolvedRefs\" condition on the Route status is set to `status: False` and not configure this backend in the underlying implementation.\n\nIf there is a cross-namespace reference to an *existing* object that is not allowed by a ReferenceGrant, the controller must ensure the \"ResolvedRefs\" condition on the Route is set to `status: False`, with the \"RefNotPermitted\" reason and not configure this backend in the underlying implementation.\n\nIn either error case, the Message of the `ResolvedRefs` Condition should be used to provide more detail about the problem.\n\nSupport: Extended for Kubernetes Service\n\nSupport: Implementation-specific for any other resource", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.BackendObjectReference"), - }, - }, - "percent": { - SchemaProps: spec.SchemaProps{ - Description: "Percent represents the percentage of requests that should be mirrored to BackendRef. Its minimum value is 0 (indicating 0% of requests) and its maximum value is 100 (indicating 100% of requests).\n\nOnly one of Fraction or Percent may be specified. If neither field is specified, 100% of requests will be mirrored.\n\n", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "fraction": { - SchemaProps: spec.SchemaProps{ - Description: "Fraction represents the fraction of requests that should be mirrored to BackendRef.\n\nOnly one of Fraction or Percent may be specified. If neither field is specified, 100% of requests will be mirrored.\n\n", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.Fraction"), - }, - }, - }, - Required: []string{"backendRef"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.BackendObjectReference", "sigs.k8s.io/gateway-api/apis/v1.Fraction"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_HTTPRequestRedirectFilter(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPRequestRedirect defines a filter that redirects a request. This filter MUST NOT be used on the same Route rule as a HTTPURLRewrite filter.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "scheme": { - SchemaProps: spec.SchemaProps{ - Description: "Scheme is the scheme to be used in the value of the `Location` header in the response. When empty, the scheme of the request is used.\n\nScheme redirects can affect the port of the redirect, for more information, refer to the documentation for the port field of this filter.\n\nNote that values may be added to this enum, implementations must ensure that unknown values will not cause a crash.\n\nUnknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`.\n\nSupport: Extended", - Type: []string{"string"}, - Format: "", - }, - }, - "hostname": { - SchemaProps: spec.SchemaProps{ - Description: "Hostname is the hostname to be used in the value of the `Location` header in the response. When empty, the hostname in the `Host` header of the request is used.\n\nSupport: Core", - Type: []string{"string"}, - Format: "", - }, - }, - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Path defines parameters used to modify the path of the incoming request. The modified path is then used to construct the `Location` header. When empty, the request path is used as-is.\n\nSupport: Extended", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPPathModifier"), - }, - }, - "port": { - SchemaProps: spec.SchemaProps{ - Description: "Port is the port to be used in the value of the `Location` header in the response.\n\nIf no port is specified, the redirect port MUST be derived using the following rules:\n\n* If redirect scheme is not-empty, the redirect port MUST be the well-known\n port associated with the redirect scheme. Specifically \"http\" to port 80\n and \"https\" to port 443. If the redirect scheme does not have a\n well-known port, the listener port of the Gateway SHOULD be used.\n* If redirect scheme is empty, the redirect port MUST be the Gateway\n Listener port.\n\nImplementations SHOULD NOT add the port number in the 'Location' header in the following cases:\n\n* A Location header that will use HTTP (whether that is determined via\n the Listener protocol or the Scheme field) _and_ use port 80.\n* A Location header that will use HTTPS (whether that is determined via\n the Listener protocol or the Scheme field) _and_ use port 443.\n\nSupport: Extended", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "statusCode": { - SchemaProps: spec.SchemaProps{ - Description: "StatusCode is the HTTP status code to be used in response.\n\nNote that values may be added to this enum, implementations must ensure that unknown values will not cause a crash.\n\nUnknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`.\n\nSupport: Core", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.HTTPPathModifier"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_HTTPRoute(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPRoute provides a way to route HTTP requests. This includes the capability to match requests by hostname, path, header, or query param. Filters can be used to specify additional processing steps. Backends specify where matching requests should be routed.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the desired state of HTTPRoute.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPRouteSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status defines the current state of HTTPRoute.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPRouteStatus"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/gateway-api/apis/v1.HTTPRouteSpec", "sigs.k8s.io/gateway-api/apis/v1.HTTPRouteStatus"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_HTTPRouteFilter(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPRouteFilter defines processing steps that must be completed during the request or response lifecycle. HTTPRouteFilters are meant as an extension point to express processing that may be done in Gateway implementations. Some examples include request or response modification, implementing authentication strategies, rate-limiting, and traffic shaping. API guarantee/conformance is defined based on the type of the filter.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type identifies the type of filter to apply. As with other API fields, types are classified into three conformance levels:\n\n- Core: Filter types and their corresponding configuration defined by\n \"Support: Core\" in this package, e.g. \"RequestHeaderModifier\". All\n implementations must support core filters.\n\n- Extended: Filter types and their corresponding configuration defined by\n \"Support: Extended\" in this package, e.g. \"RequestMirror\". Implementers\n are encouraged to support extended filters.\n\n- Implementation-specific: Filters that are defined and supported by\n specific vendors.\n In the future, filters showing convergence in behavior across multiple\n implementations will be considered for inclusion in extended or core\n conformance levels. Filter-specific configuration for such filters\n is specified using the ExtensionRef field. `Type` should be set to\n \"ExtensionRef\" for custom filters.\n\nImplementers are encouraged to define custom implementation types to extend the core API with implementation-specific behavior.\n\nIf a reference to a custom filter type cannot be resolved, the filter MUST NOT be skipped. Instead, requests that would have been processed by that filter MUST receive a HTTP error response.\n\nNote that values may be added to this enum, implementations must ensure that unknown values will not cause a crash.\n\nUnknown values here must result in the implementation setting the Accepted Condition for the Route to `status: False`, with a Reason of `UnsupportedValue`.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "requestHeaderModifier": { - SchemaProps: spec.SchemaProps{ - Description: "RequestHeaderModifier defines a schema for a filter that modifies request headers.\n\nSupport: Core", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPHeaderFilter"), - }, - }, - "responseHeaderModifier": { - SchemaProps: spec.SchemaProps{ - Description: "ResponseHeaderModifier defines a schema for a filter that modifies response headers.\n\nSupport: Extended", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPHeaderFilter"), - }, - }, - "requestMirror": { - SchemaProps: spec.SchemaProps{ - Description: "RequestMirror defines a schema for a filter that mirrors requests. Requests are sent to the specified destination, but responses from that destination are ignored.\n\nThis filter can be used multiple times within the same rule. Note that not all implementations will be able to support mirroring to multiple backends.\n\nSupport: Extended\n\n\n", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPRequestMirrorFilter"), - }, - }, - "requestRedirect": { - SchemaProps: spec.SchemaProps{ - Description: "RequestRedirect defines a schema for a filter that responds to the request with an HTTP redirection.\n\nSupport: Core", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPRequestRedirectFilter"), - }, - }, - "urlRewrite": { - SchemaProps: spec.SchemaProps{ - Description: "URLRewrite defines a schema for a filter that modifies a request during forwarding.\n\nSupport: Extended", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPURLRewriteFilter"), - }, - }, - "extensionRef": { - SchemaProps: spec.SchemaProps{ - Description: "ExtensionRef is an optional, implementation-specific extension to the \"filter\" behavior. For example, resource \"myroutefilter\" in group \"networking.example.net\"). ExtensionRef MUST NOT be used for core and extended filters.\n\nThis filter can be used multiple times within the same rule.\n\nSupport: Implementation-specific", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.LocalObjectReference"), - }, - }, - }, - Required: []string{"type"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.HTTPHeaderFilter", "sigs.k8s.io/gateway-api/apis/v1.HTTPRequestMirrorFilter", "sigs.k8s.io/gateway-api/apis/v1.HTTPRequestRedirectFilter", "sigs.k8s.io/gateway-api/apis/v1.HTTPURLRewriteFilter", "sigs.k8s.io/gateway-api/apis/v1.LocalObjectReference"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_HTTPRouteList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPRouteList contains a list of HTTPRoute.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPRoute"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/gateway-api/apis/v1.HTTPRoute"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_HTTPRouteMatch(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPRouteMatch defines the predicate used to match requests to a given action. Multiple match types are ANDed together, i.e. the match will evaluate to true only if all conditions are satisfied.\n\nFor example, the match below will match a HTTP request only if its path starts with `/foo` AND it contains the `version: v1` header:\n\n``` match:\n\n\tpath:\n\t value: \"/foo\"\n\theaders:\n\t- name: \"version\"\n\t value \"v1\"\n\n```", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Path specifies a HTTP request path matcher. If this field is not specified, a default prefix match on the \"/\" path is provided.", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPPathMatch"), - }, - }, - "headers": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "name", - }, - "x-kubernetes-list-type": "map", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Headers specifies HTTP request header matchers. Multiple match values are ANDed together, meaning, a request must match all the specified headers to select the route.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPHeaderMatch"), - }, - }, - }, - }, - }, - "queryParams": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "name", - }, - "x-kubernetes-list-type": "map", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "QueryParams specifies HTTP query parameter matchers. Multiple match values are ANDed together, meaning, a request must match all the specified query parameters to select the route.\n\nSupport: Extended", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPQueryParamMatch"), - }, - }, - }, - }, - }, - "method": { - SchemaProps: spec.SchemaProps{ - Description: "Method specifies HTTP method matcher. When specified, this route will be matched only if the request has the specified method.\n\nSupport: Extended", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.HTTPHeaderMatch", "sigs.k8s.io/gateway-api/apis/v1.HTTPPathMatch", "sigs.k8s.io/gateway-api/apis/v1.HTTPQueryParamMatch"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_HTTPRouteRetry(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPRouteRetry defines retry configuration for an HTTPRoute.\n\nImplementations SHOULD retry on connection errors (disconnect, reset, timeout, TCP failure) if a retry stanza is configured.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "codes": { - SchemaProps: spec.SchemaProps{ - Description: "Codes defines the HTTP response status codes for which a backend request should be retried.\n\nSupport: Extended", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: 0, - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - "attempts": { - SchemaProps: spec.SchemaProps{ - Description: "Attempts specifies the maximum number of times an individual request from the gateway to a backend should be retried.\n\nIf the maximum number of retries has been attempted without a successful response from the backend, the Gateway MUST return an error.\n\nWhen this field is unspecified, the number of times to attempt to retry a backend request is implementation-specific.\n\nSupport: Extended", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "backoff": { - SchemaProps: spec.SchemaProps{ - Description: "Backoff specifies the minimum duration a Gateway should wait between retry attempts and is represented in Gateway API Duration formatting.\n\nFor example, setting the `rules[].retry.backoff` field to the value `100ms` will cause a backend request to first be retried approximately 100 milliseconds after timing out or receiving a response code configured to be retryable.\n\nAn implementation MAY use an exponential or alternative backoff strategy for subsequent retry attempts, MAY cap the maximum backoff duration to some amount greater than the specified minimum, and MAY add arbitrary jitter to stagger requests, as long as unsuccessful backend requests are not retried before the configured minimum duration.\n\nIf a Request timeout (`rules[].timeouts.request`) is configured on the route, the entire duration of the initial request and any retry attempts MUST not exceed the Request timeout duration. If any retry attempts are still in progress when the Request timeout duration has been reached, these SHOULD be canceled if possible and the Gateway MUST immediately return a timeout error.\n\nIf a BackendRequest timeout (`rules[].timeouts.backendRequest`) is configured on the route, any retry attempts which reach the configured BackendRequest timeout duration without a response SHOULD be canceled if possible and the Gateway should wait for at least the specified backoff duration before attempting to retry the backend request again.\n\nIf a BackendRequest timeout is _not_ configured on the route, retry attempts MAY time out after an implementation default duration, or MAY remain pending until a configured Request timeout or implementation default duration for total request time is reached.\n\nWhen this field is unspecified, the time to wait between retry attempts is implementation-specific.\n\nSupport: Extended", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_HTTPRouteRule(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPRouteRule defines semantics for matching an HTTP request based on conditions (matches), processing it (filters), and forwarding the request to an API object (backendRefs).", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the route rule. This name MUST be unique within a Route if it is set.\n\nSupport: Extended ", - Type: []string{"string"}, - Format: "", - }, - }, - "matches": { - SchemaProps: spec.SchemaProps{ - Description: "Matches define conditions used for matching the rule against incoming HTTP requests. Each match is independent, i.e. this rule will be matched if **any** one of the matches is satisfied.\n\nFor example, take the following matches configuration:\n\n``` matches: - path:\n value: \"/foo\"\n headers:\n - name: \"version\"\n value: \"v2\"\n- path:\n value: \"/v2/foo\"\n```\n\nFor a request to match against this rule, a request must satisfy EITHER of the two conditions:\n\n- path prefixed with `/foo` AND contains the header `version: v2` - path prefix of `/v2/foo`\n\nSee the documentation for HTTPRouteMatch on how to specify multiple match conditions that should be ANDed together.\n\nIf no matches are specified, the default is a prefix path match on \"/\", which has the effect of matching every HTTP request.\n\nProxy or Load Balancer routing configuration generated from HTTPRoutes MUST prioritize matches based on the following criteria, continuing on ties. Across all rules specified on applicable Routes, precedence must be given to the match having:\n\n* \"Exact\" path match. * \"Prefix\" path match with largest number of characters. * Method match. * Largest number of header matches. * Largest number of query param matches.\n\nNote: The precedence of RegularExpression path matches are implementation-specific.\n\nIf ties still exist across multiple Routes, matching precedence MUST be determined in order of the following criteria, continuing on ties:\n\n* The oldest Route based on creation timestamp. * The Route appearing first in alphabetical order by\n \"{namespace}/{name}\".\n\nIf ties still exist within an HTTPRoute, matching precedence MUST be granted to the FIRST matching rule (in list order) with a match meeting the above criteria.\n\nWhen no rules matching a request have been successfully attached to the parent a request is coming from, a HTTP 404 status code MUST be returned.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPRouteMatch"), - }, - }, - }, - }, - }, - "filters": { - SchemaProps: spec.SchemaProps{ - Description: "Filters define the filters that are applied to requests that match this rule.\n\nWherever possible, implementations SHOULD implement filters in the order they are specified.\n\nImplementations MAY choose to implement this ordering strictly, rejecting any combination or order of filters that cannot be supported. If implementations choose a strict interpretation of filter ordering, they MUST clearly document that behavior.\n\nTo reject an invalid combination or order of filters, implementations SHOULD consider the Route Rules with this configuration invalid. If all Route Rules in a Route are invalid, the entire Route would be considered invalid. If only a portion of Route Rules are invalid, implementations MUST set the \"PartiallyInvalid\" condition for the Route.\n\nConformance-levels at this level are defined based on the type of filter:\n\n- ALL core filters MUST be supported by all implementations. - Implementers are encouraged to support extended filters. - Implementation-specific custom filters have no API guarantees across\n implementations.\n\nSpecifying the same filter multiple times is not supported unless explicitly indicated in the filter.\n\nAll filters are expected to be compatible with each other except for the URLRewrite and RequestRedirect filters, which may not be combined. If an implementation cannot support other combinations of filters, they must clearly document that limitation. In cases where incompatible or unsupported filters are specified and cause the `Accepted` condition to be set to status `False`, implementations may use the `IncompatibleFilters` reason to specify this configuration error.\n\nSupport: Core", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPRouteFilter"), - }, - }, - }, - }, - }, - "backendRefs": { - SchemaProps: spec.SchemaProps{ - Description: "BackendRefs defines the backend(s) where matching requests should be sent.\n\nFailure behavior here depends on how many BackendRefs are specified and how many are invalid.\n\nIf *all* entries in BackendRefs are invalid, and there are also no filters specified in this route rule, *all* traffic which matches this rule MUST receive a 500 status code.\n\nSee the HTTPBackendRef definition for the rules about what makes a single HTTPBackendRef invalid.\n\nWhen a HTTPBackendRef is invalid, 500 status codes MUST be returned for requests that would have otherwise been routed to an invalid backend. If multiple backends are specified, and some are invalid, the proportion of requests that would otherwise have been routed to an invalid backend MUST receive a 500 status code.\n\nFor example, if two backends are specified with equal weights, and one is invalid, 50 percent of traffic must receive a 500. Implementations may choose how that 50 percent is determined.\n\nWhen a HTTPBackendRef refers to a Service that has no ready endpoints, implementations SHOULD return a 503 for requests to that backend instead. If an implementation chooses to do this, all of the above rules for 500 responses MUST also apply for responses that return a 503.\n\nSupport: Core for Kubernetes Service\n\nSupport: Extended for Kubernetes ServiceImport\n\nSupport: Implementation-specific for any other resource\n\nSupport for weight: Core", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPBackendRef"), - }, - }, - }, - }, - }, - "timeouts": { - SchemaProps: spec.SchemaProps{ - Description: "Timeouts defines the timeouts that can be configured for an HTTP request.\n\nSupport: Extended", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPRouteTimeouts"), - }, - }, - "retry": { - SchemaProps: spec.SchemaProps{ - Description: "Retry defines the configuration for when to retry an HTTP request.\n\nSupport: Extended\n\n", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPRouteRetry"), - }, - }, - "sessionPersistence": { - SchemaProps: spec.SchemaProps{ - Description: "SessionPersistence defines and configures session persistence for the route rule.\n\nSupport: Extended\n\n", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.SessionPersistence"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.HTTPBackendRef", "sigs.k8s.io/gateway-api/apis/v1.HTTPRouteFilter", "sigs.k8s.io/gateway-api/apis/v1.HTTPRouteMatch", "sigs.k8s.io/gateway-api/apis/v1.HTTPRouteRetry", "sigs.k8s.io/gateway-api/apis/v1.HTTPRouteTimeouts", "sigs.k8s.io/gateway-api/apis/v1.SessionPersistence"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_HTTPRouteSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPRouteSpec defines the desired state of HTTPRoute", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "parentRefs": { - SchemaProps: spec.SchemaProps{ - Description: "ParentRefs references the resources (usually Gateways) that a Route wants to be attached to. Note that the referenced parent resource needs to allow this for the attachment to be complete. For Gateways, that means the Gateway needs to allow attachment from Routes of this kind and namespace. For Services, that means the Service must either be in the same namespace for a \"producer\" route, or the mesh implementation must support and allow \"consumer\" routes for the referenced Service. ReferenceGrant is not applicable for governing ParentRefs to Services - it is not possible to create a \"producer\" route for a Service in a different namespace from the Route.\n\nThere are two kinds of parent resources with \"Core\" support:\n\n* Gateway (Gateway conformance profile) * Service (Mesh conformance profile, ClusterIP Services only)\n\nThis API may be extended in the future to support additional kinds of parent resources.\n\nParentRefs must be _distinct_. This means either that:\n\n* They select different objects. If this is the case, then parentRef\n entries are distinct. In terms of fields, this means that the\n multi-part key defined by `group`, `kind`, `namespace`, and `name` must\n be unique across all parentRef entries in the Route.\n* They do not select different objects, but for each optional field used,\n each ParentRef that selects the same object must set the same set of\n optional fields to different values. If one ParentRef sets a\n combination of optional fields, all must set the same combination.\n\nSome examples:\n\n* If one ParentRef sets `sectionName`, all ParentRefs referencing the\n same object must also set `sectionName`.\n* If one ParentRef sets `port`, all ParentRefs referencing the same\n object must also set `port`.\n* If one ParentRef sets `sectionName` and `port`, all ParentRefs\n referencing the same object must also set `sectionName` and `port`.\n\nIt is possible to separately reference multiple distinct objects that may be collapsed by an implementation. For example, some implementations may choose to merge compatible Gateway Listeners together. If that is the case, the list of routes attached to those resources should also be merged.\n\nNote that for ParentRefs that cross namespace boundaries, there are specific rules. 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 other kinds of cross-namespace reference.\n\n 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.\n\nParentRefs 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 the intended destination of the connections are a Service targeted as a ParentRef of the Route. \n\n ", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.ParentReference"), - }, - }, - }, - }, - }, - "hostnames": { - SchemaProps: spec.SchemaProps{ - Description: "Hostnames defines a set of hostnames that should match against the HTTP Host header to select a HTTPRoute used to process the request. Implementations MUST ignore any port value specified in the HTTP Host header while performing a match and (absent of any applicable header modification configuration) MUST forward this header unmodified to the backend.\n\nValid values for Hostnames are determined by RFC 1123 definition of a hostname with 2 notable exceptions:\n\n1. IPs are not allowed. 2. A hostname may be prefixed with a wildcard label (`*.`). The wildcard\n label must appear by itself as the first label.\n\nIf a hostname is specified by both the Listener and HTTPRoute, there must be at least one intersecting hostname for the HTTPRoute to be attached to the Listener. For example:\n\n* A Listener with `test.example.com` as the hostname matches HTTPRoutes\n that have either not specified any hostnames, or have specified at\n least one of `test.example.com` or `*.example.com`.\n* A Listener with `*.example.com` as the hostname matches HTTPRoutes\n that have either not specified any hostnames or have specified at least\n one hostname that matches the Listener hostname. For example,\n `*.example.com`, `test.example.com`, and `foo.test.example.com` would\n all match. On the other hand, `example.com` and `test.example.net` would\n not match.\n\nHostnames that are prefixed with a wildcard label (`*.`) are interpreted as a suffix match. That means that a match for `*.example.com` would match both `test.example.com`, and `foo.test.example.com`, but not `example.com`.\n\nIf both the Listener and HTTPRoute have specified hostnames, any HTTPRoute hostnames that do not match the Listener hostname MUST be ignored. For example, if a Listener specified `*.example.com`, and the HTTPRoute specified `test.example.com` and `test.example.net`, `test.example.net` must not be considered for a match.\n\nIf both the Listener and HTTPRoute have specified hostnames, and none match with the criteria above, then the HTTPRoute is not accepted. The implementation must raise an 'Accepted' Condition with a status of `False` in the corresponding RouteParentStatus.\n\nIn the event that multiple HTTPRoutes specify intersecting hostnames (e.g. overlapping wildcard matching and exact matching hostnames), precedence must be given to rules from the HTTPRoute with the largest number of:\n\n* Characters in a matching non-wildcard hostname. * Characters in a matching hostname.\n\nIf ties exist across multiple Routes, the matching precedence rules for HTTPRouteMatches takes over.\n\nSupport: Core", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "rules": { - SchemaProps: spec.SchemaProps{ - Description: "Rules are a list of HTTP matchers, filters and actions.\n\n", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPRouteRule"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.HTTPRouteRule", "sigs.k8s.io/gateway-api/apis/v1.ParentReference"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_HTTPRouteStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPRouteStatus defines the observed state of HTTPRoute.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "parents": { - SchemaProps: spec.SchemaProps{ - Description: "Parents is a list of parent resources (usually Gateways) that are associated with the route, and the status of the route with respect to each parent. When this route attaches to a parent, the controller that manages the parent must add an entry to this list when the controller first sees the route and should update the entry as appropriate when the route or gateway is modified.\n\nNote that parent references that cannot be resolved by an implementation of this API will not be added to this list. Implementations of this API can only populate Route status for the Gateways/parent resources they are responsible for.\n\nA maximum of 32 Gateways will be represented in this list. An empty list means the route has not been attached to any Gateway.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.RouteParentStatus"), - }, - }, - }, - }, - }, - }, - Required: []string{"parents"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.RouteParentStatus"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_HTTPRouteTimeouts(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPRouteTimeouts defines timeouts that can be configured for an HTTPRoute.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "request": { - SchemaProps: spec.SchemaProps{ - Description: "Request specifies the maximum duration for a gateway to respond to an HTTP request. If the gateway has not been able to respond before this deadline is met, the gateway MUST return a timeout error.\n\nFor example, setting the `rules.timeouts.request` field to the value `10s` in an `HTTPRoute` will cause a timeout if a client request is taking longer than 10 seconds to complete.\n\nSetting a timeout to the zero duration (e.g. \"0s\") SHOULD disable the timeout completely. Implementations that cannot completely disable the timeout MUST instead interpret the zero duration as the longest possible value to which the timeout can be set.\n\nThis timeout is intended to cover as close to the whole request-response transaction as possible although an implementation MAY choose to start the timeout after the entire request stream has been received instead of immediately after the transaction is initiated by the client.\n\nThe value of Request is a Gateway API Duration string as defined by GEP-2257. When this field is unspecified, request timeout behavior is implementation-specific.\n\nSupport: Extended", - Type: []string{"string"}, - Format: "", - }, - }, - "backendRequest": { - SchemaProps: spec.SchemaProps{ - Description: "BackendRequest specifies a timeout for an individual request from the gateway to a backend. This covers the time from when the request first starts being sent from the gateway to when the full response has been received from the backend.\n\nSetting a timeout to the zero duration (e.g. \"0s\") SHOULD disable the timeout completely. Implementations that cannot completely disable the timeout MUST instead interpret the zero duration as the longest possible value to which the timeout can be set.\n\nAn entire client HTTP transaction with a gateway, covered by the Request timeout, may result in more than one call from the gateway to the destination backend, for example, if automatic retries are supported.\n\nThe value of BackendRequest must be a Gateway API Duration string as defined by GEP-2257. When this field is unspecified, its behavior is implementation-specific; when specified, the value of BackendRequest must be no more than the value of the Request timeout (since the Request timeout encompasses the BackendRequest timeout).\n\nSupport: Extended", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_HTTPURLRewriteFilter(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPURLRewriteFilter defines a filter that modifies a request during forwarding. At most one of these filters may be used on a Route rule. This MUST NOT be used on the same Route rule as a HTTPRequestRedirect filter.\n\nSupport: Extended\n\n", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "hostname": { - SchemaProps: spec.SchemaProps{ - Description: "Hostname is the value to be used to replace the Host header value during forwarding.\n\nSupport: Extended", - Type: []string{"string"}, - Format: "", - }, - }, - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Path defines a path rewrite.\n\nSupport: Extended", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPPathModifier"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.HTTPPathModifier"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_Listener(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Listener embodies the concept of a logical endpoint where a Gateway accepts network connections.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the Listener. This name MUST be unique within a Gateway.\n\nSupport: Core", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "hostname": { - SchemaProps: spec.SchemaProps{ - Description: "Hostname specifies the virtual hostname to match for protocol types that define this concept. When unspecified, all hostnames are matched. This field is ignored for protocols that don't require hostname based matching.\n\nImplementations MUST apply Hostname matching appropriately for each of the following protocols:\n\n* TLS: The Listener Hostname MUST match the SNI. * HTTP: The Listener Hostname MUST match the Host header of the request. * HTTPS: The Listener Hostname SHOULD match both the SNI and Host header.\n Note that this does not require the SNI and Host header to be the same.\n The semantics of this are described in more detail below.\n\nTo ensure security, Section 11.1 of RFC-6066 emphasizes that server implementations that rely on SNI hostname matching MUST also verify hostnames within the application protocol.\n\nSection 9.1.2 of RFC-7540 provides a mechanism for servers to reject the reuse of a connection by responding with the HTTP 421 Misdirected Request status code. This indicates that the origin server has rejected the request because it appears to have been misdirected.\n\nTo detect misdirected requests, Gateways SHOULD match the authority of the requests with all the SNI hostname(s) configured across all the Gateway Listeners on the same port and protocol:\n\n* If another Listener has an exact match or more specific wildcard entry,\n the Gateway SHOULD return a 421.\n* If the current Listener (selected by SNI matching during ClientHello)\n does not match the Host:\n * If another Listener does match the Host the Gateway SHOULD return a\n 421.\n * If no other Listener matches the Host, the Gateway MUST return a\n 404.\n\nFor HTTPRoute and TLSRoute resources, there is an interaction with the `spec.hostnames` array. When both listener and route specify hostnames, there MUST be an intersection between the values for a Route to be accepted. For more information, refer to the Route specific Hostnames documentation.\n\nHostnames that are prefixed with a wildcard label (`*.`) are interpreted as a suffix match. That means that a match for `*.example.com` would match both `test.example.com`, and `foo.test.example.com`, but not `example.com`.\n\nSupport: Core", - Type: []string{"string"}, - Format: "", - }, - }, - "port": { - SchemaProps: spec.SchemaProps{ - Description: "Port is the network port. Multiple listeners may use the same port, subject to the Listener compatibility rules.\n\nSupport: Core", - Default: 0, - Type: []string{"integer"}, - Format: "int32", - }, - }, - "protocol": { - SchemaProps: spec.SchemaProps{ - Description: "Protocol specifies the network protocol this listener expects to receive.\n\nSupport: Core", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "tls": { - SchemaProps: spec.SchemaProps{ - Description: "TLS is the TLS configuration for the Listener. This field is required if the Protocol field is \"HTTPS\" or \"TLS\". It is invalid to set this field if the Protocol field is \"HTTP\", \"TCP\", or \"UDP\".\n\nThe association of SNIs to Certificate defined in GatewayTLSConfig is defined based on the Hostname field for this listener.\n\nThe GatewayClass MUST use the longest matching SNI out of all available certificates for any TLS handshake.\n\nSupport: Core", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GatewayTLSConfig"), - }, - }, - "allowedRoutes": { - SchemaProps: spec.SchemaProps{ - Description: "AllowedRoutes defines the types of routes that MAY be attached to a Listener and the trusted namespaces where those Route resources MAY be present.\n\nAlthough a client request may match multiple route rules, only one rule may ultimately receive the request. Matching precedence MUST be determined in order of the following criteria:\n\n* The most specific match as defined by the Route type. * The oldest Route based on creation timestamp. For example, a Route with\n a creation timestamp of \"2020-09-08 01:02:03\" is given precedence over\n a Route with a creation timestamp of \"2020-09-08 01:02:04\".\n* If everything else is equivalent, the Route appearing first in\n alphabetical order (namespace/name) should be given precedence. For\n example, foo/bar is given precedence over foo/baz.\n\nAll valid rules within a Route attached to this Listener should be implemented. Invalid Route rules can be ignored (sometimes that will mean the full Route). If a Route rule transitions from valid to invalid, support for that Route rule should be dropped to ensure consistency. For example, even if a filter specified by a Route rule is invalid, the rest of the rules within that Route should still be supported.\n\nSupport: Core", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.AllowedRoutes"), - }, - }, - }, - Required: []string{"name", "port", "protocol"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.AllowedRoutes", "sigs.k8s.io/gateway-api/apis/v1.GatewayTLSConfig"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_ListenerNamespaces(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ListenerNamespaces indicate which namespaces ListenerSets should be selected from.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "from": { - SchemaProps: spec.SchemaProps{ - Description: "From indicates where ListenerSets can attach to this Gateway. Possible values are:\n\n* Same: Only ListenerSets in the same namespace may be attached to this Gateway. * None: Only listeners defined in the Gateway's spec are allowed\n\nWhile this feature is experimental, the default value None", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_ListenerStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ListenerStatus is the status associated with a Listener.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the Listener that this status corresponds to.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "supportedKinds": { - SchemaProps: spec.SchemaProps{ - Description: "SupportedKinds is the list indicating the Kinds supported by this listener. This MUST represent the kinds an implementation supports for that Listener configuration.\n\nIf kinds are specified in Spec that are not supported, they MUST NOT appear in this list and an implementation MUST set the \"ResolvedRefs\" condition to \"False\" with the \"InvalidRouteKinds\" reason. If both valid and invalid Route kinds are specified, the implementation MUST reference the valid Route kinds that have been specified.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.RouteGroupKind"), - }, - }, - }, - }, - }, - "attachedRoutes": { - SchemaProps: spec.SchemaProps{ - Description: "AttachedRoutes represents the total number of Routes that have been successfully attached to this Listener.\n\nSuccessful attachment of a Route to a Listener is based solely on the combination of the AllowedRoutes field on the corresponding Listener and the Route's ParentRefs field. A Route is successfully attached to a Listener when it is selected by the Listener's AllowedRoutes field AND the Route has a valid ParentRef selecting the whole Gateway resource or a specific Listener as a parent resource (more detail on attachment semantics can be found in the documentation on the various Route kinds ParentRefs fields). Listener or Route status does not impact successful attachment, i.e. the AttachedRoutes field count MUST be set for Listeners with condition Accepted: false and MUST count successfully attached Routes that may themselves have Accepted: false conditions.\n\nUses for this field include troubleshooting Route attachment and measuring blast radius/impact of changes to a Listener.", - Default: 0, - Type: []string{"integer"}, - Format: "int32", - }, - }, - "conditions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "type", - }, - "x-kubernetes-list-type": "map", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Conditions describe the current condition of this listener.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), - }, - }, - }, - }, - }, - }, - Required: []string{"name", "supportedKinds", "attachedRoutes", "conditions"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Condition", "sigs.k8s.io/gateway-api/apis/v1.RouteGroupKind"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_LocalObjectReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "LocalObjectReference identifies an API object within the namespace of the referrer. The API object must be valid in the cluster; the Group and Kind must be registered in the cluster for this reference to be valid.\n\nReferences to objects with invalid Group and Kind are not valid, and must be rejected by the implementation, with appropriate Conditions set on the containing object.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Description: "Group is the group of the referent. For example, \"gateway.networking.k8s.io\". When unspecified or empty string, core API group is inferred.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is kind of the referent. For example \"HTTPRoute\" or \"Service\".", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the referent.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "kind", "name"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_LocalParametersReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "LocalParametersReference identifies an API object containing controller-specific configuration resource within the namespace.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Description: "Group is the group of the referent.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is kind of the referent.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the referent.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "kind", "name"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_ObjectReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ObjectReference identifies an API object including its namespace.\n\nThe API object must be valid in the cluster; the Group and Kind must be registered in the cluster for this reference to be valid.\n\nReferences to objects with invalid Group and Kind are not valid, and must be rejected by the implementation, with appropriate Conditions set on the containing object.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Description: "Group is the group of the referent. For example, \"gateway.networking.k8s.io\". When set to the empty string, core API group is inferred.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is kind of the referent. For example \"ConfigMap\" or \"Service\".", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the referent.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Description: "Namespace is the namespace of the referenced object. When unspecified, the local namespace is inferred.\n\nNote that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details.\n\nSupport: Core", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "kind", "name"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_ParametersReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ParametersReference identifies an API object containing controller-specific configuration resource within the cluster.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Description: "Group is the group of the referent.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is kind of the referent.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the referent.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Description: "Namespace is the namespace of the referent. This field is required when referring to a Namespace-scoped resource and MUST be unset when referring to a Cluster-scoped resource.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "kind", "name"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_ParentReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ParentReference identifies an API object (usually a Gateway) that can be considered a parent of this resource (usually a route). The only kind of parent resource with \"Core\" support is Gateway. This API may be extended in the future to support additional kinds of parent resources, such as HTTPRoute.\n\nNote 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.\n\nThe API object must be valid in the cluster; the Group and Kind must be registered in the cluster for this reference to be valid.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Description: "Group is the group of the referent. When unspecified, \"gateway.networking.k8s.io\" is inferred. To set the core API group (such as for a \"Service\" kind referent), Group must be explicitly set to \"\" (empty string).\n\nSupport: Core", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is kind of the referent.\n\nThere are two kinds of parent resources with \"Core\" support:\n\n* Gateway (Gateway conformance profile) * Service (Mesh conformance profile, ClusterIP Services only)\n\nSupport for other resources is Implementation-Specific.", - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Description: "Namespace is the namespace of the referent. When unspecified, this refers to the local namespace of the Route.\n\nNote 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.\n\n 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.\n\nParentRefs 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 the intended destination of the connections are a Service targeted as a ParentRef of the Route. \n\nSupport: Core", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the referent.\n\nSupport: Core", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "sectionName": { - SchemaProps: spec.SchemaProps{ - Description: "SectionName is the name of a section within the target resource. In the following resources, SectionName is interpreted as the following:\n\n* Gateway: Listener name. When both Port (experimental) and SectionName are specified, the name and port of the selected listener must match both specified values. * Service: Port name. When both Port (experimental) and SectionName are specified, the name and port of the selected listener must match both specified values.\n\nImplementations MAY choose to support attaching Routes to other resources. If that is the case, they MUST clearly document how SectionName is interpreted.\n\nWhen 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 listeners can restrict which Routes can attach to them by Route kind, namespace, or hostname. If 1 of 2 Gateway listeners accept attachment from the referencing Route, the Route MUST be considered successfully attached. If no Gateway listeners accept attachment from this Route, the Route MUST be considered detached from the Gateway.\n\nSupport: Core", - Type: []string{"string"}, - Format: "", - }, - }, - "port": { - SchemaProps: spec.SchemaProps{ - Description: "Port is the network port this Route targets. It can be interpreted differently based on the type of parent resource.\n\nWhen 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 networking behaviors specified in a Route must apply to a specific port as opposed to a listener(s) whose port(s) may be changed. When both Port and SectionName are specified, the name and port of the selected listener must match both specified values.\n\n 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. \n\nImplementations MAY choose to support other parent resources. Implementations supporting other types of parent resources MUST clearly document how/if Port is interpreted.\n\nFor 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, namespace, or hostname. If 1 of 2 Gateway listeners accept attachment from the referencing Route, the Route MUST be considered successfully attached. If no Gateway listeners accept attachment from this Route, the Route MUST be considered detached from the Gateway.\n\nSupport: Extended", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"name"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_RouteGroupKind(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Description: "Group is the group of the Route.", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is the kind of the Route.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"kind"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_RouteNamespaces(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RouteNamespaces indicate which namespaces Routes should be selected from.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "from": { - SchemaProps: spec.SchemaProps{ - Description: "From indicates where Routes will be selected for this Gateway. Possible values are:\n\n* All: Routes in all namespaces may be used by this Gateway. * Selector: Routes in namespaces selected by the selector may be used by\n this Gateway.\n* Same: Only Routes in the same namespace may be used by this Gateway.\n\nSupport: Core", - Type: []string{"string"}, - Format: "", - }, - }, - "selector": { - SchemaProps: spec.SchemaProps{ - Description: "Selector must be specified when From is set to \"Selector\". In that case, only Routes in Namespaces matching this Selector will be selected by this Gateway. This field is ignored for other values of \"From\".\n\nSupport: Core", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_RouteParentStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RouteParentStatus describes the status of a route with respect to an associated Parent.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "parentRef": { - SchemaProps: spec.SchemaProps{ - Description: "ParentRef corresponds with a ParentRef in the spec that this RouteParentStatus struct describes the status of.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.ParentReference"), - }, - }, - "controllerName": { - SchemaProps: spec.SchemaProps{ - Description: "ControllerName is a domain/path string that indicates the name of the controller that wrote this status. This corresponds with the controllerName field on GatewayClass.\n\nExample: \"example.net/gateway-controller\".\n\nThe 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).\n\nControllers 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.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "conditions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "type", - }, - "x-kubernetes-list-type": "map", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Conditions describes the status of the route with respect to the Gateway. Note that the route's availability is also subject to the Gateway's own status conditions and listener status.\n\nIf the Route's ParentRef specifies an existing Gateway that supports Routes of this kind AND that Gateway's controller has sufficient access, then that Gateway's controller MUST set the \"Accepted\" condition on the Route, to indicate whether the route has been accepted or rejected by the Gateway, and why.\n\nA Route MUST be considered \"Accepted\" if at least one of the Route's rules is implemented by the Gateway.\n\nThere are a number of cases where the \"Accepted\" condition may not be set due to lack of controller visibility, that includes when:\n\n* The Route refers to a nonexistent parent. * The Route is of a type that the controller does not support. * The Route is in a namespace the controller does not have access to.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), - }, - }, - }, - }, - }, - }, - Required: []string{"parentRef", "controllerName"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Condition", "sigs.k8s.io/gateway-api/apis/v1.ParentReference"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_RouteStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RouteStatus defines the common attributes that all Routes MUST include within their status.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "parents": { - SchemaProps: spec.SchemaProps{ - Description: "Parents is a list of parent resources (usually Gateways) that are associated with the route, and the status of the route with respect to each parent. When this route attaches to a parent, the controller that manages the parent must add an entry to this list when the controller first sees the route and should update the entry as appropriate when the route or gateway is modified.\n\nNote that parent references that cannot be resolved by an implementation of this API will not be added to this list. Implementations of this API can only populate Route status for the Gateways/parent resources they are responsible for.\n\nA maximum of 32 Gateways will be represented in this list. An empty list means the route has not been attached to any Gateway.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.RouteParentStatus"), - }, - }, - }, - }, - }, - }, - Required: []string{"parents"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.RouteParentStatus"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_SecretObjectReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SecretObjectReference identifies an API object including its namespace, defaulting to Secret.\n\nThe API object must be valid in the cluster; the Group and Kind must be registered in the cluster for this reference to be valid.\n\nReferences to objects with invalid Group and Kind are not valid, and must be rejected by the implementation, with appropriate Conditions set on the containing object.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Description: "Group is the group of the referent. For example, \"gateway.networking.k8s.io\". When unspecified or empty string, core API group is inferred.", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is kind of the referent. For example \"Secret\".", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the referent.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Description: "Namespace is the namespace of the referenced object. When unspecified, the local namespace is inferred.\n\nNote that when a namespace different than the local namespace is specified, a ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details.\n\nSupport: Core", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_SessionPersistence(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SessionPersistence defines the desired state of SessionPersistence.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "sessionName": { - SchemaProps: spec.SchemaProps{ - Description: "SessionName defines the name of the persistent session token which may be reflected in the cookie or the header. Users should avoid reusing session names to prevent unintended consequences, such as rejection or unpredictable behavior.\n\nSupport: Implementation-specific", - Type: []string{"string"}, - Format: "", - }, - }, - "absoluteTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "AbsoluteTimeout defines the absolute timeout of the persistent session. Once the AbsoluteTimeout duration has elapsed, the session becomes invalid.\n\nSupport: Extended", - Type: []string{"string"}, - Format: "", - }, - }, - "idleTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "IdleTimeout defines the idle timeout of the persistent session. Once the session has been idle for more than the specified IdleTimeout duration, the session becomes invalid.\n\nSupport: Extended", - Type: []string{"string"}, - Format: "", - }, - }, - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type defines the type of session persistence such as through the use a header or cookie. Defaults to cookie based session persistence.\n\nSupport: Core for \"Cookie\" type\n\nSupport: Extended for \"Header\" type", - Type: []string{"string"}, - Format: "", - }, - }, - "cookieConfig": { - SchemaProps: spec.SchemaProps{ - Description: "CookieConfig provides configuration settings that are specific to cookie-based session persistence.\n\nSupport: Core", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.CookieConfig"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.CookieConfig"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_SupportedFeature(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1_supportedFeatureInternal(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "This is solely for the purpose of ensuring backward compatibility and SHOULD NOT be used elsewhere.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendLBPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "BackendLBPolicy provides a way to define load balancing rules for a backend.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the desired state of BackendLBPolicy.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.BackendLBPolicySpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status defines the current state of BackendLBPolicy.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyStatus"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendLBPolicySpec", "sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyStatus"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendLBPolicyList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "BackendLBPolicyList contains a list of BackendLBPolicies", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.BackendLBPolicy"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/gateway-api/apis/v1alpha2.BackendLBPolicy"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_BackendLBPolicySpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "BackendLBPolicySpec defines the desired state of BackendLBPolicy. Note: there is no Override or Default policy configuration.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "targetRefs": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "group", - "kind", - "name", - }, - "x-kubernetes-list-type": "map", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "TargetRef identifies an API object to apply policy to. Currently, Backends (i.e. Service, ServiceImport, or any implementation-specific backendRef) are the only valid API target references.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.LocalPolicyTargetReference"), - }, - }, - }, - }, - }, - "sessionPersistence": { - SchemaProps: spec.SchemaProps{ - Description: "SessionPersistence defines and configures session persistence for the backend.\n\nSupport: Extended", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.SessionPersistence"), - }, - }, - }, - Required: []string{"targetRefs"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.SessionPersistence", "sigs.k8s.io/gateway-api/apis/v1alpha2.LocalPolicyTargetReference"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_GRPCRoute(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the desired state of GRPCRoute.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GRPCRouteSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status defines the current state of GRPCRoute.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GRPCRouteStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/gateway-api/apis/v1.GRPCRouteSpec", "sigs.k8s.io/gateway-api/apis/v1.GRPCRouteStatus"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_GRPCRouteList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.GRPCRoute"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/gateway-api/apis/v1alpha2.GRPCRoute"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_LocalPolicyTargetReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "LocalPolicyTargetReference identifies an API object to apply a direct or inherited policy to. This should be used as part of Policy resources that can target Gateway API resources. For more information on how this policy attachment model works, and a sample Policy resource, refer to the policy attachment documentation for Gateway API.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Description: "Group is the group of the target resource.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is kind of the target resource.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the target resource.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "kind", "name"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_LocalPolicyTargetReferenceWithSectionName(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "LocalPolicyTargetReferenceWithSectionName identifies an API object to apply a direct policy to. This should be used as part of Policy resources that can target single resources. For more information on how this policy attachment mode works, and a sample Policy resource, refer to the policy attachment documentation for Gateway API.\n\nNote: This should only be used for direct policy attachment when references to SectionName are actually needed. In all other cases, LocalPolicyTargetReference should be used.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Description: "Group is the group of the target resource.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is kind of the target resource.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the target resource.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "sectionName": { - SchemaProps: spec.SchemaProps{ - Description: "SectionName is the name of a section within the target resource. When unspecified, this targetRef targets the entire resource. In the following resources, SectionName is interpreted as the following:\n\n* Gateway: Listener name * HTTPRoute: HTTPRouteRule name * Service: Port name\n\nIf a SectionName is specified, but does not exist on the targeted object, the Policy must fail to attach, and the policy implementation should record a `ResolvedRefs` or similar Condition in the Policy's status.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "kind", "name"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_NamespacedPolicyTargetReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NamespacedPolicyTargetReference identifies an API object to apply a direct or inherited policy to, potentially in a different namespace. This should only be used as part of Policy resources that need to be able to target resources in different namespaces. For more information on how this policy attachment model works, and a sample Policy resource, refer to the policy attachment documentation for Gateway API.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Description: "Group is the group of the target resource.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is kind of the target resource.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the target resource.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Description: "Namespace is the namespace of the referent. When unspecified, the local namespace is inferred. Even when policy targets a resource in a different namespace, it MUST only apply to traffic originating from the same namespace as the policy.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "kind", "name"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_PolicyAncestorStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PolicyAncestorStatus describes the status of a route with respect to an associated Ancestor.\n\nAncestors 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 the GatewayClass. Almost always, in this hierarchy, the Gateway will be the most useful object to place Policy status on, so we recommend that implementations SHOULD use Gateway as the PolicyAncestorStatus object unless the designers have a _very_ good reason otherwise.\n\nIn 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.\n\nPolicies 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.\n\nFor 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.\n\nNote 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.\n\nThis 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.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "ancestorRef": { - SchemaProps: spec.SchemaProps{ - Description: "AncestorRef corresponds with a ParentRef in the spec that this PolicyAncestorStatus struct describes the status of.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.ParentReference"), - }, - }, - "controllerName": { - SchemaProps: spec.SchemaProps{ - Description: "ControllerName is a domain/path string that indicates the name of the controller that wrote this status. This corresponds with the controllerName field on GatewayClass.\n\nExample: \"example.net/gateway-controller\".\n\nThe 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).\n\nControllers 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.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "conditions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "type", - }, - "x-kubernetes-list-type": "map", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Conditions describes the status of the Policy with respect to the given Ancestor.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), - }, - }, - }, - }, - }, - }, - Required: []string{"ancestorRef", "controllerName"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Condition", "sigs.k8s.io/gateway-api/apis/v1.ParentReference"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_PolicyStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PolicyStatus defines the common attributes that all Policies should include within their status.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "ancestors": { - SchemaProps: spec.SchemaProps{ - Description: "Ancestors is a list of ancestor resources (usually Gateways) that are associated with the policy, and the status of the policy with respect to each ancestor. When this policy attaches to a parent, the controller that manages the parent and the ancestors MUST add an entry to this list when the controller first sees the policy and SHOULD update the entry as appropriate when the relevant ancestor is modified.\n\nNote 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.\n\nNote 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.\n\nNote 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.\n\nA maximum of 16 ancestors will be represented in this list. An empty list means the Policy is not relevant for any ancestors.\n\nIf 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 here. For example, if this list was full on BackendTLSPolicy, no additional Gateways would be able to reference the Service targeted by the BackendTLSPolicy.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyAncestorStatus"), - }, - }, - }, - }, - }, - }, - Required: []string{"ancestors"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyAncestorStatus"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_ReferenceGrant(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReferenceGrant identifies kinds of resources in other namespaces that are trusted to reference the specified kinds of resources in the same namespace as the policy.\n\nEach ReferenceGrant can be used to represent a unique trust relationship. Additional Reference Grants can be used to add to the set of trusted sources of inbound references for the namespace they are defined within.\n\nA ReferenceGrant is required for all cross-namespace references in Gateway API (with the exception of cross-namespace Route-Gateway attachment, which is governed by the AllowedRoutes configuration on the Gateway, and cross-namespace Service ParentRefs on a \"consumer\" mesh Route, which defines routing rules applicable only to workloads in the Route namespace). ReferenceGrants allowing a reference from a Route to a Service are only applicable to BackendRefs.\n\nReferenceGrant is a form of runtime verification allowing users to assert which cross-namespace object references are permitted. Implementations that support ReferenceGrant MUST NOT permit cross-namespace references which have no grant, and MUST respond to the removal of a grant by revoking the access that the grant allowed.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the desired state of ReferenceGrant.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1beta1.ReferenceGrantSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/gateway-api/apis/v1beta1.ReferenceGrantSpec"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_ReferenceGrantList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReferenceGrantList contains a list of ReferenceGrant.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.ReferenceGrant"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/gateway-api/apis/v1alpha2.ReferenceGrant"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_TCPRoute(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TCPRoute provides a way to route TCP requests. When combined with a Gateway listener, it can be used to forward connections on the port specified by the listener to a set of backends specified by the TCPRoute.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the desired state of TCPRoute.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.TCPRouteSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status defines the current state of TCPRoute.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.TCPRouteStatus"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/gateway-api/apis/v1alpha2.TCPRouteSpec", "sigs.k8s.io/gateway-api/apis/v1alpha2.TCPRouteStatus"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_TCPRouteList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TCPRouteList contains a list of TCPRoute", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.TCPRoute"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/gateway-api/apis/v1alpha2.TCPRoute"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_TCPRouteRule(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TCPRouteRule is the configuration for a given rule.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the route rule. This name MUST be unique within a Route if it is set.\n\nSupport: Extended", - Type: []string{"string"}, - Format: "", - }, - }, - "backendRefs": { - SchemaProps: spec.SchemaProps{ - Description: "BackendRefs defines the backend(s) where matching requests should be sent. If unspecified or invalid (refers to a nonexistent resource or a Service with no endpoints), the underlying implementation MUST actively reject connection attempts to this backend. Connection rejections must respect weight; if an invalid backend is requested to have 80% of connections, then 80% of connections must be rejected instead.\n\nSupport: Core for Kubernetes Service\n\nSupport: Extended for Kubernetes ServiceImport\n\nSupport: Implementation-specific for any other resource\n\nSupport for weight: Extended", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.BackendRef"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.BackendRef"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_TCPRouteSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TCPRouteSpec defines the desired state of TCPRoute", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "parentRefs": { - SchemaProps: spec.SchemaProps{ - Description: "ParentRefs references the resources (usually Gateways) that a Route wants to be attached to. Note that the referenced parent resource needs to allow this for the attachment to be complete. For Gateways, that means the Gateway needs to allow attachment from Routes of this kind and namespace. For Services, that means the Service must either be in the same namespace for a \"producer\" route, or the mesh implementation must support and allow \"consumer\" routes for the referenced Service. ReferenceGrant is not applicable for governing ParentRefs to Services - it is not possible to create a \"producer\" route for a Service in a different namespace from the Route.\n\nThere are two kinds of parent resources with \"Core\" support:\n\n* Gateway (Gateway conformance profile) * Service (Mesh conformance profile, ClusterIP Services only)\n\nThis API may be extended in the future to support additional kinds of parent resources.\n\nParentRefs must be _distinct_. This means either that:\n\n* They select different objects. If this is the case, then parentRef\n entries are distinct. In terms of fields, this means that the\n multi-part key defined by `group`, `kind`, `namespace`, and `name` must\n be unique across all parentRef entries in the Route.\n* They do not select different objects, but for each optional field used,\n each ParentRef that selects the same object must set the same set of\n optional fields to different values. If one ParentRef sets a\n combination of optional fields, all must set the same combination.\n\nSome examples:\n\n* If one ParentRef sets `sectionName`, all ParentRefs referencing the\n same object must also set `sectionName`.\n* If one ParentRef sets `port`, all ParentRefs referencing the same\n object must also set `port`.\n* If one ParentRef sets `sectionName` and `port`, all ParentRefs\n referencing the same object must also set `sectionName` and `port`.\n\nIt is possible to separately reference multiple distinct objects that may be collapsed by an implementation. For example, some implementations may choose to merge compatible Gateway Listeners together. If that is the case, the list of routes attached to those resources should also be merged.\n\nNote that for ParentRefs that cross namespace boundaries, there are specific rules. 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 other kinds of cross-namespace reference.\n\n 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.\n\nParentRefs 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 the intended destination of the connections are a Service targeted as a ParentRef of the Route. \n\n ", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.ParentReference"), - }, - }, - }, - }, - }, - "rules": { - SchemaProps: spec.SchemaProps{ - Description: "Rules are a list of TCP matchers and actions.\n\n", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.TCPRouteRule"), - }, - }, - }, - }, - }, - }, - Required: []string{"rules"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.ParentReference", "sigs.k8s.io/gateway-api/apis/v1alpha2.TCPRouteRule"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_TCPRouteStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TCPRouteStatus defines the observed state of TCPRoute", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "parents": { - SchemaProps: spec.SchemaProps{ - Description: "Parents is a list of parent resources (usually Gateways) that are associated with the route, and the status of the route with respect to each parent. When this route attaches to a parent, the controller that manages the parent must add an entry to this list when the controller first sees the route and should update the entry as appropriate when the route or gateway is modified.\n\nNote that parent references that cannot be resolved by an implementation of this API will not be added to this list. Implementations of this API can only populate Route status for the Gateways/parent resources they are responsible for.\n\nA maximum of 32 Gateways will be represented in this list. An empty list means the route has not been attached to any Gateway.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.RouteParentStatus"), - }, - }, - }, - }, - }, - }, - Required: []string{"parents"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.RouteParentStatus"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_TLSRoute(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "The TLSRoute resource is similar to TCPRoute, but can be configured to match against TLS-specific metadata. This allows more flexibility in matching streams for a given TLS listener.\n\nIf you need to forward traffic to a single target for a TLS listener, you could choose to use a TCPRoute with a TLS listener.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the desired state of TLSRoute.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.TLSRouteSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status defines the current state of TLSRoute.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.TLSRouteStatus"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/gateway-api/apis/v1alpha2.TLSRouteSpec", "sigs.k8s.io/gateway-api/apis/v1alpha2.TLSRouteStatus"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_TLSRouteList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TLSRouteList contains a list of TLSRoute", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.TLSRoute"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/gateway-api/apis/v1alpha2.TLSRoute"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_TLSRouteRule(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TLSRouteRule is the configuration for a given rule.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the route rule. This name MUST be unique within a Route if it is set.\n\nSupport: Extended", - Type: []string{"string"}, - Format: "", - }, - }, - "backendRefs": { - SchemaProps: spec.SchemaProps{ - Description: "BackendRefs defines the backend(s) where matching requests should be sent. If unspecified or invalid (refers to a nonexistent resource or a Service with no endpoints), the rule performs no forwarding; if no filters are specified that would result in a response being sent, the underlying implementation must actively reject request attempts to this backend, by rejecting the connection or returning a 500 status code. Request rejections must respect weight; if an invalid backend is requested to have 80% of requests, then 80% of requests must be rejected instead.\n\nSupport: Core for Kubernetes Service\n\nSupport: Extended for Kubernetes ServiceImport\n\nSupport: Implementation-specific for any other resource\n\nSupport for weight: Extended", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.BackendRef"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.BackendRef"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_TLSRouteSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TLSRouteSpec defines the desired state of a TLSRoute resource.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "parentRefs": { - SchemaProps: spec.SchemaProps{ - Description: "ParentRefs references the resources (usually Gateways) that a Route wants to be attached to. Note that the referenced parent resource needs to allow this for the attachment to be complete. For Gateways, that means the Gateway needs to allow attachment from Routes of this kind and namespace. For Services, that means the Service must either be in the same namespace for a \"producer\" route, or the mesh implementation must support and allow \"consumer\" routes for the referenced Service. ReferenceGrant is not applicable for governing ParentRefs to Services - it is not possible to create a \"producer\" route for a Service in a different namespace from the Route.\n\nThere are two kinds of parent resources with \"Core\" support:\n\n* Gateway (Gateway conformance profile) * Service (Mesh conformance profile, ClusterIP Services only)\n\nThis API may be extended in the future to support additional kinds of parent resources.\n\nParentRefs must be _distinct_. This means either that:\n\n* They select different objects. If this is the case, then parentRef\n entries are distinct. In terms of fields, this means that the\n multi-part key defined by `group`, `kind`, `namespace`, and `name` must\n be unique across all parentRef entries in the Route.\n* They do not select different objects, but for each optional field used,\n each ParentRef that selects the same object must set the same set of\n optional fields to different values. If one ParentRef sets a\n combination of optional fields, all must set the same combination.\n\nSome examples:\n\n* If one ParentRef sets `sectionName`, all ParentRefs referencing the\n same object must also set `sectionName`.\n* If one ParentRef sets `port`, all ParentRefs referencing the same\n object must also set `port`.\n* If one ParentRef sets `sectionName` and `port`, all ParentRefs\n referencing the same object must also set `sectionName` and `port`.\n\nIt is possible to separately reference multiple distinct objects that may be collapsed by an implementation. For example, some implementations may choose to merge compatible Gateway Listeners together. If that is the case, the list of routes attached to those resources should also be merged.\n\nNote that for ParentRefs that cross namespace boundaries, there are specific rules. 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 other kinds of cross-namespace reference.\n\n 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.\n\nParentRefs 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 the intended destination of the connections are a Service targeted as a ParentRef of the Route. \n\n ", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.ParentReference"), - }, - }, - }, - }, - }, - "hostnames": { - SchemaProps: spec.SchemaProps{ - Description: "Hostnames defines a set of SNI names that should match against the SNI attribute of TLS ClientHello message in TLS handshake. This matches the RFC 1123 definition of a hostname with 2 notable exceptions:\n\n1. IPs are not allowed in SNI names per RFC 6066. 2. A hostname may be prefixed with a wildcard label (`*.`). The wildcard\n label must appear by itself as the first label.\n\nIf a hostname is specified by both the Listener and TLSRoute, there must be at least one intersecting hostname for the TLSRoute to be attached to the Listener. For example:\n\n* A Listener with `test.example.com` as the hostname matches TLSRoutes\n that have either not specified any hostnames, or have specified at\n least one of `test.example.com` or `*.example.com`.\n* A Listener with `*.example.com` as the hostname matches TLSRoutes\n that have either not specified any hostnames or have specified at least\n one hostname that matches the Listener hostname. For example,\n `test.example.com` and `*.example.com` would both match. On the other\n hand, `example.com` and `test.example.net` would not match.\n\nIf both the Listener and TLSRoute have specified hostnames, any TLSRoute hostnames that do not match the Listener hostname MUST be ignored. For example, if a Listener specified `*.example.com`, and the TLSRoute specified `test.example.com` and `test.example.net`, `test.example.net` must not be considered for a match.\n\nIf both the Listener and TLSRoute have specified hostnames, and none match with the criteria above, then the TLSRoute is not accepted. The implementation must raise an 'Accepted' Condition with a status of `False` in the corresponding RouteParentStatus.\n\nSupport: Core", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "rules": { - SchemaProps: spec.SchemaProps{ - Description: "Rules are a list of TLS matchers and actions.\n\n", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.TLSRouteRule"), - }, - }, - }, - }, - }, - }, - Required: []string{"rules"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.ParentReference", "sigs.k8s.io/gateway-api/apis/v1alpha2.TLSRouteRule"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_TLSRouteStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TLSRouteStatus defines the observed state of TLSRoute", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "parents": { - SchemaProps: spec.SchemaProps{ - Description: "Parents is a list of parent resources (usually Gateways) that are associated with the route, and the status of the route with respect to each parent. When this route attaches to a parent, the controller that manages the parent must add an entry to this list when the controller first sees the route and should update the entry as appropriate when the route or gateway is modified.\n\nNote that parent references that cannot be resolved by an implementation of this API will not be added to this list. Implementations of this API can only populate Route status for the Gateways/parent resources they are responsible for.\n\nA maximum of 32 Gateways will be represented in this list. An empty list means the route has not been attached to any Gateway.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.RouteParentStatus"), - }, - }, - }, - }, - }, - }, - Required: []string{"parents"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.RouteParentStatus"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_UDPRoute(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "UDPRoute provides a way to route UDP traffic. When combined with a Gateway listener, it can be used to forward traffic on the port specified by the listener to a set of backends specified by the UDPRoute.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the desired state of UDPRoute.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.UDPRouteSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status defines the current state of UDPRoute.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.UDPRouteStatus"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/gateway-api/apis/v1alpha2.UDPRouteSpec", "sigs.k8s.io/gateway-api/apis/v1alpha2.UDPRouteStatus"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_UDPRouteList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "UDPRouteList contains a list of UDPRoute", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.UDPRoute"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/gateway-api/apis/v1alpha2.UDPRoute"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_UDPRouteRule(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "UDPRouteRule is the configuration for a given rule.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the route rule. This name MUST be unique within a Route if it is set.\n\nSupport: Extended", - Type: []string{"string"}, - Format: "", - }, - }, - "backendRefs": { - SchemaProps: spec.SchemaProps{ - Description: "BackendRefs defines the backend(s) where matching requests should be sent. If unspecified or invalid (refers to a nonexistent resource or a Service with no endpoints), the underlying implementation MUST actively reject connection attempts to this backend. Packet drops must respect weight; if an invalid backend is requested to have 80% of the packets, then 80% of packets must be dropped instead.\n\nSupport: Core for Kubernetes Service\n\nSupport: Extended for Kubernetes ServiceImport\n\nSupport: Implementation-specific for any other resource\n\nSupport for weight: Extended", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.BackendRef"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.BackendRef"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_UDPRouteSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "UDPRouteSpec defines the desired state of UDPRoute.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "parentRefs": { - SchemaProps: spec.SchemaProps{ - Description: "ParentRefs references the resources (usually Gateways) that a Route wants to be attached to. Note that the referenced parent resource needs to allow this for the attachment to be complete. For Gateways, that means the Gateway needs to allow attachment from Routes of this kind and namespace. For Services, that means the Service must either be in the same namespace for a \"producer\" route, or the mesh implementation must support and allow \"consumer\" routes for the referenced Service. ReferenceGrant is not applicable for governing ParentRefs to Services - it is not possible to create a \"producer\" route for a Service in a different namespace from the Route.\n\nThere are two kinds of parent resources with \"Core\" support:\n\n* Gateway (Gateway conformance profile) * Service (Mesh conformance profile, ClusterIP Services only)\n\nThis API may be extended in the future to support additional kinds of parent resources.\n\nParentRefs must be _distinct_. This means either that:\n\n* They select different objects. If this is the case, then parentRef\n entries are distinct. In terms of fields, this means that the\n multi-part key defined by `group`, `kind`, `namespace`, and `name` must\n be unique across all parentRef entries in the Route.\n* They do not select different objects, but for each optional field used,\n each ParentRef that selects the same object must set the same set of\n optional fields to different values. If one ParentRef sets a\n combination of optional fields, all must set the same combination.\n\nSome examples:\n\n* If one ParentRef sets `sectionName`, all ParentRefs referencing the\n same object must also set `sectionName`.\n* If one ParentRef sets `port`, all ParentRefs referencing the same\n object must also set `port`.\n* If one ParentRef sets `sectionName` and `port`, all ParentRefs\n referencing the same object must also set `sectionName` and `port`.\n\nIt is possible to separately reference multiple distinct objects that may be collapsed by an implementation. For example, some implementations may choose to merge compatible Gateway Listeners together. If that is the case, the list of routes attached to those resources should also be merged.\n\nNote that for ParentRefs that cross namespace boundaries, there are specific rules. 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 other kinds of cross-namespace reference.\n\n 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.\n\nParentRefs 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 the intended destination of the connections are a Service targeted as a ParentRef of the Route. \n\n ", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.ParentReference"), - }, - }, - }, - }, - }, - "rules": { - SchemaProps: spec.SchemaProps{ - Description: "Rules are a list of UDP matchers and actions.\n\n", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.UDPRouteRule"), - }, - }, - }, - }, - }, - }, - Required: []string{"rules"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.ParentReference", "sigs.k8s.io/gateway-api/apis/v1alpha2.UDPRouteRule"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha2_UDPRouteStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "UDPRouteStatus defines the observed state of UDPRoute.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "parents": { - SchemaProps: spec.SchemaProps{ - Description: "Parents is a list of parent resources (usually Gateways) that are associated with the route, and the status of the route with respect to each parent. When this route attaches to a parent, the controller that manages the parent must add an entry to this list when the controller first sees the route and should update the entry as appropriate when the route or gateway is modified.\n\nNote that parent references that cannot be resolved by an implementation of this API will not be added to this list. Implementations of this API can only populate Route status for the Gateways/parent resources they are responsible for.\n\nA maximum of 32 Gateways will be represented in this list. An empty list means the route has not been attached to any Gateway.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.RouteParentStatus"), - }, - }, - }, - }, - }, - }, - Required: []string{"parents"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.RouteParentStatus"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha3_BackendTLSPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "BackendTLSPolicy provides a way to configure how a Gateway connects to a Backend via TLS.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the desired state of BackendTLSPolicy.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha3.BackendTLSPolicySpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status defines the current state of BackendTLSPolicy.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyStatus"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyStatus", "sigs.k8s.io/gateway-api/apis/v1alpha3.BackendTLSPolicySpec"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha3_BackendTLSPolicyList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "BackendTLSPolicyList contains a list of BackendTLSPolicies", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha3.BackendTLSPolicy"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/gateway-api/apis/v1alpha3.BackendTLSPolicy"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha3_BackendTLSPolicySpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "BackendTLSPolicySpec defines the desired state of BackendTLSPolicy.\n\nSupport: Extended", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "targetRefs": { - SchemaProps: spec.SchemaProps{ - Description: "TargetRefs identifies an API object to apply the policy to. Only Services have Extended support. Implementations MAY support additional objects, with Implementation Specific support. Note that this config applies to the entire referenced resource by default, but this default may change in the future to provide a more granular application of the policy.\n\nTargetRefs must be _distinct_. This means either that:\n\n* They select different targets. If this is the case, then targetRef\n entries are distinct. In terms of fields, this means that the\n multi-part key defined by `group`, `kind`, and `name` must\n be unique across all targetRef entries in the BackendTLSPolicy.\n* They select different sectionNames in the same target.\n\nSupport: Extended for Kubernetes Service\n\nSupport: Implementation-specific for any other resource", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.LocalPolicyTargetReferenceWithSectionName"), - }, - }, - }, - }, - }, - "validation": { - SchemaProps: spec.SchemaProps{ - Description: "Validation contains backend TLS validation configuration.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha3.BackendTLSPolicyValidation"), - }, - }, - "options": { - SchemaProps: spec.SchemaProps{ - Description: "Options are a list of key/value pairs to enable extended TLS configuration for each implementation. For example, configuring the minimum TLS version or supported cipher suites.\n\nA set of common keys MAY be defined by the API in the future. To avoid any ambiguity, implementation-specific definitions MUST use domain-prefixed names, such as `example.com/my-custom-option`. Un-prefixed names are reserved for key names defined by Gateway API.\n\nSupport: Implementation-specific", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"targetRefs", "validation"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1alpha2.LocalPolicyTargetReferenceWithSectionName", "sigs.k8s.io/gateway-api/apis/v1alpha3.BackendTLSPolicyValidation"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha3_BackendTLSPolicyValidation(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "BackendTLSPolicyValidation contains backend TLS validation configuration.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "caCertificateRefs": { - SchemaProps: spec.SchemaProps{ - Description: "CACertificateRefs contains one or more references to Kubernetes objects that contain a PEM-encoded TLS CA certificate bundle, which is used to validate a TLS handshake between the Gateway and backend Pod.\n\nIf CACertificateRefs is empty or unspecified, then WellKnownCACertificates must be specified. Only one of CACertificateRefs or WellKnownCACertificates may be specified, not both. If CACertificateRefs is empty or unspecified, the configuration for WellKnownCACertificates MUST be honored instead if supported by the implementation.\n\nReferences to a resource in a different namespace are invalid for the moment, although we will revisit this in the future.\n\nA single CACertificateRef to a Kubernetes ConfigMap kind has \"Core\" support. Implementations MAY choose to support attaching multiple certificates to a backend, but this behavior is implementation-specific.\n\nSupport: Core - An optional single reference to a Kubernetes ConfigMap, with the CA certificate in a key named `ca.crt`.\n\nSupport: Implementation-specific (More than one reference, or other kinds of resources).", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.LocalObjectReference"), - }, - }, - }, - }, - }, - "wellKnownCACertificates": { - SchemaProps: spec.SchemaProps{ - Description: "WellKnownCACertificates specifies whether system CA certificates may be used in the TLS handshake between the gateway and backend pod.\n\nIf WellKnownCACertificates is unspecified or empty (\"\"), then CACertificateRefs must be specified with at least one entry for a valid configuration. Only one of CACertificateRefs or WellKnownCACertificates may be specified, not both. If an implementation does not support the WellKnownCACertificates field or the value supplied is not supported, the Status Conditions on the Policy MUST be updated to include an Accepted: False Condition with Reason: Invalid.\n\nSupport: Implementation-specific", - Type: []string{"string"}, - Format: "", - }, - }, - "hostname": { - SchemaProps: spec.SchemaProps{ - Description: "Hostname is used for two purposes in the connection between Gateways and backends:\n\n1. Hostname MUST be used as the SNI to connect to the backend (RFC 6066). 2. Hostname MUST be used for authentication and MUST match the certificate served by the matching backend, unless SubjectAltNames is specified.\n authentication and MUST match the certificate served by the matching\n backend.\n\nSupport: Core", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "subjectAltNames": { - SchemaProps: spec.SchemaProps{ - Description: "SubjectAltNames contains one or more Subject Alternative Names. When specified the certificate served from the backend MUST have at least one Subject Alternate Name matching one of the specified SubjectAltNames.\n\nSupport: Extended", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha3.SubjectAltName"), - }, - }, - }, - }, - }, - }, - Required: []string{"hostname"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.LocalObjectReference", "sigs.k8s.io/gateway-api/apis/v1alpha3.SubjectAltName"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1alpha3_SubjectAltName(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SubjectAltName represents Subject Alternative Name.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type determines the format of the Subject Alternative Name. Always required.\n\nSupport: Core", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "hostname": { - SchemaProps: spec.SchemaProps{ - Description: "Hostname contains Subject Alternative Name specified in DNS name format. Required when Type is set to Hostname, ignored otherwise.\n\nSupport: Core", - Type: []string{"string"}, - Format: "", - }, - }, - "uri": { - SchemaProps: spec.SchemaProps{ - Description: "URI contains Subject Alternative Name specified in a full URI format. It MUST include both a scheme (e.g., \"http\" or \"ftp\") and a scheme-specific-part. Common values include SPIFFE IDs like \"spiffe://mycluster.example.com/ns/myns/sa/svc1sa\". Required when Type is set to URI, ignored otherwise.\n\nSupport: Core", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1beta1_Gateway(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Gateway represents an instance of a service-traffic handling infrastructure by binding Listeners to a set of IP addresses.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the desired state of Gateway.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GatewaySpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status defines the current state of Gateway.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GatewayStatus"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/gateway-api/apis/v1.GatewaySpec", "sigs.k8s.io/gateway-api/apis/v1.GatewayStatus"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1beta1_GatewayClass(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GatewayClass describes a class of Gateways available to the user for creating Gateway resources.\n\nIt is recommended that this resource be used as a template for Gateways. This means that a Gateway is based on the state of the GatewayClass at the time it was created and changes to the GatewayClass or associated parameters are not propagated down to existing Gateways. This recommendation is intended to limit the blast radius of changes to GatewayClass or associated parameters. If implementations choose to propagate GatewayClass changes to existing Gateways, that MUST be clearly documented by the implementation.\n\nWhenever one or more Gateways are using a GatewayClass, implementations SHOULD add the `gateway-exists-finalizer.gateway.networking.k8s.io` finalizer on the associated GatewayClass. This ensures that a GatewayClass associated with a Gateway is not deleted while in use.\n\nGatewayClass is a Cluster level resource.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the desired state of GatewayClass.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GatewayClassSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status defines the current state of GatewayClass.\n\nImplementations MUST populate status on all GatewayClass resources which specify their controller name.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GatewayClassStatus"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/gateway-api/apis/v1.GatewayClassSpec", "sigs.k8s.io/gateway-api/apis/v1.GatewayClassStatus"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1beta1_GatewayClassList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GatewayClassList contains a list of GatewayClass", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1beta1.GatewayClass"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/gateway-api/apis/v1beta1.GatewayClass"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1beta1_GatewayList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GatewayList contains a list of Gateways.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1beta1.Gateway"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/gateway-api/apis/v1beta1.Gateway"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1beta1_HTTPRoute(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPRoute provides a way to route HTTP requests. This includes the capability to match requests by hostname, path, header, or query param. Filters can be used to specify additional processing steps. Backends specify where matching requests should be routed.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the desired state of HTTPRoute.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPRouteSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status defines the current state of HTTPRoute.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.HTTPRouteStatus"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/gateway-api/apis/v1.HTTPRouteSpec", "sigs.k8s.io/gateway-api/apis/v1.HTTPRouteStatus"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1beta1_HTTPRouteList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPRouteList contains a list of HTTPRoute.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1beta1.HTTPRoute"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/gateway-api/apis/v1beta1.HTTPRoute"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1beta1_ReferenceGrant(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReferenceGrant identifies kinds of resources in other namespaces that are trusted to reference the specified kinds of resources in the same namespace as the policy.\n\nEach ReferenceGrant can be used to represent a unique trust relationship. Additional Reference Grants can be used to add to the set of trusted sources of inbound references for the namespace they are defined within.\n\nAll cross-namespace references in Gateway API (with the exception of cross-namespace Gateway-route attachment) require a ReferenceGrant.\n\nReferenceGrant is a form of runtime verification allowing users to assert which cross-namespace object references are permitted. Implementations that support ReferenceGrant MUST NOT permit cross-namespace references which have no grant, and MUST respond to the removal of a grant by revoking the access that the grant allowed.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the desired state of ReferenceGrant.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1beta1.ReferenceGrantSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/gateway-api/apis/v1beta1.ReferenceGrantSpec"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1beta1_ReferenceGrantFrom(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReferenceGrantFrom describes trusted namespaces and kinds.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Description: "Group is the group of the referent. When empty, the Kubernetes core API group is inferred.\n\nSupport: Core", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is the kind of the referent. Although implementations may support additional resources, the following types are part of the \"Core\" support level for this field.\n\nWhen used to permit a SecretObjectReference:\n\n* Gateway\n\nWhen used to permit a BackendObjectReference:\n\n* GRPCRoute * HTTPRoute * TCPRoute * TLSRoute * UDPRoute", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Description: "Namespace is the namespace of the referent.\n\nSupport: Core", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "kind", "namespace"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1beta1_ReferenceGrantList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReferenceGrantList contains a list of ReferenceGrant.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1beta1.ReferenceGrant"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/gateway-api/apis/v1beta1.ReferenceGrant"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1beta1_ReferenceGrantSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReferenceGrantSpec identifies a cross namespace relationship that is trusted for Gateway API.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "from": { - SchemaProps: spec.SchemaProps{ - Description: "From describes the trusted namespaces and kinds that can reference the resources described in \"To\". Each entry in this list MUST be considered to be an additional place that references can be valid from, or to put this another way, entries MUST be combined using OR.\n\nSupport: Core", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1beta1.ReferenceGrantFrom"), - }, - }, - }, - }, - }, - "to": { - SchemaProps: spec.SchemaProps{ - Description: "To describes the resources that may be referenced by the resources described in \"From\". Each entry in this list MUST be considered to be an additional place that references can be valid to, or to put this another way, entries MUST be combined using OR.\n\nSupport: Core", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1beta1.ReferenceGrantTo"), - }, - }, - }, - }, - }, - }, - Required: []string{"from", "to"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1beta1.ReferenceGrantFrom", "sigs.k8s.io/gateway-api/apis/v1beta1.ReferenceGrantTo"}, - } -} - -func schema_sigsk8sio_gateway_api_apis_v1beta1_ReferenceGrantTo(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReferenceGrantTo describes what Kinds are allowed as targets of the references.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Description: "Group is the group of the referent. When empty, the Kubernetes core API group is inferred.\n\nSupport: Core", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is the kind of the referent. Although implementations may support additional resources, the following types are part of the \"Core\" support level for this field:\n\n* Secret when used to permit a SecretObjectReference * Service when used to permit a BackendObjectReference", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the referent. When unspecified, this policy refers to all resources of the specified Group and Kind in the local namespace.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "kind"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apisx_v1alpha1_ListenerEntry(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the Listener. This name MUST be unique within a ListenerSet.\n\nName is not required to be unique across a Gateway and ListenerSets. Routes can attach to a Listener by having a ListenerSet as a parentRef and setting the SectionName\n\nSupport: Core", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "hostname": { - SchemaProps: spec.SchemaProps{ - Description: "Hostname specifies the virtual hostname to match for protocol types that define this concept. When unspecified, all hostnames are matched. This field is ignored for protocols that don't require hostname based matching.\n\nImplementations MUST apply Hostname matching appropriately for each of the following protocols:\n\n* TLS: The Listener Hostname MUST match the SNI. * HTTP: The Listener Hostname MUST match the Host header of the request. * HTTPS: The Listener Hostname SHOULD match at both the TLS and HTTP\n protocol layers as described above. If an implementation does not\n ensure that both the SNI and Host header match the Listener hostname,\n it MUST clearly document that.\n\nFor HTTPRoute and TLSRoute resources, there is an interaction with the `spec.hostnames` array. When both listener and route specify hostnames, there MUST be an intersection between the values for a Route to be accepted. For more information, refer to the Route specific Hostnames documentation.\n\nHostnames that are prefixed with a wildcard label (`*.`) are interpreted as a suffix match. That means that a match for `*.example.com` would match both `test.example.com`, and `foo.test.example.com`, but not `example.com`.\n\nSupport: Core", - Type: []string{"string"}, - Format: "", - }, - }, - "port": { - SchemaProps: spec.SchemaProps{ - Description: "Port is the network port. Multiple listeners may use the same port, subject to the Listener compatibility rules.\n\nSupport: Core", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "protocol": { - SchemaProps: spec.SchemaProps{ - Description: "Protocol specifies the network protocol this listener expects to receive.\n\nSupport: Core", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "tls": { - SchemaProps: spec.SchemaProps{ - Description: "TLS is the TLS configuration for the Listener. This field is required if the Protocol field is \"HTTPS\" or \"TLS\". It is invalid to set this field if the Protocol field is \"HTTP\", \"TCP\", or \"UDP\".\n\nThe association of SNIs to Certificate defined in GatewayTLSConfig is defined based on the Hostname field for this listener.\n\nThe GatewayClass MUST use the longest matching SNI out of all available certificates for any TLS handshake.\n\nSupport: Core", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.GatewayTLSConfig"), - }, - }, - "allowedRoutes": { - SchemaProps: spec.SchemaProps{ - Description: "AllowedRoutes defines the types of routes that MAY be attached to a Listener and the trusted namespaces where those Route resources MAY be present.\n\nAlthough a client request may match multiple route rules, only one rule may ultimately receive the request. Matching precedence MUST be determined in order of the following criteria:\n\n* The most specific match as defined by the Route type. * The oldest Route based on creation timestamp. For example, a Route with\n a creation timestamp of \"2020-09-08 01:02:03\" is given precedence over\n a Route with a creation timestamp of \"2020-09-08 01:02:04\".\n* If everything else is equivalent, the Route appearing first in\n alphabetical order (namespace/name) should be given precedence. For\n example, foo/bar is given precedence over foo/baz.\n\nAll valid rules within a Route attached to this Listener should be implemented. Invalid Route rules can be ignored (sometimes that will mean the full Route). If a Route rule transitions from valid to invalid, support for that Route rule should be dropped to ensure consistency. For example, even if a filter specified by a Route rule is invalid, the rest of the rules within that Route should still be supported.\n\nSupport: Core", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.AllowedRoutes"), - }, - }, - }, - Required: []string{"name", "protocol"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.AllowedRoutes", "sigs.k8s.io/gateway-api/apis/v1.GatewayTLSConfig"}, - } -} - -func schema_sigsk8sio_gateway_api_apisx_v1alpha1_ListenerEntryStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ListenerStatus is the status associated with a Listener.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the Listener that this status corresponds to.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "port": { - SchemaProps: spec.SchemaProps{ - Description: "Port is the network port the listener is configured to listen on.", - Default: 0, - Type: []string{"integer"}, - Format: "int32", - }, - }, - "supportedKinds": { - SchemaProps: spec.SchemaProps{ - Description: "SupportedKinds is the list indicating the Kinds supported by this listener. This MUST represent the kinds an implementation supports for that Listener configuration.\n\nIf kinds are specified in Spec that are not supported, they MUST NOT appear in this list and an implementation MUST set the \"ResolvedRefs\" condition to \"False\" with the \"InvalidRouteKinds\" reason. If both valid and invalid Route kinds are specified, the implementation MUST reference the valid Route kinds that have been specified.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.RouteGroupKind"), - }, - }, - }, - }, - }, - "attachedRoutes": { - SchemaProps: spec.SchemaProps{ - Description: "AttachedRoutes represents the total number of Routes that have been successfully attached to this Listener.\n\nSuccessful attachment of a Route to a Listener is based solely on the combination of the AllowedRoutes field on the corresponding Listener and the Route's ParentRefs field. A Route is successfully attached to a Listener when it is selected by the Listener's AllowedRoutes field AND the Route has a valid ParentRef selecting the whole Gateway resource or a specific Listener as a parent resource (more detail on attachment semantics can be found in the documentation on the various Route kinds ParentRefs fields). Listener or Route status does not impact successful attachment, i.e. the AttachedRoutes field count MUST be set for Listeners with condition Accepted: false and MUST count successfully attached Routes that may themselves have Accepted: false conditions.\n\nUses for this field include troubleshooting Route attachment and measuring blast radius/impact of changes to a Listener.", - Default: 0, - Type: []string{"integer"}, - Format: "int32", - }, - }, - "conditions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "type", - }, - "x-kubernetes-list-type": "map", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Conditions describe the current condition of this listener.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), - }, - }, - }, - }, - }, - }, - Required: []string{"name", "port", "supportedKinds", "attachedRoutes", "conditions"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Condition", "sigs.k8s.io/gateway-api/apis/v1.RouteGroupKind"}, - } -} - -func schema_sigsk8sio_gateway_api_apisx_v1alpha1_ListenerSet(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ListenerSet defines a set of additional listeners to attach to an existing Gateway.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the desired state of ListenerSet.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha1.ListenerSetSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status defines the current state of ListenerSet.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha1.ListenerSetStatus"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/gateway-api/apisx/v1alpha1.ListenerSetSpec", "sigs.k8s.io/gateway-api/apisx/v1alpha1.ListenerSetStatus"}, - } -} - -func schema_sigsk8sio_gateway_api_apisx_v1alpha1_ListenerSetList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha1.ListenerSet"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/gateway-api/apisx/v1alpha1.ListenerSet"}, - } -} - -func schema_sigsk8sio_gateway_api_apisx_v1alpha1_ListenerSetSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ListenerSetSpec defines the desired state of a ListenerSet.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "parentRef": { - SchemaProps: spec.SchemaProps{ - Description: "ParentRef references the Gateway that the listeners are attached to.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha1.ParentGatewayReference"), - }, - }, - "listeners": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "name", - }, - "x-kubernetes-list-type": "map", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Listeners associated with this ListenerSet. Listeners define logical endpoints that are bound on this referenced parent Gateway's addresses.\n\nListeners in a `Gateway` and their attached `ListenerSets` are concatenated as a list when programming the underlying infrastructure. Each listener name does not need to be unique across the Gateway and ListenerSets. See ListenerEntry.Name for more details.\n\nImplementations MUST treat the parent Gateway as having the merged list of all listeners from itself and attached ListenerSets using the following precedence:\n\n1. \"parent\" Gateway 2. ListenerSet ordered by creation time (oldest first) 3. ListenerSet ordered alphabetically by “{namespace}/{name}”.\n\nAn implementation MAY reject listeners by setting the ListenerEntryStatus `Accepted`` condition to False with the Reason `TooManyListeners`\n\nIf a listener has a conflict, this will be reported in the Status.ListenerEntryStatus setting the `Conflicted` condition to True.\n\nImplementations SHOULD be cautious about what information from the parent or siblings are reported to avoid accidentally leaking sensitive information that the child would not otherwise have access to. This can include contents of secrets etc.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha1.ListenerEntry"), - }, - }, - }, - }, - }, - }, - Required: []string{"parentRef", "listeners"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apisx/v1alpha1.ListenerEntry", "sigs.k8s.io/gateway-api/apisx/v1alpha1.ParentGatewayReference"}, - } -} - -func schema_sigsk8sio_gateway_api_apisx_v1alpha1_ListenerSetStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "conditions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "type", - }, - "x-kubernetes-list-type": "map", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Conditions describe the current conditions of the ListenerSet.\n\nImplementations MUST express ListenerSet conditions using the `ListenerSetConditionType` and `ListenerSetConditionReason` constants so that operators and tools can converge on a common vocabulary to describe ListenerSet state.\n\nKnown condition types are:\n\n* \"Accepted\" * \"Programmed\"", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), - }, - }, - }, - }, - }, - "listeners": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "name", - }, - "x-kubernetes-list-type": "map", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Listeners provide status for each unique listener port defined in the Spec.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha1.ListenerEntryStatus"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Condition", "sigs.k8s.io/gateway-api/apisx/v1alpha1.ListenerEntryStatus"}, - } -} - -func schema_sigsk8sio_gateway_api_apisx_v1alpha1_ParentGatewayReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ParentGatewayReference identifies an API object including its namespace, defaulting to Gateway.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Description: "Group is the group of the referent.", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is kind of the referent. For example \"Gateway\".", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of the referent.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name"}, - }, - }, - } -} diff --git a/apisx/applyconfiguration/apisx/v1alpha2/backendtrafficpolicy.go b/apisx/applyconfiguration/apisx/v1alpha2/backendtrafficpolicy.go deleted file mode 100644 index a81c838094..0000000000 --- a/apisx/applyconfiguration/apisx/v1alpha2/backendtrafficpolicy.go +++ /dev/null @@ -1,265 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - managedfields "k8s.io/apimachinery/pkg/util/managedfields" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" - apisv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" - internal "sigs.k8s.io/gateway-api/apisx/applyconfiguration/internal" - apisxv1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" -) - -// BackendTrafficPolicyApplyConfiguration represents a declarative configuration of the BackendTrafficPolicy type for use -// with apply. -type BackendTrafficPolicyApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *BackendTrafficPolicySpecApplyConfiguration `json:"spec,omitempty"` - Status *apisv1alpha2.PolicyStatus `json:"status,omitempty"` -} - -// BackendTrafficPolicy constructs a declarative configuration of the BackendTrafficPolicy type for use with -// apply. -func BackendTrafficPolicy(name, namespace string) *BackendTrafficPolicyApplyConfiguration { - b := &BackendTrafficPolicyApplyConfiguration{} - b.WithName(name) - b.WithNamespace(namespace) - b.WithKind("BackendTrafficPolicy") - b.WithAPIVersion("gateway.networking.k8s-x.io/v1alpha2") - return b -} - -// ExtractBackendTrafficPolicy extracts the applied configuration owned by fieldManager from -// backendTrafficPolicy. If no managedFields are found in backendTrafficPolicy for fieldManager, a -// BackendTrafficPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable), -// APIVersion and Kind populated. It is possible that no managed fields were found for because other -// field managers have taken ownership of all the fields previously owned by fieldManager, or because -// the fieldManager never owned fields any fields. -// backendTrafficPolicy must be a unmodified BackendTrafficPolicy API object that was retrieved from the Kubernetes API. -// ExtractBackendTrafficPolicy provides a way to perform a extract/modify-in-place/apply workflow. -// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously -// applied if another fieldManager has updated or force applied any of the previously applied fields. -// Experimental! -func ExtractBackendTrafficPolicy(backendTrafficPolicy *apisxv1alpha2.BackendTrafficPolicy, fieldManager string) (*BackendTrafficPolicyApplyConfiguration, error) { - return extractBackendTrafficPolicy(backendTrafficPolicy, fieldManager, "") -} - -// ExtractBackendTrafficPolicyStatus is the same as ExtractBackendTrafficPolicy except -// that it extracts the status subresource applied configuration. -// Experimental! -func ExtractBackendTrafficPolicyStatus(backendTrafficPolicy *apisxv1alpha2.BackendTrafficPolicy, fieldManager string) (*BackendTrafficPolicyApplyConfiguration, error) { - return extractBackendTrafficPolicy(backendTrafficPolicy, fieldManager, "status") -} - -func extractBackendTrafficPolicy(backendTrafficPolicy *apisxv1alpha2.BackendTrafficPolicy, fieldManager string, subresource string) (*BackendTrafficPolicyApplyConfiguration, error) { - b := &BackendTrafficPolicyApplyConfiguration{} - err := managedfields.ExtractInto(backendTrafficPolicy, internal.Parser().Type("io.k8s.sigs.gateway-api.apisx.v1alpha2.BackendTrafficPolicy"), fieldManager, b, subresource) - if err != nil { - return nil, err - } - b.WithName(backendTrafficPolicy.Name) - b.WithNamespace(backendTrafficPolicy.Namespace) - - b.WithKind("BackendTrafficPolicy") - b.WithAPIVersion("gateway.networking.k8s-x.io/v1alpha2") - return b, nil -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithKind(value string) *BackendTrafficPolicyApplyConfiguration { - b.Kind = &value - return b -} - -// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIVersion field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithAPIVersion(value string) *BackendTrafficPolicyApplyConfiguration { - b.APIVersion = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithName(value string) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value - return b -} - -// WithGenerateName sets the GenerateName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GenerateName field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithGenerateName(value string) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithNamespace(value string) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value - return b -} - -// WithUID sets the UID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the UID field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithUID(value types.UID) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value - return b -} - -// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceVersion field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithResourceVersion(value string) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value - return b -} - -// WithGeneration sets the Generation field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Generation field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithGeneration(value int64) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value - return b -} - -// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value - return b -} - -// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value - return b -} - -// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value - return b -} - -// WithLabels puts the entries into the Labels field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Labels field, -// overwriting an existing map entries in Labels field with the same key. -func (b *BackendTrafficPolicyApplyConfiguration) WithLabels(entries map[string]string) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Labels[k] = v - } - return b -} - -// WithAnnotations puts the entries into the Annotations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Annotations field, -// overwriting an existing map entries in Annotations field with the same key. -func (b *BackendTrafficPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Annotations[k] = v - } - return b -} - -// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the OwnerReferences field. -func (b *BackendTrafficPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - if values[i] == nil { - panic("nil value passed to WithOwnerReferences") - } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) - } - return b -} - -// WithFinalizers adds the given value to the Finalizers field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Finalizers field. -func (b *BackendTrafficPolicyApplyConfiguration) WithFinalizers(values ...string) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) - } - return b -} - -func (b *BackendTrafficPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { - if b.ObjectMetaApplyConfiguration == nil { - b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} - } -} - -// WithSpec sets the Spec field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Spec field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithSpec(value *BackendTrafficPolicySpecApplyConfiguration) *BackendTrafficPolicyApplyConfiguration { - b.Spec = value - return b -} - -// WithStatus sets the Status field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Status field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithStatus(value apisv1alpha2.PolicyStatus) *BackendTrafficPolicyApplyConfiguration { - b.Status = &value - return b -} - -// GetName retrieves the value of the Name field in the declarative configuration. -func (b *BackendTrafficPolicyApplyConfiguration) GetName() *string { - b.ensureObjectMetaApplyConfigurationExists() - return b.Name -} diff --git a/apisx/applyconfiguration/apisx/v1alpha2/backendtrafficpolicyspec.go b/apisx/applyconfiguration/apisx/v1alpha2/backendtrafficpolicyspec.go deleted file mode 100644 index e073f35c01..0000000000 --- a/apisx/applyconfiguration/apisx/v1alpha2/backendtrafficpolicyspec.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - v1 "sigs.k8s.io/gateway-api/apis/v1" - v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" -) - -// BackendTrafficPolicySpecApplyConfiguration represents a declarative configuration of the BackendTrafficPolicySpec type for use -// with apply. -type BackendTrafficPolicySpecApplyConfiguration struct { - TargetRefs []v1alpha2.LocalPolicyTargetReference `json:"targetRefs,omitempty"` - RetryConstraint *RetryConstraintApplyConfiguration `json:"retry,omitempty"` - SessionPersistence *v1.SessionPersistence `json:"sessionPersistence,omitempty"` -} - -// BackendTrafficPolicySpecApplyConfiguration constructs a declarative configuration of the BackendTrafficPolicySpec type for use with -// apply. -func BackendTrafficPolicySpec() *BackendTrafficPolicySpecApplyConfiguration { - return &BackendTrafficPolicySpecApplyConfiguration{} -} - -// WithTargetRefs adds the given value to the TargetRefs field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the TargetRefs field. -func (b *BackendTrafficPolicySpecApplyConfiguration) WithTargetRefs(values ...v1alpha2.LocalPolicyTargetReference) *BackendTrafficPolicySpecApplyConfiguration { - for i := range values { - b.TargetRefs = append(b.TargetRefs, values[i]) - } - return b -} - -// WithRetryConstraint sets the RetryConstraint field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the RetryConstraint field is set to the value of the last call. -func (b *BackendTrafficPolicySpecApplyConfiguration) WithRetryConstraint(value *RetryConstraintApplyConfiguration) *BackendTrafficPolicySpecApplyConfiguration { - b.RetryConstraint = value - return b -} - -// WithSessionPersistence sets the SessionPersistence field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the SessionPersistence field is set to the value of the last call. -func (b *BackendTrafficPolicySpecApplyConfiguration) WithSessionPersistence(value v1.SessionPersistence) *BackendTrafficPolicySpecApplyConfiguration { - b.SessionPersistence = &value - return b -} diff --git a/apisx/applyconfiguration/apisx/v1alpha2/requestrate.go b/apisx/applyconfiguration/apisx/v1alpha2/requestrate.go deleted file mode 100644 index e71fcd534a..0000000000 --- a/apisx/applyconfiguration/apisx/v1alpha2/requestrate.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - v1 "sigs.k8s.io/gateway-api/apis/v1" -) - -// RequestRateApplyConfiguration represents a declarative configuration of the RequestRate type for use -// with apply. -type RequestRateApplyConfiguration struct { - Count *int `json:"count,omitempty"` - Interval *v1.Duration `json:"interval,omitempty"` -} - -// RequestRateApplyConfiguration constructs a declarative configuration of the RequestRate type for use with -// apply. -func RequestRate() *RequestRateApplyConfiguration { - return &RequestRateApplyConfiguration{} -} - -// WithCount sets the Count field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Count field is set to the value of the last call. -func (b *RequestRateApplyConfiguration) WithCount(value int) *RequestRateApplyConfiguration { - b.Count = &value - return b -} - -// WithInterval sets the Interval field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Interval field is set to the value of the last call. -func (b *RequestRateApplyConfiguration) WithInterval(value v1.Duration) *RequestRateApplyConfiguration { - b.Interval = &value - return b -} diff --git a/apisx/applyconfiguration/apisx/v1alpha2/retryconstraint.go b/apisx/applyconfiguration/apisx/v1alpha2/retryconstraint.go deleted file mode 100644 index 36f0068138..0000000000 --- a/apisx/applyconfiguration/apisx/v1alpha2/retryconstraint.go +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - v1 "sigs.k8s.io/gateway-api/apis/v1" -) - -// RetryConstraintApplyConfiguration represents a declarative configuration of the RetryConstraint type for use -// with apply. -type RetryConstraintApplyConfiguration struct { - BudgetPercent *int `json:"budgetPercent,omitempty"` - BudgetInterval *v1.Duration `json:"budgetInterval,omitempty"` - MinRetryRate *RequestRateApplyConfiguration `json:"minRetryRate,omitempty"` -} - -// RetryConstraintApplyConfiguration constructs a declarative configuration of the RetryConstraint type for use with -// apply. -func RetryConstraint() *RetryConstraintApplyConfiguration { - return &RetryConstraintApplyConfiguration{} -} - -// WithBudgetPercent sets the BudgetPercent field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the BudgetPercent field is set to the value of the last call. -func (b *RetryConstraintApplyConfiguration) WithBudgetPercent(value int) *RetryConstraintApplyConfiguration { - b.BudgetPercent = &value - return b -} - -// WithBudgetInterval sets the BudgetInterval field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the BudgetInterval field is set to the value of the last call. -func (b *RetryConstraintApplyConfiguration) WithBudgetInterval(value v1.Duration) *RetryConstraintApplyConfiguration { - b.BudgetInterval = &value - return b -} - -// WithMinRetryRate sets the MinRetryRate field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the MinRetryRate field is set to the value of the last call. -func (b *RetryConstraintApplyConfiguration) WithMinRetryRate(value *RequestRateApplyConfiguration) *RetryConstraintApplyConfiguration { - b.MinRetryRate = value - return b -} diff --git a/apisx/applyconfiguration/internal/internal.go b/apisx/applyconfiguration/internal/internal.go deleted file mode 100644 index 926627c38a..0000000000 --- a/apisx/applyconfiguration/internal/internal.go +++ /dev/null @@ -1,72 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package internal - -import ( - "fmt" - "sync" - - typed "sigs.k8s.io/structured-merge-diff/v4/typed" -) - -func Parser() *typed.Parser { - parserOnce.Do(func() { - var err error - parser, err = typed.NewParser(schemaYAML) - if err != nil { - panic(fmt.Sprintf("Failed to parse schema: %v", err)) - } - }) - return parser -} - -var parserOnce sync.Once -var parser *typed.Parser -var schemaYAML = typed.YAMLObject(`types: -- name: io.k8s.sigs.gateway-api.apisx.v1alpha2.BackendTrafficPolicy - scalar: untyped - list: - elementType: - namedType: __untyped_atomic_ - elementRelationship: atomic - map: - elementType: - namedType: __untyped_deduced_ - elementRelationship: separable -- name: __untyped_atomic_ - scalar: untyped - list: - elementType: - namedType: __untyped_atomic_ - elementRelationship: atomic - map: - elementType: - namedType: __untyped_atomic_ - elementRelationship: atomic -- name: __untyped_deduced_ - scalar: untyped - list: - elementType: - namedType: __untyped_atomic_ - elementRelationship: atomic - map: - elementType: - namedType: __untyped_deduced_ - elementRelationship: separable -`) diff --git a/apisx/applyconfiguration/utils.go b/apisx/applyconfiguration/utils.go deleted file mode 100644 index 145c90d36a..0000000000 --- a/apisx/applyconfiguration/utils.go +++ /dev/null @@ -1,50 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package applyconfiguration - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - testing "k8s.io/client-go/testing" - apisxv1alpha2 "sigs.k8s.io/gateway-api/apisx/applyconfiguration/apisx/v1alpha2" - internal "sigs.k8s.io/gateway-api/apisx/applyconfiguration/internal" - v1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" -) - -// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no -// apply configuration type exists for the given GroupVersionKind. -func ForKind(kind schema.GroupVersionKind) interface{} { - switch kind { - // Group=gateway.networking.k8s-x.io, Version=v1alpha2 - case v1alpha2.SchemeGroupVersion.WithKind("BackendTrafficPolicy"): - return &apisxv1alpha2.BackendTrafficPolicyApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("BackendTrafficPolicySpec"): - return &apisxv1alpha2.BackendTrafficPolicySpecApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("RequestRate"): - return &apisxv1alpha2.RequestRateApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("RetryConstraint"): - return &apisxv1alpha2.RetryConstraintApplyConfiguration{} - - } - return nil -} - -func NewTypeConverter(scheme *runtime.Scheme) *testing.TypeConverter { - return &testing.TypeConverter{Scheme: scheme, TypeResolver: internal.Parser()} -} diff --git a/apisx/openapi/zz_generated.openapi.go b/apisx/openapi/zz_generated.openapi.go deleted file mode 100644 index 4059e14b64..0000000000 --- a/apisx/openapi/zz_generated.openapi.go +++ /dev/null @@ -1,2893 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by openapi-gen. DO NOT EDIT. - -package openapi - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - common "k8s.io/kube-openapi/pkg/common" - spec "k8s.io/kube-openapi/pkg/validation/spec" -) - -func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { - return map[string]common.OpenAPIDefinition{ - "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup": schema_pkg_apis_meta_v1_APIGroup(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroupList": schema_pkg_apis_meta_v1_APIGroupList(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIResource": schema_pkg_apis_meta_v1_APIResource(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIResourceList": schema_pkg_apis_meta_v1_APIResourceList(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIVersions": schema_pkg_apis_meta_v1_APIVersions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ApplyOptions": schema_pkg_apis_meta_v1_ApplyOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Condition": schema_pkg_apis_meta_v1_Condition(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.CreateOptions": schema_pkg_apis_meta_v1_CreateOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.DeleteOptions": schema_pkg_apis_meta_v1_DeleteOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Duration": schema_pkg_apis_meta_v1_Duration(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.FieldSelectorRequirement": schema_pkg_apis_meta_v1_FieldSelectorRequirement(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1": schema_pkg_apis_meta_v1_FieldsV1(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GetOptions": schema_pkg_apis_meta_v1_GetOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupKind": schema_pkg_apis_meta_v1_GroupKind(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupResource": schema_pkg_apis_meta_v1_GroupResource(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersion": schema_pkg_apis_meta_v1_GroupVersion(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery": schema_pkg_apis_meta_v1_GroupVersionForDiscovery(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionKind": schema_pkg_apis_meta_v1_GroupVersionKind(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionResource": schema_pkg_apis_meta_v1_GroupVersionResource(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.InternalEvent": schema_pkg_apis_meta_v1_InternalEvent(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector": schema_pkg_apis_meta_v1_LabelSelector(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement": schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.List": schema_pkg_apis_meta_v1_List(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta": schema_pkg_apis_meta_v1_ListMeta(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ListOptions": schema_pkg_apis_meta_v1_ListOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry": schema_pkg_apis_meta_v1_ManagedFieldsEntry(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime": schema_pkg_apis_meta_v1_MicroTime(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta": schema_pkg_apis_meta_v1_ObjectMeta(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference": schema_pkg_apis_meta_v1_OwnerReference(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata": schema_pkg_apis_meta_v1_PartialObjectMetadata(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadataList": schema_pkg_apis_meta_v1_PartialObjectMetadataList(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Patch": schema_pkg_apis_meta_v1_Patch(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.PatchOptions": schema_pkg_apis_meta_v1_PatchOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions": schema_pkg_apis_meta_v1_Preconditions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.RootPaths": schema_pkg_apis_meta_v1_RootPaths(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR": schema_pkg_apis_meta_v1_ServerAddressByClientCIDR(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Status": schema_pkg_apis_meta_v1_Status(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause": schema_pkg_apis_meta_v1_StatusCause(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails": schema_pkg_apis_meta_v1_StatusDetails(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Table": schema_pkg_apis_meta_v1_Table(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition": schema_pkg_apis_meta_v1_TableColumnDefinition(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TableOptions": schema_pkg_apis_meta_v1_TableOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TableRow": schema_pkg_apis_meta_v1_TableRow(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition": schema_pkg_apis_meta_v1_TableRowCondition(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Time": schema_pkg_apis_meta_v1_Time(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Timestamp": schema_pkg_apis_meta_v1_Timestamp(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta": schema_pkg_apis_meta_v1_TypeMeta(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.UpdateOptions": schema_pkg_apis_meta_v1_UpdateOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.WatchEvent": schema_pkg_apis_meta_v1_WatchEvent(ref), - "k8s.io/apimachinery/pkg/runtime.RawExtension": schema_k8sio_apimachinery_pkg_runtime_RawExtension(ref), - "k8s.io/apimachinery/pkg/runtime.TypeMeta": schema_k8sio_apimachinery_pkg_runtime_TypeMeta(ref), - "k8s.io/apimachinery/pkg/runtime.Unknown": schema_k8sio_apimachinery_pkg_runtime_Unknown(ref), - "k8s.io/apimachinery/pkg/version.Info": schema_k8sio_apimachinery_pkg_version_Info(ref), - "sigs.k8s.io/gateway-api/apisx/v1alpha2.BackendTrafficPolicy": schema_sigsk8sio_gateway_api_apisx_v1alpha2_BackendTrafficPolicy(ref), - "sigs.k8s.io/gateway-api/apisx/v1alpha2.BackendTrafficPolicyList": schema_sigsk8sio_gateway_api_apisx_v1alpha2_BackendTrafficPolicyList(ref), - "sigs.k8s.io/gateway-api/apisx/v1alpha2.BackendTrafficPolicySpec": schema_sigsk8sio_gateway_api_apisx_v1alpha2_BackendTrafficPolicySpec(ref), - "sigs.k8s.io/gateway-api/apisx/v1alpha2.RequestRate": schema_sigsk8sio_gateway_api_apisx_v1alpha2_RequestRate(ref), - "sigs.k8s.io/gateway-api/apisx/v1alpha2.RetryConstraint": schema_sigsk8sio_gateway_api_apisx_v1alpha2_RetryConstraint(ref), - } -} - -func schema_pkg_apis_meta_v1_APIGroup(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "APIGroup contains the name, the supported versions, and the preferred version of a group.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "name is the name of the group.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "versions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "versions are the versions supported in this group.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery"), - }, - }, - }, - }, - }, - "preferredVersion": { - SchemaProps: spec.SchemaProps{ - Description: "preferredVersion is the version preferred by the API server, which probably is the storage version.", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery"), - }, - }, - "serverAddressByClientCIDRs": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"), - }, - }, - }, - }, - }, - }, - Required: []string{"name", "versions"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery", "k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"}, - } -} - -func schema_pkg_apis_meta_v1_APIGroupList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "APIGroupList is a list of APIGroup, to allow clients to discover the API at /apis.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "groups": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "groups is a list of APIGroup.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup"), - }, - }, - }, - }, - }, - }, - Required: []string{"groups"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup"}, - } -} - -func schema_pkg_apis_meta_v1_APIResource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "APIResource specifies the name of a resource and whether it is namespaced.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "name is the plural name of the resource.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "singularName": { - SchemaProps: spec.SchemaProps{ - Description: "singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "namespaced": { - SchemaProps: spec.SchemaProps{ - Description: "namespaced indicates if a resource is namespaced or not.", - Default: false, - Type: []string{"boolean"}, - Format: "", - }, - }, - "group": { - SchemaProps: spec.SchemaProps{ - Description: "group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\".", - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Description: "version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\".", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "verbs": { - SchemaProps: spec.SchemaProps{ - Description: "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "shortNames": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "shortNames is a list of suggested short names of the resource.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "categories": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "categories is a list of the grouped resources this resource belongs to (e.g. 'all')", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "storageVersionHash": { - SchemaProps: spec.SchemaProps{ - Description: "The hash value of the storage version, the version this resource is converted to when written to the data store. Value must be treated as opaque by clients. Only equality comparison on the value is valid. This is an alpha feature and may change or be removed in the future. The field is populated by the apiserver only if the StorageVersionHash feature gate is enabled. This field will remain optional even if it graduates.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name", "singularName", "namespaced", "kind", "verbs"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_APIResourceList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "groupVersion": { - SchemaProps: spec.SchemaProps{ - Description: "groupVersion is the group and version this APIResourceList is for.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "resources": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "resources contains the name of the resources and if they are namespaced.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.APIResource"), - }, - }, - }, - }, - }, - }, - Required: []string{"groupVersion", "resources"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.APIResource"}, - } -} - -func schema_pkg_apis_meta_v1_APIVersions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "APIVersions lists the versions that are available, to allow clients to discover the API at /api, which is the root path of the legacy v1 API.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "versions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "versions are the api versions that are available.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "serverAddressByClientCIDRs": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"), - }, - }, - }, - }, - }, - }, - Required: []string{"versions", "serverAddressByClientCIDRs"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"}, - } -} - -func schema_pkg_apis_meta_v1_ApplyOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ApplyOptions may be provided when applying an API object. FieldManager is required for apply requests. ApplyOptions is equivalent to PatchOptions. It is provided as a convenience with documentation that speaks specifically to how the options fields relate to apply.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "dryRun": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "force": { - SchemaProps: spec.SchemaProps{ - Description: "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people.", - Default: false, - Type: []string{"boolean"}, - Format: "", - }, - }, - "fieldManager": { - SchemaProps: spec.SchemaProps{ - Description: "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"force", "fieldManager"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_Condition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Condition contains details for one aspect of the current state of this API Resource.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "type of condition in CamelCase or in foo.example.com/CamelCase.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "status of the condition, one of True, False, Unknown.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "observedGeneration": { - SchemaProps: spec.SchemaProps{ - Description: "observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "lastTransitionTime": { - SchemaProps: spec.SchemaProps{ - Description: "lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "message is a human readable message indicating details about the transition. This may be an empty string.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "status", "lastTransitionTime", "reason", "message"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_pkg_apis_meta_v1_CreateOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CreateOptions may be provided when creating an API object.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "dryRun": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "fieldManager": { - SchemaProps: spec.SchemaProps{ - Description: "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", - Type: []string{"string"}, - Format: "", - }, - }, - "fieldValidation": { - SchemaProps: spec.SchemaProps{ - Description: "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_DeleteOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DeleteOptions may be provided when deleting an API object.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "gracePeriodSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "preconditions": { - SchemaProps: spec.SchemaProps{ - Description: "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions"), - }, - }, - "orphanDependents": { - SchemaProps: spec.SchemaProps{ - Description: "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "propagationPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", - Type: []string{"string"}, - Format: "", - }, - }, - "dryRun": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions"}, - } -} - -func schema_pkg_apis_meta_v1_Duration(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Duration is a wrapper around time.Duration which supports correct marshaling to YAML and JSON. In particular, it marshals into strings, which can be used as map keys in json.", - Type: v1.Duration{}.OpenAPISchemaType(), - Format: v1.Duration{}.OpenAPISchemaFormat(), - }, - }, - } -} - -func schema_pkg_apis_meta_v1_FieldSelectorRequirement(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "FieldSelectorRequirement is a selector that contains values, a key, and an operator that relates the key and values.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "key": { - SchemaProps: spec.SchemaProps{ - Description: "key is the field selector key that the requirement applies to.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "operator": { - SchemaProps: spec.SchemaProps{ - Description: "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. The list of operators may grow in the future.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "values": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"key", "operator"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_FieldsV1(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format.\n\nEach key is either a '.' representing the field itself, and will always map to an empty set, or a string representing a sub-field or item. The string will follow one of these four formats: 'f:', where is the name of a field in a struct, or key in a map 'v:', where is the exact json formatted value of a list item 'i:', where is position of a item in a list 'k:', where is a map of a list item's key fields to their unique values If a key maps to an empty Fields value, the field that key represents is part of the set.\n\nThe exact format is defined in sigs.k8s.io/structured-merge-diff", - Type: []string{"object"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GetOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GetOptions is the standard query options to the standard REST get call.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceVersion": { - SchemaProps: spec.SchemaProps{ - Description: "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GroupKind(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GroupKind specifies a Group and a Kind, but does not force a version. This is useful for identifying concepts during lookup stages without having partially valid types", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "kind"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GroupResource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GroupResource specifies a Group and a Resource, but does not force a version. This is useful for identifying concepts during lookup stages without having partially valid types", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "resource": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "resource"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GroupVersion(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GroupVersion contains the \"group\" and the \"version\", which uniquely identifies the API.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "version"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GroupVersionForDiscovery(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensibility.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "groupVersion": { - SchemaProps: spec.SchemaProps{ - Description: "groupVersion specifies the API group and version in the form \"group/version\"", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Description: "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"groupVersion", "version"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GroupVersionKind(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GroupVersionKind unambiguously identifies a kind. It doesn't anonymously include GroupVersion to avoid automatic coercion. It doesn't use a GroupVersion to avoid custom marshalling", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "version", "kind"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GroupVersionResource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GroupVersionResource unambiguously identifies a resource. It doesn't anonymously include GroupVersion to avoid automatic coercion. It doesn't use a GroupVersion to avoid custom marshalling", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "resource": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "version", "resource"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_InternalEvent(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "InternalEvent makes watch.Event versioned", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "Type": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "Object": { - SchemaProps: spec.SchemaProps{ - Description: "Object is:\n * If Type is Added or Modified: the new state of the object.\n * If Type is Deleted: the state of the object immediately before deletion.\n * If Type is Bookmark: the object (instance of a type being watched) where\n only ResourceVersion field is set. On successful restart of watch from a\n bookmark resourceVersion, client is guaranteed to not get repeat event\n nor miss any events.\n * If Type is Error: *api.Status is recommended; other types may make sense\n depending on context.", - Ref: ref("k8s.io/apimachinery/pkg/runtime.Object"), - }, - }, - }, - Required: []string{"Type", "Object"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/runtime.Object"}, - } -} - -func schema_pkg_apis_meta_v1_LabelSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "matchLabels": { - SchemaProps: spec.SchemaProps{ - Description: "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "matchExpressions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "matchExpressions is a list of label selector requirements. The requirements are ANDed.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement"), - }, - }, - }, - }, - }, - }, - }, - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-map-type": "atomic", - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement"}, - } -} - -func schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "key": { - SchemaProps: spec.SchemaProps{ - Description: "key is the label key that the selector applies to.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "operator": { - SchemaProps: spec.SchemaProps{ - Description: "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "values": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"key", "operator"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_List(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "List holds a list of objects, which may not be known by the server.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of objects", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, - } -} - -func schema_pkg_apis_meta_v1_ListMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "selfLink": { - SchemaProps: spec.SchemaProps{ - Description: "Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceVersion": { - SchemaProps: spec.SchemaProps{ - Description: "String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", - Type: []string{"string"}, - Format: "", - }, - }, - "continue": { - SchemaProps: spec.SchemaProps{ - Description: "continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message.", - Type: []string{"string"}, - Format: "", - }, - }, - "remainingItemCount": { - SchemaProps: spec.SchemaProps{ - Description: "remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_ListOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ListOptions is the query options to a standard REST list call.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "labelSelector": { - SchemaProps: spec.SchemaProps{ - Description: "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - Type: []string{"string"}, - Format: "", - }, - }, - "fieldSelector": { - SchemaProps: spec.SchemaProps{ - Description: "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - Type: []string{"string"}, - Format: "", - }, - }, - "watch": { - SchemaProps: spec.SchemaProps{ - Description: "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "allowWatchBookmarks": { - SchemaProps: spec.SchemaProps{ - Description: "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "resourceVersion": { - SchemaProps: spec.SchemaProps{ - Description: "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceVersionMatch": { - SchemaProps: spec.SchemaProps{ - Description: "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - Type: []string{"string"}, - Format: "", - }, - }, - "timeoutSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "limit": { - SchemaProps: spec.SchemaProps{ - Description: "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "continue": { - SchemaProps: spec.SchemaProps{ - Description: "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - Type: []string{"string"}, - Format: "", - }, - }, - "sendInitialEvents": { - SchemaProps: spec.SchemaProps{ - Description: "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_ManagedFieldsEntry(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource that the fieldset applies to.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "manager": { - SchemaProps: spec.SchemaProps{ - Description: "Manager is an identifier of the workflow managing these fields.", - Type: []string{"string"}, - Format: "", - }, - }, - "operation": { - SchemaProps: spec.SchemaProps{ - Description: "Operation is the type of operation which lead to this ManagedFieldsEntry being created. The only valid values for this field are 'Apply' and 'Update'.", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the version of this resource that this field set applies to. The format is \"group/version\" just like the top-level APIVersion field. It is necessary to track the version of a field set because it cannot be automatically converted.", - Type: []string{"string"}, - Format: "", - }, - }, - "time": { - SchemaProps: spec.SchemaProps{ - Description: "Time is the timestamp of when the ManagedFields entry was added. The timestamp will also be updated if a field is added, the manager changes any of the owned fields value or removes a field. The timestamp does not update when a field is removed from the entry because another manager took it over.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "fieldsType": { - SchemaProps: spec.SchemaProps{ - Description: "FieldsType is the discriminator for the different fields format and version. There is currently only one possible value: \"FieldsV1\"", - Type: []string{"string"}, - Format: "", - }, - }, - "fieldsV1": { - SchemaProps: spec.SchemaProps{ - Description: "FieldsV1 holds the first JSON version format as described in the \"FieldsV1\" type.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1"), - }, - }, - "subresource": { - SchemaProps: spec.SchemaProps{ - Description: "Subresource is the name of the subresource used to update that object, or empty string if the object was updated through the main resource. The value of this field is used to distinguish between managers, even if they share the same name. For example, a status update will be distinct from a regular update using the same manager name. Note that the APIVersion field is not related to the Subresource field and it always corresponds to the version of the main resource.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_pkg_apis_meta_v1_MicroTime(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "MicroTime is version of Time with microsecond level precision.", - Type: v1.MicroTime{}.OpenAPISchemaType(), - Format: v1.MicroTime{}.OpenAPISchemaFormat(), - }, - }, - } -} - -func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names", - Type: []string{"string"}, - Format: "", - }, - }, - "generateName": { - SchemaProps: spec.SchemaProps{ - Description: "GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will return a 409.\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency", - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Description: "Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces", - Type: []string{"string"}, - Format: "", - }, - }, - "selfLink": { - SchemaProps: spec.SchemaProps{ - Description: "Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.", - Type: []string{"string"}, - Format: "", - }, - }, - "uid": { - SchemaProps: spec.SchemaProps{ - Description: "UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceVersion": { - SchemaProps: spec.SchemaProps{ - Description: "An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", - Type: []string{"string"}, - Format: "", - }, - }, - "generation": { - SchemaProps: spec.SchemaProps{ - Description: "A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "creationTimestamp": { - SchemaProps: spec.SchemaProps{ - Description: "CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "deletionTimestamp": { - SchemaProps: spec.SchemaProps{ - Description: "DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "deletionGracePeriodSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "labels": { - SchemaProps: spec.SchemaProps{ - Description: "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "annotations": { - SchemaProps: spec.SchemaProps{ - Description: "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "ownerReferences": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "uid", - }, - "x-kubernetes-list-type": "map", - "x-kubernetes-patch-merge-key": "uid", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference"), - }, - }, - }, - }, - }, - "finalizers": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "set", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "managedFields": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry", "k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_pkg_apis_meta_v1_OwnerReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "API version of the referent.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "uid": { - SchemaProps: spec.SchemaProps{ - Description: "UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "controller": { - SchemaProps: spec.SchemaProps{ - Description: "If true, this reference points to the managing controller.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "blockOwnerDeletion": { - SchemaProps: spec.SchemaProps{ - Description: "If true, AND if the owner has the \"foregroundDeletion\" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. See https://kubernetes.io/docs/concepts/architecture/garbage-collection/#foreground-deletion for how the garbage collector interacts with this field and enforces the foreground deletion. Defaults to false. To set this field, a user needs \"delete\" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"apiVersion", "kind", "name", "uid"}, - }, - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-map-type": "atomic", - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_PartialObjectMetadata(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PartialObjectMetadata is a generic representation of any object with ObjectMeta. It allows clients to get access to a particular ObjectMeta schema without knowing the details of the version.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_meta_v1_PartialObjectMetadataList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PartialObjectMetadataList contains a list of objects containing only their metadata", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "items contains each of the included items.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata"}, - } -} - -func schema_pkg_apis_meta_v1_Patch(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.", - Type: []string{"object"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_PatchOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PatchOptions may be provided when patching an API object. PatchOptions is meant to be a superset of UpdateOptions.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "dryRun": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "force": { - SchemaProps: spec.SchemaProps{ - Description: "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "fieldManager": { - SchemaProps: spec.SchemaProps{ - Description: "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", - Type: []string{"string"}, - Format: "", - }, - }, - "fieldValidation": { - SchemaProps: spec.SchemaProps{ - Description: "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_Preconditions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "uid": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies the target UID.", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceVersion": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies the target ResourceVersion", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_RootPaths(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RootPaths lists the paths available at root. For example: \"/healthz\", \"/apis\".", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "paths": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "paths are the paths available at root.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"paths"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_ServerAddressByClientCIDR(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "clientCIDR": { - SchemaProps: spec.SchemaProps{ - Description: "The CIDR with which clients can match their IP to figure out the server address that they should use.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "serverAddress": { - SchemaProps: spec.SchemaProps{ - Description: "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"clientCIDR", "serverAddress"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_Status(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Status is a return value for calls that don't return other objects.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status of the operation. One of: \"Success\" or \"Failure\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "A human-readable description of the status of this operation.", - Type: []string{"string"}, - Format: "", - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.", - Type: []string{"string"}, - Format: "", - }, - }, - "details": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails"), - }, - }, - "code": { - SchemaProps: spec.SchemaProps{ - Description: "Suggested HTTP return code for this status, 0 if not set.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails"}, - } -} - -func schema_pkg_apis_meta_v1_StatusCause(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "A machine-readable description of the cause of the error. If this value is empty there is no information available.", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "A human-readable description of the cause of the error. This field may be presented as-is to a reader.", - Type: []string{"string"}, - Format: "", - }, - }, - "field": { - SchemaProps: spec.SchemaProps{ - Description: "The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\"", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_StatusDetails(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).", - Type: []string{"string"}, - Format: "", - }, - }, - "group": { - SchemaProps: spec.SchemaProps{ - Description: "The group attribute of the resource associated with the status StatusReason.", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "uid": { - SchemaProps: spec.SchemaProps{ - Description: "UID of the resource. (when there is a single resource which can be described). More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", - Type: []string{"string"}, - Format: "", - }, - }, - "causes": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause"), - }, - }, - }, - }, - }, - "retryAfterSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause"}, - } -} - -func schema_pkg_apis_meta_v1_Table(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Table is a tabular representation of a set of API resources. The server transforms the object into a set of preferred columns for quickly reviewing the objects.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "columnDefinitions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "columnDefinitions describes each column in the returned items array. The number of cells per row will always match the number of column definitions.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition"), - }, - }, - }, - }, - }, - "rows": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "rows is the list of items in the table.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TableRow"), - }, - }, - }, - }, - }, - }, - Required: []string{"columnDefinitions", "rows"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition", "k8s.io/apimachinery/pkg/apis/meta/v1.TableRow"}, - } -} - -func schema_pkg_apis_meta_v1_TableColumnDefinition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TableColumnDefinition contains information about a column returned in the Table.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "name is a human readable name for the column.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "type": { - SchemaProps: spec.SchemaProps{ - Description: "type is an OpenAPI type definition for this column, such as number, integer, string, or array. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "format": { - SchemaProps: spec.SchemaProps{ - Description: "format is an optional OpenAPI type modifier for this column. A format modifies the type and imposes additional rules, like date or time formatting for a string. The 'name' format is applied to the primary identifier column which has type 'string' to assist in clients identifying column is the resource name. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "description": { - SchemaProps: spec.SchemaProps{ - Description: "description is a human readable description of this column.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "priority": { - SchemaProps: spec.SchemaProps{ - Description: "priority is an integer defining the relative importance of this column compared to others. Lower numbers are considered higher priority. Columns that may be omitted in limited space scenarios should be given a higher priority.", - Default: 0, - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"name", "type", "format", "description", "priority"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_TableOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TableOptions are used when a Table is requested by the caller.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "includeObject": { - SchemaProps: spec.SchemaProps{ - Description: "includeObject decides whether to include each object along with its columnar information. Specifying \"None\" will return no object, specifying \"Object\" will return the full object contents, and specifying \"Metadata\" (the default) will return the object's metadata in the PartialObjectMetadata kind in version v1beta1 of the meta.k8s.io API group.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_TableRow(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TableRow is an individual row in a table.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "cells": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "cells will be as wide as the column definitions array and may contain strings, numbers (float64 or int64), booleans, simple maps, lists, or null. See the type field of the column definition for a more detailed description.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Format: "", - }, - }, - }, - }, - }, - "conditions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "conditions describe additional status of a row that are relevant for a human user. These conditions apply to the row, not to the object, and will be specific to table output. The only defined condition type is 'Completed', for a row that indicates a resource that has run to completion and can be given less visual priority.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition"), - }, - }, - }, - }, - }, - "object": { - SchemaProps: spec.SchemaProps{ - Description: "This field contains the requested additional information about each object based on the includeObject policy when requesting the Table. If \"None\", this field is empty, if \"Object\" this will be the default serialization of the object for the current API version, and if \"Metadata\" (the default) will contain the object metadata. Check the returned kind and apiVersion of the object before parsing. The media type of the object will always match the enclosing list - if this as a JSON table, these will be JSON encoded objects.", - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), - }, - }, - }, - Required: []string{"cells"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, - } -} - -func schema_pkg_apis_meta_v1_TableRowCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TableRowCondition allows a row to be marked with additional information.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type of row condition. The only defined value is 'Completed' indicating that the object this row represents has reached a completed state and may be given less visual priority than other rows. Clients are not required to honor any conditions but should be consistent where possible about handling the conditions.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status of the condition, one of True, False, Unknown.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "(brief) machine readable reason for the condition's last transition.", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "Human readable message indicating details about last transition.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "status"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_Time(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.", - Type: v1.Time{}.OpenAPISchemaType(), - Format: v1.Time{}.OpenAPISchemaFormat(), - }, - }, - } -} - -func schema_pkg_apis_meta_v1_Timestamp(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Timestamp is a struct that is equivalent to Time, but intended for protobuf marshalling/unmarshalling. It is generated into a serialization that matches Time. Do not use in Go structs.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "seconds": { - SchemaProps: spec.SchemaProps{ - Description: "Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.", - Default: 0, - Type: []string{"integer"}, - Format: "int64", - }, - }, - "nanos": { - SchemaProps: spec.SchemaProps{ - Description: "Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. This field may be limited in precision depending on context.", - Default: 0, - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"seconds", "nanos"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_TypeMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TypeMeta describes an individual object in an API response or request with strings representing the type of the object and its API schema version. Structures that are versioned or persisted should inline TypeMeta.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_UpdateOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "UpdateOptions may be provided when updating an API object. All fields in UpdateOptions should also be present in PatchOptions.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "dryRun": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "fieldManager": { - SchemaProps: spec.SchemaProps{ - Description: "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", - Type: []string{"string"}, - Format: "", - }, - }, - "fieldValidation": { - SchemaProps: spec.SchemaProps{ - Description: "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_WatchEvent(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Event represents a single event to a watched resource.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "object": { - SchemaProps: spec.SchemaProps{ - Description: "Object is:\n * If Type is Added or Modified: the new state of the object.\n * If Type is Deleted: the state of the object immediately before deletion.\n * If Type is Error: *Status is recommended; other types may make sense\n depending on context.", - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), - }, - }, - }, - Required: []string{"type", "object"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/runtime.RawExtension"}, - } -} - -func schema_k8sio_apimachinery_pkg_runtime_RawExtension(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.Object `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// External package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// On the wire, the JSON will look something like this:\n\n\t{\n\t\t\"kind\":\"MyAPIObject\",\n\t\t\"apiVersion\":\"v1\",\n\t\t\"myPlugin\": {\n\t\t\t\"kind\":\"PluginA\",\n\t\t\t\"aOption\":\"foo\",\n\t\t},\n\t}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)", - Type: []string{"object"}, - }, - }, - } -} - -func schema_k8sio_apimachinery_pkg_runtime_TypeMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TypeMeta is shared by all top level objects. The proper way to use it is to inline it in your type, like this:\n\n\ttype MyAwesomeAPIObject struct {\n\t runtime.TypeMeta `json:\",inline\"`\n\t ... // other fields\n\t}\n\nfunc (obj *MyAwesomeAPIObject) SetGroupVersionKind(gvk *metav1.GroupVersionKind) { metav1.UpdateTypeMeta(obj,gvk) }; GroupVersionKind() *GroupVersionKind\n\nTypeMeta is provided here for convenience. You may use it directly from this package or define your own with the same fields.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_apimachinery_pkg_runtime_Unknown(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Unknown allows api objects with unknown types to be passed-through. This can be used to deal with the API objects from a plug-in. Unknown objects still have functioning TypeMeta features-- kind, version, etc. metadata and field mutatation.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "ContentEncoding": { - SchemaProps: spec.SchemaProps{ - Description: "ContentEncoding is encoding used to encode 'Raw' data. Unspecified means no encoding.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "ContentType": { - SchemaProps: spec.SchemaProps{ - Description: "ContentType is serialization method used to serialize 'Raw'. Unspecified means ContentTypeJSON.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"ContentEncoding", "ContentType"}, - }, - }, - } -} - -func schema_k8sio_apimachinery_pkg_version_Info(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Info contains versioning information. how we'll want to distribute that information.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "major": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "minor": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "gitVersion": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "gitCommit": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "gitTreeState": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "buildDate": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "goVersion": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "compiler": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "platform": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"major", "minor", "gitVersion", "gitCommit", "gitTreeState", "buildDate", "goVersion", "compiler", "platform"}, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apisx_v1alpha2_BackendTrafficPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "BackendTrafficPolicy defines the configuration for how traffic to a target backend should be handled.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the desired state of BackendTrafficPolicy.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha2.BackendTrafficPolicySpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status defines the current state of BackendTrafficPolicy.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyStatus"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyStatus", "sigs.k8s.io/gateway-api/apisx/v1alpha2.BackendTrafficPolicySpec"}, - } -} - -func schema_sigsk8sio_gateway_api_apisx_v1alpha2_BackendTrafficPolicyList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "BackendTrafficPolicyList contains a list of BackendTrafficPolicies", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha2.BackendTrafficPolicy"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/gateway-api/apisx/v1alpha2.BackendTrafficPolicy"}, - } -} - -func schema_sigsk8sio_gateway_api_apisx_v1alpha2_BackendTrafficPolicySpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "BackendTrafficPolicySpec define the desired state of BackendTrafficPolicy Note: there is no Override or Default policy configuration.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "targetRefs": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "group", - "kind", - "name", - }, - "x-kubernetes-list-type": "map", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "TargetRef identifies an API object to apply policy to. Currently, Backends (i.e. Service, ServiceImport, or any implementation-specific backendRef) are the only valid API target references.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.LocalPolicyTargetReference"), - }, - }, - }, - }, - }, - "retry": { - SchemaProps: spec.SchemaProps{ - Description: "RetryConstraint defines the configuration for when to allow or prevent further retries to a target backend by dynamically calculating a 'retry budget'. This budget is calculated based on the percentage of incoming traffic composed of retries over a given time interval. Once the budget is exceeded, additional retries will be rejected by the backend.\n\nFor example, if the retry budget interval is 10 seconds, there have been 1000 active requests in the past 10 seconds, and the allowed percentage of requests that can be retried is 20% (the default), then 200 of those requests may be composed of retries. Active requests will only be considered for the duration of the interval when calculating the retry budget.\n\nConfiguring a RetryConstraint in BackendTrafficPolicy is compatible with HTTPRoute Retry settings for each HTTPRouteRule that targets the same backend. While the HTTPRouteRule Retry stanza can specify whether a request should be retried and the number of retry attempts each client may perform, RetryConstraint helps prevent cascading failures, such as retry storms, during periods of consistent failures.\n\nAfter the retry budget has been exceeded, additional retries to the backend must return a 503 response to the client.\n\nAdditional configurations for defining a constraint on retries MAY be defined in the future.\n\nSupport: Extended\n\n", - Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha2.RetryConstraint"), - }, - }, - "sessionPersistence": { - SchemaProps: spec.SchemaProps{ - Description: "SessionPersistence defines and configures session persistence for the backend.\n\nSupport: Extended", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.SessionPersistence"), - }, - }, - }, - Required: []string{"targetRefs"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.SessionPersistence", "sigs.k8s.io/gateway-api/apis/v1alpha2.LocalPolicyTargetReference", "sigs.k8s.io/gateway-api/apisx/v1alpha2.RetryConstraint"}, - } -} - -func schema_sigsk8sio_gateway_api_apisx_v1alpha2_RequestRate(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RequestRate expresses a rate of requests over a given period of time.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "count": { - SchemaProps: spec.SchemaProps{ - Description: "Count specifies the number of requests per time interval.\n\nSupport: Extended", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "interval": { - SchemaProps: spec.SchemaProps{ - Description: "Interval specifies the divisor of the rate of requests, the amount of time during which the given count of requests occur.\n\nSupport: Extended", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_sigsk8sio_gateway_api_apisx_v1alpha2_RetryConstraint(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RetryConstraint defines the configuration for when to retry a request.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "budgetPercent": { - SchemaProps: spec.SchemaProps{ - Description: "BudgetPercent defines the maximum percentage of active requests that may be made up of retries.\n\nSupport: Extended", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "budgetInterval": { - SchemaProps: spec.SchemaProps{ - Description: "BudgetInterval defines the duration in which requests will be considered for calculating the budget for retries.\n\nSupport: Extended", - Type: []string{"string"}, - Format: "", - }, - }, - "minRetryRate": { - SchemaProps: spec.SchemaProps{ - Description: "MinRetryRate defines the minimum rate of retries that will be allowable over a specified duration of time.\n\nThis ensures that requests can still be retried during periods of low traffic, where the budget for retries may be calculated as a very low value.\n\nSupport: Extended", - Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha2.RequestRate"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apisx/v1alpha2.RequestRate"}, - } -} diff --git a/apisx/v1alpha2/doc.go b/apisx/v1alpha2/doc.go index f0040c2d02..dc8e54ac7f 100644 --- a/apisx/v1alpha2/doc.go +++ b/apisx/v1alpha2/doc.go @@ -17,4 +17,5 @@ limitations under the License. // +k8s:openapi-gen=true // +kubebuilder:object:generate=true // +groupName=gateway.networking.k8s-x.io +// +groupGoName=Experimental package v1alpha2 diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index d5b85167ac..df95733f3e 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -30,7 +30,7 @@ import ( gatewayv1alpha3 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3" gatewayv1beta1 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1" experimentalv1alpha1 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apisx/v1alpha1" - gatewayv1alpha2 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apisx/v1alpha2" + experimentalv1alpha2 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apisx/v1alpha2" ) type Interface interface { @@ -39,7 +39,7 @@ type Interface interface { GatewayV1alpha2() gatewayv1alpha2.GatewayV1alpha2Interface GatewayV1alpha3() gatewayv1alpha3.GatewayV1alpha3Interface GatewayV1beta1() gatewayv1beta1.GatewayV1beta1Interface - GatewayV1alpha2() gatewayv1alpha2.GatewayV1alpha2Interface + ExperimentalV1alpha2() experimentalv1alpha2.ExperimentalV1alpha2Interface ExperimentalV1alpha1() experimentalv1alpha1.ExperimentalV1alpha1Interface } @@ -50,7 +50,7 @@ type Clientset struct { gatewayV1alpha2 *gatewayv1alpha2.GatewayV1alpha2Client gatewayV1alpha3 *gatewayv1alpha3.GatewayV1alpha3Client gatewayV1beta1 *gatewayv1beta1.GatewayV1beta1Client - gatewayV1alpha2 *gatewayv1alpha2.GatewayV1alpha2Client + experimentalV1alpha2 *experimentalv1alpha2.ExperimentalV1alpha2Client experimentalV1alpha1 *experimentalv1alpha1.ExperimentalV1alpha1Client } @@ -74,9 +74,9 @@ func (c *Clientset) GatewayV1beta1() gatewayv1beta1.GatewayV1beta1Interface { return c.gatewayV1beta1 } -// GatewayV1alpha2 retrieves the GatewayV1alpha2Client -func (c *Clientset) GatewayV1alpha2() gatewayv1alpha2.GatewayV1alpha2Interface { - return c.gatewayV1alpha2 +// ExperimentalV1alpha2 retrieves the ExperimentalV1alpha2Client +func (c *Clientset) ExperimentalV1alpha2() experimentalv1alpha2.ExperimentalV1alpha2Interface { + return c.experimentalV1alpha2 } // ExperimentalV1alpha1 retrieves the ExperimentalV1alpha1Client @@ -144,7 +144,7 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } - cs.gatewayV1alpha2, err = gatewayv1alpha2.NewForConfigAndClient(&configShallowCopy, httpClient) + cs.experimentalV1alpha2, err = experimentalv1alpha2.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } @@ -177,7 +177,7 @@ func New(c rest.Interface) *Clientset { cs.gatewayV1alpha2 = gatewayv1alpha2.New(c) cs.gatewayV1alpha3 = gatewayv1alpha3.New(c) cs.gatewayV1beta1 = gatewayv1beta1.New(c) - cs.gatewayV1alpha2 = gatewayv1alpha2.New(c) + cs.experimentalV1alpha2 = experimentalv1alpha2.New(c) cs.experimentalV1alpha1 = experimentalv1alpha1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index 36af8b66e7..f6041f3950 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -36,8 +36,8 @@ import ( fakegatewayv1beta1 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake" experimentalv1alpha1 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apisx/v1alpha1" fakeexperimentalv1alpha1 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apisx/v1alpha1/fake" - gatewayv1alpha2 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apisx/v1alpha2" - fakegatewayv1alpha2 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apisx/v1alpha2/fake" + experimentalv1alpha2 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apisx/v1alpha2" + fakeexperimentalv1alpha2 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apisx/v1alpha2/fake" ) // NewSimpleClientset returns a clientset that will respond with the provided objects. @@ -146,9 +146,9 @@ func (c *Clientset) GatewayV1beta1() gatewayv1beta1.GatewayV1beta1Interface { return &fakegatewayv1beta1.FakeGatewayV1beta1{Fake: &c.Fake} } -// GatewayV1alpha2 retrieves the GatewayV1alpha2Client -func (c *Clientset) GatewayV1alpha2() gatewayv1alpha2.GatewayV1alpha2Interface { - return &fakegatewayv1alpha2.FakeGatewayV1alpha2{Fake: &c.Fake} +// ExperimentalV1alpha2 retrieves the ExperimentalV1alpha2Client +func (c *Clientset) ExperimentalV1alpha2() experimentalv1alpha2.ExperimentalV1alpha2Interface { + return &fakeexperimentalv1alpha2.FakeExperimentalV1alpha2{Fake: &c.Fake} } // ExperimentalV1alpha1 retrieves the ExperimentalV1alpha1Client diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index e7a7bf37d8..9a56265c5a 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -29,7 +29,7 @@ import ( gatewayv1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" experimentalv1alpha1 "sigs.k8s.io/gateway-api/apisx/v1alpha1" - gatewayv1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" + experimentalv1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" ) var scheme = runtime.NewScheme() @@ -40,7 +40,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ gatewayv1alpha2.AddToScheme, gatewayv1alpha3.AddToScheme, gatewayv1beta1.AddToScheme, - gatewayv1alpha2.AddToScheme, + experimentalv1alpha2.AddToScheme, experimentalv1alpha1.AddToScheme, } diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index 2c4d04cad2..e14bb7e7b9 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -29,7 +29,7 @@ import ( gatewayv1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" experimentalv1alpha1 "sigs.k8s.io/gateway-api/apisx/v1alpha1" - gatewayv1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" + experimentalv1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" ) var Scheme = runtime.NewScheme() @@ -40,7 +40,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ gatewayv1alpha2.AddToScheme, gatewayv1alpha3.AddToScheme, gatewayv1beta1.AddToScheme, - gatewayv1alpha2.AddToScheme, + experimentalv1alpha2.AddToScheme, experimentalv1alpha1.AddToScheme, } diff --git a/pkg/client/clientset/versioned/typed/apisx/v1alpha2/apisx_client.go b/pkg/client/clientset/versioned/typed/apisx/v1alpha2/apisx_client.go index 4457caac7e..a17f1d79f0 100644 --- a/pkg/client/clientset/versioned/typed/apisx/v1alpha2/apisx_client.go +++ b/pkg/client/clientset/versioned/typed/apisx/v1alpha2/apisx_client.go @@ -26,24 +26,24 @@ import ( "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) -type GatewayV1alpha2Interface interface { +type ExperimentalV1alpha2Interface interface { RESTClient() rest.Interface BackendTrafficPoliciesGetter } -// GatewayV1alpha2Client is used to interact with features provided by the gateway.networking.k8s-x.io group. -type GatewayV1alpha2Client struct { +// ExperimentalV1alpha2Client is used to interact with features provided by the gateway.networking.k8s-x.io group. +type ExperimentalV1alpha2Client struct { restClient rest.Interface } -func (c *GatewayV1alpha2Client) BackendTrafficPolicies(namespace string) BackendTrafficPolicyInterface { +func (c *ExperimentalV1alpha2Client) BackendTrafficPolicies(namespace string) BackendTrafficPolicyInterface { return newBackendTrafficPolicies(c, namespace) } -// NewForConfig creates a new GatewayV1alpha2Client for the given config. +// NewForConfig creates a new ExperimentalV1alpha2Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*GatewayV1alpha2Client, error) { +func NewForConfig(c *rest.Config) (*ExperimentalV1alpha2Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -55,9 +55,9 @@ func NewForConfig(c *rest.Config) (*GatewayV1alpha2Client, error) { return NewForConfigAndClient(&config, httpClient) } -// NewForConfigAndClient creates a new GatewayV1alpha2Client for the given config and http client. +// NewForConfigAndClient creates a new ExperimentalV1alpha2Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. -func NewForConfigAndClient(c *rest.Config, h *http.Client) (*GatewayV1alpha2Client, error) { +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ExperimentalV1alpha2Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -66,12 +66,12 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*GatewayV1alpha2Clie if err != nil { return nil, err } - return &GatewayV1alpha2Client{client}, nil + return &ExperimentalV1alpha2Client{client}, nil } -// NewForConfigOrDie creates a new GatewayV1alpha2Client for the given config and +// NewForConfigOrDie creates a new ExperimentalV1alpha2Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *GatewayV1alpha2Client { +func NewForConfigOrDie(c *rest.Config) *ExperimentalV1alpha2Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -79,9 +79,9 @@ func NewForConfigOrDie(c *rest.Config) *GatewayV1alpha2Client { return client } -// New creates a new GatewayV1alpha2Client for the given RESTClient. -func New(c rest.Interface) *GatewayV1alpha2Client { - return &GatewayV1alpha2Client{c} +// New creates a new ExperimentalV1alpha2Client for the given RESTClient. +func New(c rest.Interface) *ExperimentalV1alpha2Client { + return &ExperimentalV1alpha2Client{c} } func setConfigDefaults(config *rest.Config) error { @@ -99,7 +99,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *GatewayV1alpha2Client) RESTClient() rest.Interface { +func (c *ExperimentalV1alpha2Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/pkg/client/clientset/versioned/typed/apisx/v1alpha2/backendtrafficpolicy.go b/pkg/client/clientset/versioned/typed/apisx/v1alpha2/backendtrafficpolicy.go index f234c3001b..e042141b13 100644 --- a/pkg/client/clientset/versioned/typed/apisx/v1alpha2/backendtrafficpolicy.go +++ b/pkg/client/clientset/versioned/typed/apisx/v1alpha2/backendtrafficpolicy.go @@ -60,7 +60,7 @@ type backendTrafficPolicies struct { } // newBackendTrafficPolicies returns a BackendTrafficPolicies -func newBackendTrafficPolicies(c *GatewayV1alpha2Client, namespace string) *backendTrafficPolicies { +func newBackendTrafficPolicies(c *ExperimentalV1alpha2Client, namespace string) *backendTrafficPolicies { return &backendTrafficPolicies{ gentype.NewClientWithListAndApply[*v1alpha2.BackendTrafficPolicy, *v1alpha2.BackendTrafficPolicyList, *apisxv1alpha2.BackendTrafficPolicyApplyConfiguration]( "backendtrafficpolicies", diff --git a/pkg/client/clientset/versioned/typed/apisx/v1alpha2/fake/fake_apisx_client.go b/pkg/client/clientset/versioned/typed/apisx/v1alpha2/fake/fake_apisx_client.go index f5c1d6b3c0..3a65546f2e 100644 --- a/pkg/client/clientset/versioned/typed/apisx/v1alpha2/fake/fake_apisx_client.go +++ b/pkg/client/clientset/versioned/typed/apisx/v1alpha2/fake/fake_apisx_client.go @@ -24,17 +24,17 @@ import ( v1alpha2 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apisx/v1alpha2" ) -type FakeGatewayV1alpha2 struct { +type FakeExperimentalV1alpha2 struct { *testing.Fake } -func (c *FakeGatewayV1alpha2) BackendTrafficPolicies(namespace string) v1alpha2.BackendTrafficPolicyInterface { +func (c *FakeExperimentalV1alpha2) BackendTrafficPolicies(namespace string) v1alpha2.BackendTrafficPolicyInterface { return &FakeBackendTrafficPolicies{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeGatewayV1alpha2) RESTClient() rest.Interface { +func (c *FakeExperimentalV1alpha2) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/pkg/client/clientset/versioned/typed/apisx/v1alpha2/fake/fake_backendtrafficpolicy.go b/pkg/client/clientset/versioned/typed/apisx/v1alpha2/fake/fake_backendtrafficpolicy.go index 303b9669ee..58e28ddc86 100644 --- a/pkg/client/clientset/versioned/typed/apisx/v1alpha2/fake/fake_backendtrafficpolicy.go +++ b/pkg/client/clientset/versioned/typed/apisx/v1alpha2/fake/fake_backendtrafficpolicy.go @@ -34,7 +34,7 @@ import ( // FakeBackendTrafficPolicies implements BackendTrafficPolicyInterface type FakeBackendTrafficPolicies struct { - Fake *FakeGatewayV1alpha2 + Fake *FakeExperimentalV1alpha2 ns string } diff --git a/pkg/client/informers/externalversions/apisx/v1alpha2/backendtrafficpolicy.go b/pkg/client/informers/externalversions/apisx/v1alpha2/backendtrafficpolicy.go index 8609c5fb67..45b3508436 100644 --- a/pkg/client/informers/externalversions/apisx/v1alpha2/backendtrafficpolicy.go +++ b/pkg/client/informers/externalversions/apisx/v1alpha2/backendtrafficpolicy.go @@ -62,13 +62,13 @@ func NewFilteredBackendTrafficPolicyInformer(client versioned.Interface, namespa if tweakListOptions != nil { tweakListOptions(&options) } - return client.GatewayV1alpha2().BackendTrafficPolicies(namespace).List(context.TODO(), options) + return client.ExperimentalV1alpha2().BackendTrafficPolicies(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.GatewayV1alpha2().BackendTrafficPolicies(namespace).Watch(context.TODO(), options) + return client.ExperimentalV1alpha2().BackendTrafficPolicies(namespace).Watch(context.TODO(), options) }, }, &apisxv1alpha2.BackendTrafficPolicy{}, diff --git a/pkg/clientx/clientset/versioned/clientset.go b/pkg/clientx/clientset/versioned/clientset.go deleted file mode 100644 index bcd9673959..0000000000 --- a/pkg/clientx/clientset/versioned/clientset.go +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package versioned - -import ( - "fmt" - "net/http" - - discovery "k8s.io/client-go/discovery" - rest "k8s.io/client-go/rest" - flowcontrol "k8s.io/client-go/util/flowcontrol" - gatewayv1alpha2 "sigs.k8s.io/gateway-api/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2" -) - -type Interface interface { - Discovery() discovery.DiscoveryInterface - GatewayV1alpha2() gatewayv1alpha2.GatewayV1alpha2Interface -} - -// Clientset contains the clients for groups. -type Clientset struct { - *discovery.DiscoveryClient - gatewayV1alpha2 *gatewayv1alpha2.GatewayV1alpha2Client -} - -// GatewayV1alpha2 retrieves the GatewayV1alpha2Client -func (c *Clientset) GatewayV1alpha2() gatewayv1alpha2.GatewayV1alpha2Interface { - return c.gatewayV1alpha2 -} - -// Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - if c == nil { - return nil - } - return c.DiscoveryClient -} - -// NewForConfig creates a new Clientset for the given config. -// If config's RateLimiter is not set and QPS and Burst are acceptable, -// NewForConfig will generate a rate-limiter in configShallowCopy. -// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), -// where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*Clientset, error) { - configShallowCopy := *c - - if configShallowCopy.UserAgent == "" { - configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() - } - - // share the transport between all clients - httpClient, err := rest.HTTPClientFor(&configShallowCopy) - if err != nil { - return nil, err - } - - return NewForConfigAndClient(&configShallowCopy, httpClient) -} - -// NewForConfigAndClient creates a new Clientset for the given config and http client. -// Note the http client provided takes precedence over the configured transport values. -// If config's RateLimiter is not set and QPS and Burst are acceptable, -// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. -func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { - configShallowCopy := *c - if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { - if configShallowCopy.Burst <= 0 { - return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") - } - configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) - } - - var cs Clientset - var err error - cs.gatewayV1alpha2, err = gatewayv1alpha2.NewForConfigAndClient(&configShallowCopy, httpClient) - if err != nil { - return nil, err - } - - cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) - if err != nil { - return nil, err - } - return &cs, nil -} - -// NewForConfigOrDie creates a new Clientset for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *Clientset { - cs, err := NewForConfig(c) - if err != nil { - panic(err) - } - return cs -} - -// New creates a new Clientset for the given RESTClient. -func New(c rest.Interface) *Clientset { - var cs Clientset - cs.gatewayV1alpha2 = gatewayv1alpha2.New(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClient(c) - return &cs -} diff --git a/pkg/clientx/clientset/versioned/fake/clientset_generated.go b/pkg/clientx/clientset/versioned/fake/clientset_generated.go deleted file mode 100644 index d34e83fbd6..0000000000 --- a/pkg/clientx/clientset/versioned/fake/clientset_generated.go +++ /dev/null @@ -1,122 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/discovery" - fakediscovery "k8s.io/client-go/discovery/fake" - "k8s.io/client-go/testing" - applyconfiguration "sigs.k8s.io/gateway-api/apisx/applyconfiguration" - clientset "sigs.k8s.io/gateway-api/pkg/clientx/clientset/versioned" - gatewayv1alpha2 "sigs.k8s.io/gateway-api/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2" - fakegatewayv1alpha2 "sigs.k8s.io/gateway-api/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake" -) - -// NewSimpleClientset returns a clientset that will respond with the provided objects. -// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement -// for a real clientset and is mostly useful in simple unit tests. -// -// DEPRECATED: NewClientset replaces this with support for field management, which significantly improves -// server side apply testing. NewClientset is only available when apply configurations are generated (e.g. -// via --with-applyconfig). -func NewSimpleClientset(objects ...runtime.Object) *Clientset { - o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) - for _, obj := range objects { - if err := o.Add(obj); err != nil { - panic(err) - } - } - - cs := &Clientset{tracker: o} - cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} - cs.AddReactor("*", "*", testing.ObjectReaction(o)) - cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { - gvr := action.GetResource() - ns := action.GetNamespace() - watch, err := o.Watch(gvr, ns) - if err != nil { - return false, nil, err - } - return true, watch, nil - }) - - return cs -} - -// Clientset implements clientset.Interface. Meant to be embedded into a -// struct to get a default implementation. This makes faking out just the method -// you want to test easier. -type Clientset struct { - testing.Fake - discovery *fakediscovery.FakeDiscovery - tracker testing.ObjectTracker -} - -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - return c.discovery -} - -func (c *Clientset) Tracker() testing.ObjectTracker { - return c.tracker -} - -// NewClientset 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 -// for a real clientset and is mostly useful in simple unit tests. -func NewClientset(objects ...runtime.Object) *Clientset { - o := testing.NewFieldManagedObjectTracker( - scheme, - codecs.UniversalDecoder(), - applyconfiguration.NewTypeConverter(scheme), - ) - for _, obj := range objects { - if err := o.Add(obj); err != nil { - panic(err) - } - } - - cs := &Clientset{tracker: o} - cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} - cs.AddReactor("*", "*", testing.ObjectReaction(o)) - cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { - gvr := action.GetResource() - ns := action.GetNamespace() - watch, err := o.Watch(gvr, ns) - if err != nil { - return false, nil, err - } - return true, watch, nil - }) - - return cs -} - -var ( - _ clientset.Interface = &Clientset{} - _ testing.FakeClient = &Clientset{} -) - -// GatewayV1alpha2 retrieves the GatewayV1alpha2Client -func (c *Clientset) GatewayV1alpha2() gatewayv1alpha2.GatewayV1alpha2Interface { - return &fakegatewayv1alpha2.FakeGatewayV1alpha2{Fake: &c.Fake} -} diff --git a/pkg/clientx/clientset/versioned/fake/doc.go b/pkg/clientx/clientset/versioned/fake/doc.go deleted file mode 100644 index 9b99e71670..0000000000 --- a/pkg/clientx/clientset/versioned/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated fake clientset. -package fake diff --git a/pkg/clientx/clientset/versioned/fake/register.go b/pkg/clientx/clientset/versioned/fake/register.go deleted file mode 100644 index 00545e05f4..0000000000 --- a/pkg/clientx/clientset/versioned/fake/register.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - gatewayv1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" -) - -var scheme = runtime.NewScheme() -var codecs = serializer.NewCodecFactory(scheme) - -var localSchemeBuilder = runtime.SchemeBuilder{ - gatewayv1alpha2.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(scheme)) -} diff --git a/pkg/clientx/clientset/versioned/scheme/doc.go b/pkg/clientx/clientset/versioned/scheme/doc.go deleted file mode 100644 index 7dc3756168..0000000000 --- a/pkg/clientx/clientset/versioned/scheme/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package contains the scheme of the automatically generated clientset. -package scheme diff --git a/pkg/clientx/clientset/versioned/scheme/register.go b/pkg/clientx/clientset/versioned/scheme/register.go deleted file mode 100644 index 74ac3ad54a..0000000000 --- a/pkg/clientx/clientset/versioned/scheme/register.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package scheme - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - gatewayv1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" -) - -var Scheme = runtime.NewScheme() -var Codecs = serializer.NewCodecFactory(Scheme) -var ParameterCodec = runtime.NewParameterCodec(Scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - gatewayv1alpha2.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(Scheme)) -} diff --git a/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/apisx_client.go b/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/apisx_client.go deleted file mode 100644 index 1bd8a8caa0..0000000000 --- a/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/apisx_client.go +++ /dev/null @@ -1,107 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "net/http" - - rest "k8s.io/client-go/rest" - v1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" - "sigs.k8s.io/gateway-api/pkg/clientx/clientset/versioned/scheme" -) - -type GatewayV1alpha2Interface interface { - RESTClient() rest.Interface - BackendTrafficPoliciesGetter -} - -// GatewayV1alpha2Client is used to interact with features provided by the gateway.networking.k8s-x.io group. -type GatewayV1alpha2Client struct { - restClient rest.Interface -} - -func (c *GatewayV1alpha2Client) BackendTrafficPolicies(namespace string) BackendTrafficPolicyInterface { - return newBackendTrafficPolicies(c, namespace) -} - -// NewForConfig creates a new GatewayV1alpha2Client for the given config. -// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), -// where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*GatewayV1alpha2Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - httpClient, err := rest.HTTPClientFor(&config) - if err != nil { - return nil, err - } - return NewForConfigAndClient(&config, httpClient) -} - -// NewForConfigAndClient creates a new GatewayV1alpha2Client for the given config and http client. -// Note the http client provided takes precedence over the configured transport values. -func NewForConfigAndClient(c *rest.Config, h *http.Client) (*GatewayV1alpha2Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientForConfigAndClient(&config, h) - if err != nil { - return nil, err - } - return &GatewayV1alpha2Client{client}, nil -} - -// NewForConfigOrDie creates a new GatewayV1alpha2Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *GatewayV1alpha2Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new GatewayV1alpha2Client for the given RESTClient. -func New(c rest.Interface) *GatewayV1alpha2Client { - return &GatewayV1alpha2Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1alpha2.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *GatewayV1alpha2Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/backendtrafficpolicy.go b/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/backendtrafficpolicy.go deleted file mode 100644 index 5ff0a5219e..0000000000 --- a/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/backendtrafficpolicy.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - gentype "k8s.io/client-go/gentype" - apisxv1alpha2 "sigs.k8s.io/gateway-api/apisx/applyconfiguration/apisx/v1alpha2" - v1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" - scheme "sigs.k8s.io/gateway-api/pkg/clientx/clientset/versioned/scheme" -) - -// BackendTrafficPoliciesGetter has a method to return a BackendTrafficPolicyInterface. -// A group's client should implement this interface. -type BackendTrafficPoliciesGetter interface { - BackendTrafficPolicies(namespace string) BackendTrafficPolicyInterface -} - -// BackendTrafficPolicyInterface has methods to work with BackendTrafficPolicy resources. -type BackendTrafficPolicyInterface interface { - Create(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.CreateOptions) (*v1alpha2.BackendTrafficPolicy, error) - Update(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.UpdateOptions) (*v1alpha2.BackendTrafficPolicy, error) - // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.UpdateOptions) (*v1alpha2.BackendTrafficPolicy, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.BackendTrafficPolicy, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.BackendTrafficPolicyList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.BackendTrafficPolicy, err error) - Apply(ctx context.Context, backendTrafficPolicy *apisxv1alpha2.BackendTrafficPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendTrafficPolicy, err error) - // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). - ApplyStatus(ctx context.Context, backendTrafficPolicy *apisxv1alpha2.BackendTrafficPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendTrafficPolicy, err error) - BackendTrafficPolicyExpansion -} - -// backendTrafficPolicies implements BackendTrafficPolicyInterface -type backendTrafficPolicies struct { - *gentype.ClientWithListAndApply[*v1alpha2.BackendTrafficPolicy, *v1alpha2.BackendTrafficPolicyList, *apisxv1alpha2.BackendTrafficPolicyApplyConfiguration] -} - -// newBackendTrafficPolicies returns a BackendTrafficPolicies -func newBackendTrafficPolicies(c *GatewayV1alpha2Client, namespace string) *backendTrafficPolicies { - return &backendTrafficPolicies{ - gentype.NewClientWithListAndApply[*v1alpha2.BackendTrafficPolicy, *v1alpha2.BackendTrafficPolicyList, *apisxv1alpha2.BackendTrafficPolicyApplyConfiguration]( - "backendtrafficpolicies", - c.RESTClient(), - scheme.ParameterCodec, - namespace, - func() *v1alpha2.BackendTrafficPolicy { return &v1alpha2.BackendTrafficPolicy{} }, - func() *v1alpha2.BackendTrafficPolicyList { return &v1alpha2.BackendTrafficPolicyList{} }), - } -} diff --git a/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/doc.go b/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/doc.go deleted file mode 100644 index baaf2d9853..0000000000 --- a/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1alpha2 diff --git a/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake/doc.go b/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake/doc.go deleted file mode 100644 index 16f4439906..0000000000 --- a/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake/fake_apisx_client.go b/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake/fake_apisx_client.go deleted file mode 100644 index e10c727845..0000000000 --- a/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake/fake_apisx_client.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" - v1alpha2 "sigs.k8s.io/gateway-api/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2" -) - -type FakeGatewayV1alpha2 struct { - *testing.Fake -} - -func (c *FakeGatewayV1alpha2) BackendTrafficPolicies(namespace string) v1alpha2.BackendTrafficPolicyInterface { - return &FakeBackendTrafficPolicies{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeGatewayV1alpha2) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake/fake_backendtrafficpolicy.go b/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake/fake_backendtrafficpolicy.go deleted file mode 100644 index cee9f4fbe4..0000000000 --- a/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/fake/fake_backendtrafficpolicy.go +++ /dev/null @@ -1,197 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "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" - apisxv1alpha2 "sigs.k8s.io/gateway-api/apisx/applyconfiguration/apisx/v1alpha2" - v1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" -) - -// FakeBackendTrafficPolicies implements BackendTrafficPolicyInterface -type FakeBackendTrafficPolicies struct { - Fake *FakeGatewayV1alpha2 - ns string -} - -var backendtrafficpoliciesResource = v1alpha2.SchemeGroupVersion.WithResource("backendtrafficpolicies") - -var backendtrafficpoliciesKind = v1alpha2.SchemeGroupVersion.WithKind("BackendTrafficPolicy") - -// Get takes name of the backendTrafficPolicy, and returns the corresponding backendTrafficPolicy object, and an error if there is any. -func (c *FakeBackendTrafficPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { - emptyResult := &v1alpha2.BackendTrafficPolicy{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(backendtrafficpoliciesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BackendTrafficPolicy), err -} - -// List takes label and field selectors, and returns the list of BackendTrafficPolicies that match those selectors. -func (c *FakeBackendTrafficPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.BackendTrafficPolicyList, err error) { - emptyResult := &v1alpha2.BackendTrafficPolicyList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(backendtrafficpoliciesResource, backendtrafficpoliciesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.BackendTrafficPolicyList{ListMeta: obj.(*v1alpha2.BackendTrafficPolicyList).ListMeta} - for _, item := range obj.(*v1alpha2.BackendTrafficPolicyList).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 backendTrafficPolicies. -func (c *FakeBackendTrafficPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(backendtrafficpoliciesResource, c.ns, opts)) - -} - -// Create takes the representation of a backendTrafficPolicy and creates it. Returns the server's representation of the backendTrafficPolicy, and an error, if there is any. -func (c *FakeBackendTrafficPolicies) Create(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.CreateOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { - emptyResult := &v1alpha2.BackendTrafficPolicy{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(backendtrafficpoliciesResource, c.ns, backendTrafficPolicy, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BackendTrafficPolicy), err -} - -// Update takes the representation of a backendTrafficPolicy and updates it. Returns the server's representation of the backendTrafficPolicy, and an error, if there is any. -func (c *FakeBackendTrafficPolicies) Update(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.UpdateOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { - emptyResult := &v1alpha2.BackendTrafficPolicy{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(backendtrafficpoliciesResource, c.ns, backendTrafficPolicy, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BackendTrafficPolicy), 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 *FakeBackendTrafficPolicies) UpdateStatus(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.UpdateOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { - emptyResult := &v1alpha2.BackendTrafficPolicy{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(backendtrafficpoliciesResource, "status", c.ns, backendTrafficPolicy, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BackendTrafficPolicy), err -} - -// Delete takes name of the backendTrafficPolicy and deletes it. Returns an error if one occurs. -func (c *FakeBackendTrafficPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(backendtrafficpoliciesResource, c.ns, name, opts), &v1alpha2.BackendTrafficPolicy{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeBackendTrafficPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(backendtrafficpoliciesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.BackendTrafficPolicyList{}) - return err -} - -// Patch applies the patch and returns the patched backendTrafficPolicy. -func (c *FakeBackendTrafficPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.BackendTrafficPolicy, err error) { - emptyResult := &v1alpha2.BackendTrafficPolicy{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(backendtrafficpoliciesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BackendTrafficPolicy), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied backendTrafficPolicy. -func (c *FakeBackendTrafficPolicies) Apply(ctx context.Context, backendTrafficPolicy *apisxv1alpha2.BackendTrafficPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { - if backendTrafficPolicy == nil { - return nil, fmt.Errorf("backendTrafficPolicy provided to Apply must not be nil") - } - data, err := json.Marshal(backendTrafficPolicy) - if err != nil { - return nil, err - } - name := backendTrafficPolicy.Name - if name == nil { - return nil, fmt.Errorf("backendTrafficPolicy.Name must be provided to Apply") - } - emptyResult := &v1alpha2.BackendTrafficPolicy{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(backendtrafficpoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BackendTrafficPolicy), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeBackendTrafficPolicies) ApplyStatus(ctx context.Context, backendTrafficPolicy *apisxv1alpha2.BackendTrafficPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { - if backendTrafficPolicy == nil { - return nil, fmt.Errorf("backendTrafficPolicy provided to Apply must not be nil") - } - data, err := json.Marshal(backendTrafficPolicy) - if err != nil { - return nil, err - } - name := backendTrafficPolicy.Name - if name == nil { - return nil, fmt.Errorf("backendTrafficPolicy.Name must be provided to Apply") - } - emptyResult := &v1alpha2.BackendTrafficPolicy{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(backendtrafficpoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BackendTrafficPolicy), err -} diff --git a/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/generated_expansion.go b/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/generated_expansion.go deleted file mode 100644 index 2ca07ad3bf..0000000000 --- a/pkg/clientx/clientset/versioned/typed/apisx/v1alpha2/generated_expansion.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha2 - -type BackendTrafficPolicyExpansion interface{} diff --git a/pkg/clientx/informers/externalversions/apisx/interface.go b/pkg/clientx/informers/externalversions/apisx/interface.go deleted file mode 100644 index 0b7ed24fe5..0000000000 --- a/pkg/clientx/informers/externalversions/apisx/interface.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package apisx - -import ( - v1alpha2 "sigs.k8s.io/gateway-api/pkg/clientx/informers/externalversions/apisx/v1alpha2" - internalinterfaces "sigs.k8s.io/gateway-api/pkg/clientx/informers/externalversions/internalinterfaces" -) - -// Interface provides access to each of this group's versions. -type Interface interface { - // V1alpha2 provides access to shared informers for resources in V1alpha2. - V1alpha2() v1alpha2.Interface -} - -type group struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// V1alpha2 returns a new v1alpha2.Interface. -func (g *group) V1alpha2() v1alpha2.Interface { - return v1alpha2.New(g.factory, g.namespace, g.tweakListOptions) -} diff --git a/pkg/clientx/informers/externalversions/apisx/v1alpha2/backendtrafficpolicy.go b/pkg/clientx/informers/externalversions/apisx/v1alpha2/backendtrafficpolicy.go deleted file mode 100644 index 0d944706ea..0000000000 --- a/pkg/clientx/informers/externalversions/apisx/v1alpha2/backendtrafficpolicy.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "context" - time "time" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" - apisxv1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" - versioned "sigs.k8s.io/gateway-api/pkg/clientx/clientset/versioned" - internalinterfaces "sigs.k8s.io/gateway-api/pkg/clientx/informers/externalversions/internalinterfaces" - v1alpha2 "sigs.k8s.io/gateway-api/pkg/clientx/listers/apisx/v1alpha2" -) - -// BackendTrafficPolicyInformer provides access to a shared informer and lister for -// BackendTrafficPolicies. -type BackendTrafficPolicyInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha2.BackendTrafficPolicyLister -} - -type backendTrafficPolicyInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewBackendTrafficPolicyInformer constructs a new informer for BackendTrafficPolicy type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewBackendTrafficPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredBackendTrafficPolicyInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredBackendTrafficPolicyInformer constructs a new informer for BackendTrafficPolicy type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredBackendTrafficPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.GatewayV1alpha2().BackendTrafficPolicies(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.GatewayV1alpha2().BackendTrafficPolicies(namespace).Watch(context.TODO(), options) - }, - }, - &apisxv1alpha2.BackendTrafficPolicy{}, - resyncPeriod, - indexers, - ) -} - -func (f *backendTrafficPolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredBackendTrafficPolicyInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *backendTrafficPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisxv1alpha2.BackendTrafficPolicy{}, f.defaultInformer) -} - -func (f *backendTrafficPolicyInformer) Lister() v1alpha2.BackendTrafficPolicyLister { - return v1alpha2.NewBackendTrafficPolicyLister(f.Informer().GetIndexer()) -} diff --git a/pkg/clientx/informers/externalversions/apisx/v1alpha2/interface.go b/pkg/clientx/informers/externalversions/apisx/v1alpha2/interface.go deleted file mode 100644 index 6c901cbd9c..0000000000 --- a/pkg/clientx/informers/externalversions/apisx/v1alpha2/interface.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - internalinterfaces "sigs.k8s.io/gateway-api/pkg/clientx/informers/externalversions/internalinterfaces" -) - -// Interface provides access to all the informers in this group version. -type Interface interface { - // BackendTrafficPolicies returns a BackendTrafficPolicyInformer. - BackendTrafficPolicies() BackendTrafficPolicyInformer -} - -type version struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// BackendTrafficPolicies returns a BackendTrafficPolicyInformer. -func (v *version) BackendTrafficPolicies() BackendTrafficPolicyInformer { - return &backendTrafficPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} diff --git a/pkg/clientx/informers/externalversions/factory.go b/pkg/clientx/informers/externalversions/factory.go deleted file mode 100644 index e1e5b181b6..0000000000 --- a/pkg/clientx/informers/externalversions/factory.go +++ /dev/null @@ -1,262 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package externalversions - -import ( - reflect "reflect" - sync "sync" - time "time" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - cache "k8s.io/client-go/tools/cache" - versioned "sigs.k8s.io/gateway-api/pkg/clientx/clientset/versioned" - apisx "sigs.k8s.io/gateway-api/pkg/clientx/informers/externalversions/apisx" - internalinterfaces "sigs.k8s.io/gateway-api/pkg/clientx/informers/externalversions/internalinterfaces" -) - -// SharedInformerOption defines the functional option type for SharedInformerFactory. -type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory - -type sharedInformerFactory struct { - client versioned.Interface - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc - lock sync.Mutex - defaultResync time.Duration - customResync map[reflect.Type]time.Duration - transform cache.TransformFunc - - informers map[reflect.Type]cache.SharedIndexInformer - // startedInformers is used for tracking which informers have been started. - // This allows Start() to be called multiple times safely. - startedInformers map[reflect.Type]bool - // wg tracks how many goroutines were started. - wg sync.WaitGroup - // shuttingDown is true when Shutdown has been called. It may still be running - // because it needs to wait for goroutines. - shuttingDown bool -} - -// WithCustomResyncConfig sets a custom resync period for the specified informer types. -func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - for k, v := range resyncConfig { - factory.customResync[reflect.TypeOf(k)] = v - } - return factory - } -} - -// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. -func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.tweakListOptions = tweakListOptions - return factory - } -} - -// WithNamespace limits the SharedInformerFactory to the specified namespace. -func WithNamespace(namespace string) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.namespace = namespace - return factory - } -} - -// WithTransform sets a transform on all informers. -func WithTransform(transform cache.TransformFunc) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.transform = transform - return factory - } -} - -// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. -func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { - return NewSharedInformerFactoryWithOptions(client, defaultResync) -} - -// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. -// Listers obtained via this SharedInformerFactory will be subject to the same filters -// as specified here. -// Deprecated: Please use NewSharedInformerFactoryWithOptions instead -func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { - return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) -} - -// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. -func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { - factory := &sharedInformerFactory{ - client: client, - namespace: v1.NamespaceAll, - defaultResync: defaultResync, - informers: make(map[reflect.Type]cache.SharedIndexInformer), - startedInformers: make(map[reflect.Type]bool), - customResync: make(map[reflect.Type]time.Duration), - } - - // Apply all options - for _, opt := range options { - factory = opt(factory) - } - - return factory -} - -func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { - f.lock.Lock() - defer f.lock.Unlock() - - if f.shuttingDown { - return - } - - for informerType, informer := range f.informers { - if !f.startedInformers[informerType] { - f.wg.Add(1) - // We need a new variable in each loop iteration, - // otherwise the goroutine would use the loop variable - // and that keeps changing. - informer := informer - go func() { - defer f.wg.Done() - informer.Run(stopCh) - }() - f.startedInformers[informerType] = true - } - } -} - -func (f *sharedInformerFactory) Shutdown() { - f.lock.Lock() - f.shuttingDown = true - f.lock.Unlock() - - // Will return immediately if there is nothing to wait for. - f.wg.Wait() -} - -func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { - informers := func() map[reflect.Type]cache.SharedIndexInformer { - f.lock.Lock() - defer f.lock.Unlock() - - informers := map[reflect.Type]cache.SharedIndexInformer{} - for informerType, informer := range f.informers { - if f.startedInformers[informerType] { - informers[informerType] = informer - } - } - return informers - }() - - res := map[reflect.Type]bool{} - for informType, informer := range informers { - res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) - } - return res -} - -// InformerFor returns the SharedIndexInformer for obj using an internal -// client. -func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { - f.lock.Lock() - defer f.lock.Unlock() - - informerType := reflect.TypeOf(obj) - informer, exists := f.informers[informerType] - if exists { - return informer - } - - resyncPeriod, exists := f.customResync[informerType] - if !exists { - resyncPeriod = f.defaultResync - } - - informer = newFunc(f.client, resyncPeriod) - informer.SetTransform(f.transform) - f.informers[informerType] = informer - - return informer -} - -// SharedInformerFactory provides shared informers for resources in all known -// API group versions. -// -// It is typically used like this: -// -// ctx, cancel := context.Background() -// defer cancel() -// factory := NewSharedInformerFactory(client, resyncPeriod) -// defer factory.WaitForStop() // Returns immediately if nothing was started. -// genericInformer := factory.ForResource(resource) -// typedInformer := factory.SomeAPIGroup().V1().SomeType() -// factory.Start(ctx.Done()) // Start processing these informers. -// synced := factory.WaitForCacheSync(ctx.Done()) -// for v, ok := range synced { -// if !ok { -// fmt.Fprintf(os.Stderr, "caches failed to sync: %v", v) -// return -// } -// } -// -// // Creating informers can also be created after Start, but then -// // Start must be called again: -// anotherGenericInformer := factory.ForResource(resource) -// factory.Start(ctx.Done()) -type SharedInformerFactory interface { - internalinterfaces.SharedInformerFactory - - // Start initializes all requested informers. They are handled in goroutines - // which run until the stop channel gets closed. - // Warning: Start does not block. When run in a go-routine, it will race with a later WaitForCacheSync. - Start(stopCh <-chan struct{}) - - // Shutdown marks a factory as shutting down. At that point no new - // informers can be started anymore and Start will return without - // doing anything. - // - // In addition, Shutdown blocks until all goroutines have terminated. For that - // to happen, the close channel(s) that they were started with must be closed, - // either before Shutdown gets called or while it is waiting. - // - // Shutdown may be called multiple times, even concurrently. All such calls will - // block until all goroutines have terminated. - Shutdown() - - // WaitForCacheSync blocks until all started informers' caches were synced - // or the stop channel gets closed. - WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool - - // ForResource gives generic access to a shared informer of the matching type. - ForResource(resource schema.GroupVersionResource) (GenericInformer, error) - - // InformerFor returns the SharedIndexInformer for obj using an internal - // client. - InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer - - Gateway() apisx.Interface -} - -func (f *sharedInformerFactory) Gateway() apisx.Interface { - return apisx.New(f, f.namespace, f.tweakListOptions) -} diff --git a/pkg/clientx/informers/externalversions/generic.go b/pkg/clientx/informers/externalversions/generic.go deleted file mode 100644 index 36bcda90c0..0000000000 --- a/pkg/clientx/informers/externalversions/generic.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package externalversions - -import ( - "fmt" - - schema "k8s.io/apimachinery/pkg/runtime/schema" - cache "k8s.io/client-go/tools/cache" - v1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" -) - -// GenericInformer is type of SharedIndexInformer which will locate and delegate to other -// sharedInformers based on type -type GenericInformer interface { - Informer() cache.SharedIndexInformer - Lister() cache.GenericLister -} - -type genericInformer struct { - informer cache.SharedIndexInformer - resource schema.GroupResource -} - -// Informer returns the SharedIndexInformer. -func (f *genericInformer) Informer() cache.SharedIndexInformer { - return f.informer -} - -// Lister returns the GenericLister. -func (f *genericInformer) Lister() cache.GenericLister { - return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) -} - -// ForResource gives generic access to a shared informer of the matching type -// TODO extend this to unknown resources with a client pool -func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { - switch resource { - // Group=gateway.networking.k8s-x.io, Version=v1alpha2 - case v1alpha2.SchemeGroupVersion.WithResource("backendtrafficpolicies"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Gateway().V1alpha2().BackendTrafficPolicies().Informer()}, nil - - } - - return nil, fmt.Errorf("no informer found for %v", resource) -} diff --git a/pkg/clientx/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/clientx/informers/externalversions/internalinterfaces/factory_interfaces.go deleted file mode 100644 index 62ea99f2d0..0000000000 --- a/pkg/clientx/informers/externalversions/internalinterfaces/factory_interfaces.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package internalinterfaces - -import ( - time "time" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - cache "k8s.io/client-go/tools/cache" - versioned "sigs.k8s.io/gateway-api/pkg/clientx/clientset/versioned" -) - -// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. -type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer - -// SharedInformerFactory a small interface to allow for adding an informer without an import cycle -type SharedInformerFactory interface { - Start(stopCh <-chan struct{}) - InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer -} - -// TweakListOptionsFunc is a function that transforms a v1.ListOptions. -type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/pkg/clientx/listers/apisx/v1alpha2/backendtrafficpolicy.go b/pkg/clientx/listers/apisx/v1alpha2/backendtrafficpolicy.go deleted file mode 100644 index 8e8f95ba67..0000000000 --- a/pkg/clientx/listers/apisx/v1alpha2/backendtrafficpolicy.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" - v1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" -) - -// BackendTrafficPolicyLister helps list BackendTrafficPolicies. -// All objects returned here must be treated as read-only. -type BackendTrafficPolicyLister interface { - // List lists all BackendTrafficPolicies in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.BackendTrafficPolicy, err error) - // BackendTrafficPolicies returns an object that can list and get BackendTrafficPolicies. - BackendTrafficPolicies(namespace string) BackendTrafficPolicyNamespaceLister - BackendTrafficPolicyListerExpansion -} - -// backendTrafficPolicyLister implements the BackendTrafficPolicyLister interface. -type backendTrafficPolicyLister struct { - listers.ResourceIndexer[*v1alpha2.BackendTrafficPolicy] -} - -// NewBackendTrafficPolicyLister returns a new BackendTrafficPolicyLister. -func NewBackendTrafficPolicyLister(indexer cache.Indexer) BackendTrafficPolicyLister { - return &backendTrafficPolicyLister{listers.New[*v1alpha2.BackendTrafficPolicy](indexer, v1alpha2.Resource("backendtrafficpolicy"))} -} - -// BackendTrafficPolicies returns an object that can list and get BackendTrafficPolicies. -func (s *backendTrafficPolicyLister) BackendTrafficPolicies(namespace string) BackendTrafficPolicyNamespaceLister { - return backendTrafficPolicyNamespaceLister{listers.NewNamespaced[*v1alpha2.BackendTrafficPolicy](s.ResourceIndexer, namespace)} -} - -// BackendTrafficPolicyNamespaceLister helps list and get BackendTrafficPolicies. -// All objects returned here must be treated as read-only. -type BackendTrafficPolicyNamespaceLister interface { - // List lists all BackendTrafficPolicies in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.BackendTrafficPolicy, err error) - // Get retrieves the BackendTrafficPolicy from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.BackendTrafficPolicy, error) - BackendTrafficPolicyNamespaceListerExpansion -} - -// backendTrafficPolicyNamespaceLister implements the BackendTrafficPolicyNamespaceLister -// interface. -type backendTrafficPolicyNamespaceLister struct { - listers.ResourceIndexer[*v1alpha2.BackendTrafficPolicy] -} diff --git a/pkg/clientx/listers/apisx/v1alpha2/expansion_generated.go b/pkg/clientx/listers/apisx/v1alpha2/expansion_generated.go deleted file mode 100644 index ff3d49e565..0000000000 --- a/pkg/clientx/listers/apisx/v1alpha2/expansion_generated.go +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha2 - -// BackendTrafficPolicyListerExpansion allows custom methods to be added to -// BackendTrafficPolicyLister. -type BackendTrafficPolicyListerExpansion interface{} - -// BackendTrafficPolicyNamespaceListerExpansion allows custom methods to be added to -// BackendTrafficPolicyNamespaceLister. -type BackendTrafficPolicyNamespaceListerExpansion interface{} From 3af4d86ec144f059c8e818622cc9b54f539f63c4 Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Thu, 27 Feb 2025 13:03:08 -0500 Subject: [PATCH 16/32] Fix api group name --- apisx/v1alpha2/doc.go | 7 +- apisx/v1alpha2/zz_generated.register.go | 2 +- .../apisx/v1alpha2/backendtrafficpolicy.go | 4 +- applyconfiguration/utils.go | 110 +++++++++--------- .../typed/apisx/v1alpha2/apisx_client.go | 2 +- .../externalversions/apisx/interface.go | 8 ++ .../informers/externalversions/generic.go | 5 + 7 files changed, 77 insertions(+), 61 deletions(-) diff --git a/apisx/v1alpha2/doc.go b/apisx/v1alpha2/doc.go index dc8e54ac7f..4f21c7b000 100644 --- a/apisx/v1alpha2/doc.go +++ b/apisx/v1alpha2/doc.go @@ -1,9 +1,12 @@ /* Copyright 2025 The Kubernetes Authors. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -11,11 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package v1alpha2 contains API Schema definitions for the gateway.networking.k8s-x.io +// Package v1alpha1 contains API Schema definitions for the gateway.networking.x-k8s.io // API group. // // +k8s:openapi-gen=true // +kubebuilder:object:generate=true -// +groupName=gateway.networking.k8s-x.io +// +groupName=gateway.networking.x-k8s.io // +groupGoName=Experimental package v1alpha2 diff --git a/apisx/v1alpha2/zz_generated.register.go b/apisx/v1alpha2/zz_generated.register.go index 76ec2c9672..e91c575edf 100644 --- a/apisx/v1alpha2/zz_generated.register.go +++ b/apisx/v1alpha2/zz_generated.register.go @@ -28,7 +28,7 @@ import ( ) // GroupName specifies the group name used to register the objects. -const GroupName = "gateway.networking.k8s-x.io" +const GroupName = "gateway.networking.x-k8s.io" // GroupVersion specifies the group and the version used to register the objects. var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v1alpha2"} diff --git a/applyconfiguration/apisx/v1alpha2/backendtrafficpolicy.go b/applyconfiguration/apisx/v1alpha2/backendtrafficpolicy.go index ed56a9a658..ebc26151fc 100644 --- a/applyconfiguration/apisx/v1alpha2/backendtrafficpolicy.go +++ b/applyconfiguration/apisx/v1alpha2/backendtrafficpolicy.go @@ -44,7 +44,7 @@ func BackendTrafficPolicy(name, namespace string) *BackendTrafficPolicyApplyConf b.WithName(name) b.WithNamespace(namespace) b.WithKind("BackendTrafficPolicy") - b.WithAPIVersion("gateway.networking.k8s-x.io/v1alpha2") + b.WithAPIVersion("gateway.networking.x-k8s.io/v1alpha2") return b } @@ -80,7 +80,7 @@ func extractBackendTrafficPolicy(backendTrafficPolicy *apisxv1alpha2.BackendTraf b.WithNamespace(backendTrafficPolicy.Namespace) b.WithKind("BackendTrafficPolicy") - b.WithAPIVersion("gateway.networking.k8s-x.io/v1alpha2") + b.WithAPIVersion("gateway.networking.x-k8s.io/v1alpha2") return b, nil } diff --git a/applyconfiguration/utils.go b/applyconfiguration/utils.go index 0e8206674b..03178a9c3c 100644 --- a/applyconfiguration/utils.go +++ b/applyconfiguration/utils.go @@ -23,17 +23,17 @@ import ( schema "k8s.io/apimachinery/pkg/runtime/schema" testing "k8s.io/client-go/testing" v1 "sigs.k8s.io/gateway-api/apis/v1" - apisv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" + v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" v1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" v1alpha1 "sigs.k8s.io/gateway-api/apisx/v1alpha1" - v1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" + apisxv1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" apisv1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" - applyconfigurationapisv1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha2" + apisv1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha2" apisv1alpha3 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha3" apisv1beta1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1beta1" apisxv1alpha1 "sigs.k8s.io/gateway-api/applyconfiguration/apisx/v1alpha1" - apisxv1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apisx/v1alpha2" + applyconfigurationapisxv1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apisx/v1alpha2" internal "sigs.k8s.io/gateway-api/applyconfiguration/internal" ) @@ -41,17 +41,7 @@ import ( // apply configuration type exists for the given GroupVersionKind. func ForKind(kind schema.GroupVersionKind) interface{} { switch kind { - // Group=gateway.networking.k8s-x.io, Version=v1alpha2 - case v1alpha2.SchemeGroupVersion.WithKind("BackendTrafficPolicy"): - return &apisxv1alpha2.BackendTrafficPolicyApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("BackendTrafficPolicySpec"): - return &apisxv1alpha2.BackendTrafficPolicySpecApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("RequestRate"): - return &apisxv1alpha2.RequestRateApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("RetryConstraint"): - return &apisxv1alpha2.RetryConstraintApplyConfiguration{} - - // Group=gateway.networking.k8s.io, Version=v1 + // Group=gateway.networking.k8s.io, Version=v1 case v1.SchemeGroupVersion.WithKind("AllowedListeners"): return &apisv1.AllowedListenersApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("AllowedRoutes"): @@ -176,46 +166,46 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &apisv1.SupportedFeatureApplyConfiguration{} // Group=gateway.networking.k8s.io, Version=v1alpha2 - case apisv1alpha2.SchemeGroupVersion.WithKind("BackendLBPolicy"): - return &applyconfigurationapisv1alpha2.BackendLBPolicyApplyConfiguration{} - case apisv1alpha2.SchemeGroupVersion.WithKind("BackendLBPolicySpec"): - return &applyconfigurationapisv1alpha2.BackendLBPolicySpecApplyConfiguration{} - case apisv1alpha2.SchemeGroupVersion.WithKind("GRPCRoute"): - return &applyconfigurationapisv1alpha2.GRPCRouteApplyConfiguration{} - case apisv1alpha2.SchemeGroupVersion.WithKind("LocalPolicyTargetReference"): - return &applyconfigurationapisv1alpha2.LocalPolicyTargetReferenceApplyConfiguration{} - case apisv1alpha2.SchemeGroupVersion.WithKind("LocalPolicyTargetReferenceWithSectionName"): - return &applyconfigurationapisv1alpha2.LocalPolicyTargetReferenceWithSectionNameApplyConfiguration{} - case apisv1alpha2.SchemeGroupVersion.WithKind("PolicyAncestorStatus"): - return &applyconfigurationapisv1alpha2.PolicyAncestorStatusApplyConfiguration{} - case apisv1alpha2.SchemeGroupVersion.WithKind("PolicyStatus"): - return &applyconfigurationapisv1alpha2.PolicyStatusApplyConfiguration{} - case apisv1alpha2.SchemeGroupVersion.WithKind("ReferenceGrant"): - return &applyconfigurationapisv1alpha2.ReferenceGrantApplyConfiguration{} - case apisv1alpha2.SchemeGroupVersion.WithKind("TCPRoute"): - return &applyconfigurationapisv1alpha2.TCPRouteApplyConfiguration{} - case apisv1alpha2.SchemeGroupVersion.WithKind("TCPRouteRule"): - return &applyconfigurationapisv1alpha2.TCPRouteRuleApplyConfiguration{} - case apisv1alpha2.SchemeGroupVersion.WithKind("TCPRouteSpec"): - return &applyconfigurationapisv1alpha2.TCPRouteSpecApplyConfiguration{} - case apisv1alpha2.SchemeGroupVersion.WithKind("TCPRouteStatus"): - return &applyconfigurationapisv1alpha2.TCPRouteStatusApplyConfiguration{} - case apisv1alpha2.SchemeGroupVersion.WithKind("TLSRoute"): - return &applyconfigurationapisv1alpha2.TLSRouteApplyConfiguration{} - case apisv1alpha2.SchemeGroupVersion.WithKind("TLSRouteRule"): - return &applyconfigurationapisv1alpha2.TLSRouteRuleApplyConfiguration{} - case apisv1alpha2.SchemeGroupVersion.WithKind("TLSRouteSpec"): - return &applyconfigurationapisv1alpha2.TLSRouteSpecApplyConfiguration{} - case apisv1alpha2.SchemeGroupVersion.WithKind("TLSRouteStatus"): - return &applyconfigurationapisv1alpha2.TLSRouteStatusApplyConfiguration{} - case apisv1alpha2.SchemeGroupVersion.WithKind("UDPRoute"): - return &applyconfigurationapisv1alpha2.UDPRouteApplyConfiguration{} - case apisv1alpha2.SchemeGroupVersion.WithKind("UDPRouteRule"): - return &applyconfigurationapisv1alpha2.UDPRouteRuleApplyConfiguration{} - case apisv1alpha2.SchemeGroupVersion.WithKind("UDPRouteSpec"): - return &applyconfigurationapisv1alpha2.UDPRouteSpecApplyConfiguration{} - case apisv1alpha2.SchemeGroupVersion.WithKind("UDPRouteStatus"): - return &applyconfigurationapisv1alpha2.UDPRouteStatusApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("BackendLBPolicy"): + return &apisv1alpha2.BackendLBPolicyApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("BackendLBPolicySpec"): + return &apisv1alpha2.BackendLBPolicySpecApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("GRPCRoute"): + return &apisv1alpha2.GRPCRouteApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("LocalPolicyTargetReference"): + return &apisv1alpha2.LocalPolicyTargetReferenceApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("LocalPolicyTargetReferenceWithSectionName"): + return &apisv1alpha2.LocalPolicyTargetReferenceWithSectionNameApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("PolicyAncestorStatus"): + return &apisv1alpha2.PolicyAncestorStatusApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("PolicyStatus"): + return &apisv1alpha2.PolicyStatusApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("ReferenceGrant"): + return &apisv1alpha2.ReferenceGrantApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("TCPRoute"): + return &apisv1alpha2.TCPRouteApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("TCPRouteRule"): + return &apisv1alpha2.TCPRouteRuleApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("TCPRouteSpec"): + return &apisv1alpha2.TCPRouteSpecApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("TCPRouteStatus"): + return &apisv1alpha2.TCPRouteStatusApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("TLSRoute"): + return &apisv1alpha2.TLSRouteApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("TLSRouteRule"): + return &apisv1alpha2.TLSRouteRuleApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("TLSRouteSpec"): + return &apisv1alpha2.TLSRouteSpecApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("TLSRouteStatus"): + return &apisv1alpha2.TLSRouteStatusApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("UDPRoute"): + return &apisv1alpha2.UDPRouteApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("UDPRouteRule"): + return &apisv1alpha2.UDPRouteRuleApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("UDPRouteSpec"): + return &apisv1alpha2.UDPRouteSpecApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("UDPRouteStatus"): + return &apisv1alpha2.UDPRouteStatusApplyConfiguration{} // Group=gateway.networking.k8s.io, Version=v1alpha3 case v1alpha3.SchemeGroupVersion.WithKind("BackendTLSPolicy"): @@ -257,6 +247,16 @@ func ForKind(kind schema.GroupVersionKind) interface{} { case v1alpha1.SchemeGroupVersion.WithKind("ParentGatewayReference"): return &apisxv1alpha1.ParentGatewayReferenceApplyConfiguration{} + // Group=gateway.networking.x-k8s.io, Version=v1alpha2 + case apisxv1alpha2.SchemeGroupVersion.WithKind("BackendTrafficPolicy"): + return &applyconfigurationapisxv1alpha2.BackendTrafficPolicyApplyConfiguration{} + case apisxv1alpha2.SchemeGroupVersion.WithKind("BackendTrafficPolicySpec"): + return &applyconfigurationapisxv1alpha2.BackendTrafficPolicySpecApplyConfiguration{} + case apisxv1alpha2.SchemeGroupVersion.WithKind("RequestRate"): + return &applyconfigurationapisxv1alpha2.RequestRateApplyConfiguration{} + case apisxv1alpha2.SchemeGroupVersion.WithKind("RetryConstraint"): + return &applyconfigurationapisxv1alpha2.RetryConstraintApplyConfiguration{} + } return nil } diff --git a/pkg/client/clientset/versioned/typed/apisx/v1alpha2/apisx_client.go b/pkg/client/clientset/versioned/typed/apisx/v1alpha2/apisx_client.go index a17f1d79f0..d8b437a5cf 100644 --- a/pkg/client/clientset/versioned/typed/apisx/v1alpha2/apisx_client.go +++ b/pkg/client/clientset/versioned/typed/apisx/v1alpha2/apisx_client.go @@ -31,7 +31,7 @@ type ExperimentalV1alpha2Interface interface { BackendTrafficPoliciesGetter } -// ExperimentalV1alpha2Client is used to interact with features provided by the gateway.networking.k8s-x.io group. +// ExperimentalV1alpha2Client is used to interact with features provided by the gateway.networking.x-k8s.io group. type ExperimentalV1alpha2Client struct { restClient rest.Interface } diff --git a/pkg/client/informers/externalversions/apisx/interface.go b/pkg/client/informers/externalversions/apisx/interface.go index 458ec817b4..56e4504b88 100644 --- a/pkg/client/informers/externalversions/apisx/interface.go +++ b/pkg/client/informers/externalversions/apisx/interface.go @@ -20,6 +20,7 @@ package apisx import ( v1alpha1 "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apisx/v1alpha1" + v1alpha2 "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apisx/v1alpha2" internalinterfaces "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/internalinterfaces" ) @@ -27,6 +28,8 @@ import ( type Interface interface { // V1alpha1 provides access to shared informers for resources in V1alpha1. V1alpha1() v1alpha1.Interface + // V1alpha2 provides access to shared informers for resources in V1alpha2. + V1alpha2() v1alpha2.Interface } type group struct { @@ -44,3 +47,8 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList func (g *group) V1alpha1() v1alpha1.Interface { return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) } + +// V1alpha2 returns a new v1alpha2.Interface. +func (g *group) V1alpha2() v1alpha2.Interface { + return v1alpha2.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index 19061e2ddf..9218f3eb68 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -28,6 +28,7 @@ import ( v1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" v1alpha1 "sigs.k8s.io/gateway-api/apisx/v1alpha1" + apisxv1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" ) // GenericInformer is type of SharedIndexInformer which will locate and delegate to other @@ -98,6 +99,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case v1alpha1.SchemeGroupVersion.WithResource("listenersets"): return &genericInformer{resource: resource.GroupResource(), informer: f.Experimental().V1alpha1().ListenerSets().Informer()}, nil + // Group=gateway.networking.x-k8s.io, Version=v1alpha2 + case apisxv1alpha2.SchemeGroupVersion.WithResource("backendtrafficpolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Experimental().V1alpha2().BackendTrafficPolicies().Informer()}, nil + } return nil, fmt.Errorf("no informer found for %v", resource) From 49d3e5cdd897df3ff06c8ecf01c01da35b9d9cf2 Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Thu, 27 Feb 2025 13:05:57 -0500 Subject: [PATCH 17/32] capitalize RFC 2119 keyword --- apisx/v1alpha2/backendtrafficpolicy.go | 8 ++++---- pkg/generated/openapi/zz_generated.openapi.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apisx/v1alpha2/backendtrafficpolicy.go b/apisx/v1alpha2/backendtrafficpolicy.go index 4b0b3aca61..58622e9b65 100644 --- a/apisx/v1alpha2/backendtrafficpolicy.go +++ b/apisx/v1alpha2/backendtrafficpolicy.go @@ -88,12 +88,12 @@ type BackendTrafficPolicySpec struct { // Configuring a RetryConstraint in BackendTrafficPolicy is compatible with // HTTPRoute Retry settings for each HTTPRouteRule that targets the same // backend. While the HTTPRouteRule Retry stanza can specify whether a - // request should be retried and the number of retry attempts each client - // may perform, RetryConstraint helps prevent cascading failures, such as - // retry storms, during periods of consistent failures. + // request will be retried, and the number of retry attempts each client + // may perform, RetryConstraint helps prevent cascading failures such as + // retry storms during periods of consistent failures. // // After the retry budget has been exceeded, additional retries to the - // backend must return a 503 response to the client. + // backend MUST return a 503 response to the client. // // Additional configurations for defining a constraint on retries MAY be // defined in the future. diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go index 3bc3fb2386..42b8028bca 100644 --- a/pkg/generated/openapi/zz_generated.openapi.go +++ b/pkg/generated/openapi/zz_generated.openapi.go @@ -8167,7 +8167,7 @@ func schema_sigsk8sio_gateway_api_apisx_v1alpha2_BackendTrafficPolicySpec(ref co }, "retry": { SchemaProps: spec.SchemaProps{ - Description: "RetryConstraint defines the configuration for when to allow or prevent further retries to a target backend by dynamically calculating a 'retry budget'. This budget is calculated based on the percentage of incoming traffic composed of retries over a given time interval. Once the budget is exceeded, additional retries will be rejected by the backend.\n\nFor example, if the retry budget interval is 10 seconds, there have been 1000 active requests in the past 10 seconds, and the allowed percentage of requests that can be retried is 20% (the default), then 200 of those requests may be composed of retries. Active requests will only be considered for the duration of the interval when calculating the retry budget.\n\nConfiguring a RetryConstraint in BackendTrafficPolicy is compatible with HTTPRoute Retry settings for each HTTPRouteRule that targets the same backend. While the HTTPRouteRule Retry stanza can specify whether a request should be retried and the number of retry attempts each client may perform, RetryConstraint helps prevent cascading failures, such as retry storms, during periods of consistent failures.\n\nAfter the retry budget has been exceeded, additional retries to the backend must return a 503 response to the client.\n\nAdditional configurations for defining a constraint on retries MAY be defined in the future.\n\nSupport: Extended\n\n", + Description: "RetryConstraint defines the configuration for when to allow or prevent further retries to a target backend by dynamically calculating a 'retry budget'. This budget is calculated based on the percentage of incoming traffic composed of retries over a given time interval. Once the budget is exceeded, additional retries will be rejected by the backend.\n\nFor example, if the retry budget interval is 10 seconds, there have been 1000 active requests in the past 10 seconds, and the allowed percentage of requests that can be retried is 20% (the default), then 200 of those requests may be composed of retries. Active requests will only be considered for the duration of the interval when calculating the retry budget.\n\nConfiguring a RetryConstraint in BackendTrafficPolicy is compatible with HTTPRoute Retry settings for each HTTPRouteRule that targets the same backend. While the HTTPRouteRule Retry stanza can specify whether a request will be retried, and the number of retry attempts each client may perform, RetryConstraint helps prevent cascading failures such as retry storms during periods of consistent failures.\n\nAfter the retry budget has been exceeded, additional retries to the backend MUST return a 503 response to the client.\n\nAdditional configurations for defining a constraint on retries MAY be defined in the future.\n\nSupport: Extended\n\n", Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha2.RetryConstraint"), }, }, From b1c899f332f08101f4d724b78a997e7e74c964ad Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Thu, 27 Feb 2025 16:16:13 -0500 Subject: [PATCH 18/32] Addressing comments from code review --- pkg/generated/openapi/zz_generated.openapi.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go index 42b8028bca..c384d2f10c 100644 --- a/pkg/generated/openapi/zz_generated.openapi.go +++ b/pkg/generated/openapi/zz_generated.openapi.go @@ -8153,7 +8153,7 @@ func schema_sigsk8sio_gateway_api_apisx_v1alpha2_BackendTrafficPolicySpec(ref co }, }, SchemaProps: spec.SchemaProps{ - Description: "TargetRef identifies an API object to apply policy to. Currently, Backends (i.e. Service, ServiceImport, or any implementation-specific backendRef) are the only valid API target references.", + Description: "TargetRef identifies an API object to apply policy to. Currently, Backends (i.e. Service, ServiceImport, or any implementation-specific backendRef) are the only valid API target references.\n\nCurrently, a TargetRef can not be scoped to a specific port on a Service.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -8167,7 +8167,7 @@ func schema_sigsk8sio_gateway_api_apisx_v1alpha2_BackendTrafficPolicySpec(ref co }, "retry": { SchemaProps: spec.SchemaProps{ - Description: "RetryConstraint defines the configuration for when to allow or prevent further retries to a target backend by dynamically calculating a 'retry budget'. This budget is calculated based on the percentage of incoming traffic composed of retries over a given time interval. Once the budget is exceeded, additional retries will be rejected by the backend.\n\nFor example, if the retry budget interval is 10 seconds, there have been 1000 active requests in the past 10 seconds, and the allowed percentage of requests that can be retried is 20% (the default), then 200 of those requests may be composed of retries. Active requests will only be considered for the duration of the interval when calculating the retry budget.\n\nConfiguring a RetryConstraint in BackendTrafficPolicy is compatible with HTTPRoute Retry settings for each HTTPRouteRule that targets the same backend. While the HTTPRouteRule Retry stanza can specify whether a request will be retried, and the number of retry attempts each client may perform, RetryConstraint helps prevent cascading failures such as retry storms during periods of consistent failures.\n\nAfter the retry budget has been exceeded, additional retries to the backend MUST return a 503 response to the client.\n\nAdditional configurations for defining a constraint on retries MAY be defined in the future.\n\nSupport: Extended\n\n", + Description: "RetryConstraint defines the configuration for when to allow or prevent further retries to a target backend, by dynamically calculating a 'retry budget'. This budget is calculated based on the percentage of incoming traffic composed of retries over a given time interval. Once the budget is exceeded, additional retries will be rejected.\n\nFor example, if the retry budget interval is 10 seconds, there have been 1000 active requests in the past 10 seconds, and the allowed percentage of requests that can be retried is 20% (the default), then 200 of those requests may be composed of retries. Active requests will only be considered for the duration of the interval when calculating the retry budget. Retrying the same original request multiple times within the retry budget interval will lead to each retry being counted towards calculating the budget.\n\nConfiguring a RetryConstraint in BackendTrafficPolicy is compatible with HTTPRoute Retry settings for each HTTPRouteRule that targets the same backend. While the HTTPRouteRule Retry stanza can specify whether a request will be retried, and the number of retry attempts each client may perform, RetryConstraint helps prevent cascading failures such as retry storms during periods of consistent failures.\n\nAfter the retry budget has been exceeded, additional retries to the backend MUST return a 503 response to the client.\n\nAdditional configurations for defining a constraint on retries MAY be defined in the future.\n\nSupport: Extended\n\n", Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha2.RetryConstraint"), }, }, From 7837c0ab29a996bd407bfa40a95ca10983745210 Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Thu, 27 Feb 2025 16:17:27 -0500 Subject: [PATCH 19/32] missing file --- apisx/v1alpha2/backendtrafficpolicy.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apisx/v1alpha2/backendtrafficpolicy.go b/apisx/v1alpha2/backendtrafficpolicy.go index 58622e9b65..9b26294e0e 100644 --- a/apisx/v1alpha2/backendtrafficpolicy.go +++ b/apisx/v1alpha2/backendtrafficpolicy.go @@ -64,6 +64,9 @@ type BackendTrafficPolicySpec struct { // implementation-specific backendRef) are the only valid API // target references. // + // Currently, a TargetRef can not be scoped to a specific port on a + // Service. + // // +listType=map // +listMapKey=group // +listMapKey=kind @@ -73,17 +76,19 @@ type BackendTrafficPolicySpec struct { TargetRefs []LocalPolicyTargetReference `json:"targetRefs"` // RetryConstraint defines the configuration for when to allow or prevent - // further retries to a target backend by dynamically calculating a 'retry + // further retries to a target backend, by dynamically calculating a 'retry // budget'. This budget is calculated based on the percentage of incoming // traffic composed of retries over a given time interval. Once the budget - // is exceeded, additional retries will be rejected by the backend. + // is exceeded, additional retries will be rejected. // // For example, if the retry budget interval is 10 seconds, there have been // 1000 active requests in the past 10 seconds, and the allowed percentage // of requests that can be retried is 20% (the default), then 200 of those // requests may be composed of retries. Active requests will only be // considered for the duration of the interval when calculating the retry - // budget. + // budget. Retrying the same original request multiple times within the + // retry budget interval will lead to each retry being counted towards + // calculating the budget. // // Configuring a RetryConstraint in BackendTrafficPolicy is compatible with // HTTPRoute Retry settings for each HTTPRouteRule that targets the same From d3741e2c2198434eb765154db42b4a5aa08c2c97 Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Fri, 28 Feb 2025 10:14:27 -0500 Subject: [PATCH 20/32] fix imports --- apisx/v1alpha2/shared_types.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apisx/v1alpha2/shared_types.go b/apisx/v1alpha2/shared_types.go index d558a28819..87e6957133 100644 --- a/apisx/v1alpha2/shared_types.go +++ b/apisx/v1alpha2/shared_types.go @@ -16,8 +16,10 @@ limitations under the License. package v1alpha2 -import v1 "sigs.k8s.io/gateway-api/apis/v1" -import v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" + v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" +) type ( // +k8s:deepcopy-gen=false From c624de31f8c855282d75abee82f0cccb9dcd6515 Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Sun, 2 Mar 2025 11:48:07 -0500 Subject: [PATCH 21/32] Modify descriptions; add greater validation --- apisx/v1alpha2/backendtrafficpolicy.go | 11 ++++++++--- apisx/v1alpha2/shared_types.go | 5 ++++- pkg/generated/openapi/zz_generated.openapi.go | 4 ++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/apisx/v1alpha2/backendtrafficpolicy.go b/apisx/v1alpha2/backendtrafficpolicy.go index 9b26294e0e..29385b2580 100644 --- a/apisx/v1alpha2/backendtrafficpolicy.go +++ b/apisx/v1alpha2/backendtrafficpolicy.go @@ -60,9 +60,9 @@ type BackendTrafficPolicyList struct { // Note: there is no Override or Default policy configuration. type BackendTrafficPolicySpec struct { // TargetRef identifies an API object to apply policy to. - // Currently, Backends (i.e. Service, ServiceImport, or any - // implementation-specific backendRef) are the only valid API - // target references. + // Currently, Backends (A grouping of like endpoints such as Service, + // ServiceImport, or any implementation-specific backendRef) are the only + // valid API target references. // // Currently, a TargetRef can not be scoped to a specific port on a // Service. @@ -138,11 +138,16 @@ type RetryConstraint struct { // // +optional // +kubebuilder:default=10s + // +kubebuilder:validation:XValidation:message="budgetInterval can not be greater than one hour or less than one second",rule="!(duration(self.budgetInterval) < duration('1s') || duration(self.budgetInterval) > duration('1h'))" BudgetInterval *Duration `json:"budgetInterval,omitempty"` // MinRetryRate defines the minimum rate of retries that will be allowable // over a specified duration of time. // + // The effective overall minimum rate of retries targeting the backend + // service may be much higher, as there can be any number of clients which + // are applying this setting locally. + // // This ensures that requests can still be retried during periods of low // traffic, where the budget for retries may be calculated as a very low // value. diff --git a/apisx/v1alpha2/shared_types.go b/apisx/v1alpha2/shared_types.go index 87e6957133..7a2868f3f5 100644 --- a/apisx/v1alpha2/shared_types.go +++ b/apisx/v1alpha2/shared_types.go @@ -33,11 +33,14 @@ type ( ) // RequestRate expresses a rate of requests over a given period of time. +// +// +kubebuilder:validation:XValidation:message="interval can not be greater than one hour",rule="!(duration(self.interval) == duration('0s') || duration(self.interval) > duration('1h'))" type RequestRate struct { // Count specifies the number of requests per time interval. // // Support: Extended - // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=1000000 Count *int `json:"count,omitempty"` // Interval specifies the divisor of the rate of requests, the amount of diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go index add62d5d15..db59ad0943 100644 --- a/pkg/generated/openapi/zz_generated.openapi.go +++ b/pkg/generated/openapi/zz_generated.openapi.go @@ -8168,7 +8168,7 @@ func schema_sigsk8sio_gateway_api_apisx_v1alpha2_BackendTrafficPolicySpec(ref co }, }, SchemaProps: spec.SchemaProps{ - Description: "TargetRef identifies an API object to apply policy to. Currently, Backends (i.e. Service, ServiceImport, or any implementation-specific backendRef) are the only valid API target references.\n\nCurrently, a TargetRef can not be scoped to a specific port on a Service.", + Description: "TargetRef identifies an API object to apply policy to. Currently, Backends (A grouping of like endpoints such as Service, ServiceImport, or any implementation-specific backendRef) are the only valid API target references.\n\nCurrently, a TargetRef can not be scoped to a specific port on a Service.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -8251,7 +8251,7 @@ func schema_sigsk8sio_gateway_api_apisx_v1alpha2_RetryConstraint(ref common.Refe }, "minRetryRate": { SchemaProps: spec.SchemaProps{ - Description: "MinRetryRate defines the minimum rate of retries that will be allowable over a specified duration of time.\n\nThis ensures that requests can still be retried during periods of low traffic, where the budget for retries may be calculated as a very low value.\n\nSupport: Extended", + Description: "MinRetryRate defines the minimum rate of retries that will be allowable over a specified duration of time.\n\nThe effective overall minimum rate of retries targeting the backend service may be much higher, as there can be any number of clients which are applying this setting locally.\n\nThis ensures that requests can still be retried during periods of low traffic, where the budget for retries may be calculated as a very low value.\n\nSupport: Extended", Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha2.RequestRate"), }, }, From 7afef1e28846112b3c578a54d9d84b65a0062225 Mon Sep 17 00:00:00 2001 From: Eric Bishop <60610299+ericdbishop@users.noreply.github.com> Date: Mon, 3 Mar 2025 17:27:11 -0500 Subject: [PATCH 22/32] Update apisx/v1alpha2/backendtrafficpolicy.go Co-authored-by: Rob Scott --- apisx/v1alpha2/backendtrafficpolicy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apisx/v1alpha2/backendtrafficpolicy.go b/apisx/v1alpha2/backendtrafficpolicy.go index 29385b2580..0d98c2bdd1 100644 --- a/apisx/v1alpha2/backendtrafficpolicy.go +++ b/apisx/v1alpha2/backendtrafficpolicy.go @@ -59,7 +59,7 @@ type BackendTrafficPolicyList struct { // BackendTrafficPolicySpec define the desired state of BackendTrafficPolicy // Note: there is no Override or Default policy configuration. type BackendTrafficPolicySpec struct { - // TargetRef identifies an API object to apply policy to. + // TargetRefs identifies API object(s) to apply this policy to. // Currently, Backends (A grouping of like endpoints such as Service, // ServiceImport, or any implementation-specific backendRef) are the only // valid API target references. From c4910de998f9c6d0ba0c9e0f625b77fc20e429d0 Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Mon, 3 Mar 2025 17:51:26 -0500 Subject: [PATCH 23/32] Not complete, but adding CEL tests for backend traffic policy --- apisx/v1alpha2/backendtrafficpolicy.go | 2 +- .../v1alpha2/backendtrafficpolicyspec.go | 2 +- applyconfiguration/internal/internal.go | 2 +- pkg/generated/openapi/zz_generated.openapi.go | 4 +- pkg/test/cel/backendtrafficpolicy_test.go | 217 ++++++++++++++++++ 5 files changed, 222 insertions(+), 5 deletions(-) create mode 100644 pkg/test/cel/backendtrafficpolicy_test.go diff --git a/apisx/v1alpha2/backendtrafficpolicy.go b/apisx/v1alpha2/backendtrafficpolicy.go index 0d98c2bdd1..8fde9a99f2 100644 --- a/apisx/v1alpha2/backendtrafficpolicy.go +++ b/apisx/v1alpha2/backendtrafficpolicy.go @@ -107,7 +107,7 @@ type BackendTrafficPolicySpec struct { // // +optional // - RetryConstraint *RetryConstraint `json:"retry,omitempty"` + RetryConstraint *RetryConstraint `json:"retryConstraint,omitempty"` // SessionPersistence defines and configures session persistence // for the backend. diff --git a/applyconfiguration/apisx/v1alpha2/backendtrafficpolicyspec.go b/applyconfiguration/apisx/v1alpha2/backendtrafficpolicyspec.go index d233f22b50..c1a9368f81 100644 --- a/applyconfiguration/apisx/v1alpha2/backendtrafficpolicyspec.go +++ b/applyconfiguration/apisx/v1alpha2/backendtrafficpolicyspec.go @@ -27,7 +27,7 @@ import ( // with apply. type BackendTrafficPolicySpecApplyConfiguration struct { TargetRefs []v1alpha2.LocalPolicyTargetReferenceApplyConfiguration `json:"targetRefs,omitempty"` - RetryConstraint *RetryConstraintApplyConfiguration `json:"retry,omitempty"` + RetryConstraint *RetryConstraintApplyConfiguration `json:"retryConstraint,omitempty"` SessionPersistence *v1.SessionPersistenceApplyConfiguration `json:"sessionPersistence,omitempty"` } diff --git a/applyconfiguration/internal/internal.go b/applyconfiguration/internal/internal.go index 879512e791..369a08cac0 100644 --- a/applyconfiguration/internal/internal.go +++ b/applyconfiguration/internal/internal.go @@ -1858,7 +1858,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.sigs.gateway-api.apisx.v1alpha2.BackendTrafficPolicySpec map: fields: - - name: retry + - name: retryConstraint type: namedType: io.k8s.sigs.gateway-api.apisx.v1alpha2.RetryConstraint - name: sessionPersistence diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go index db59ad0943..88b5f2e014 100644 --- a/pkg/generated/openapi/zz_generated.openapi.go +++ b/pkg/generated/openapi/zz_generated.openapi.go @@ -8168,7 +8168,7 @@ func schema_sigsk8sio_gateway_api_apisx_v1alpha2_BackendTrafficPolicySpec(ref co }, }, SchemaProps: spec.SchemaProps{ - Description: "TargetRef identifies an API object to apply policy to. Currently, Backends (A grouping of like endpoints such as Service, ServiceImport, or any implementation-specific backendRef) are the only valid API target references.\n\nCurrently, a TargetRef can not be scoped to a specific port on a Service.", + Description: "TargetRefs identifies API object(s) to apply this policy to. Currently, Backends (A grouping of like endpoints such as Service, ServiceImport, or any implementation-specific backendRef) are the only valid API target references.\n\nCurrently, a TargetRef can not be scoped to a specific port on a Service.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -8180,7 +8180,7 @@ func schema_sigsk8sio_gateway_api_apisx_v1alpha2_BackendTrafficPolicySpec(ref co }, }, }, - "retry": { + "retryConstraint": { SchemaProps: spec.SchemaProps{ Description: "RetryConstraint defines the configuration for when to allow or prevent further retries to a target backend, by dynamically calculating a 'retry budget'. This budget is calculated based on the percentage of incoming traffic composed of retries over a given time interval. Once the budget is exceeded, additional retries will be rejected.\n\nFor example, if the retry budget interval is 10 seconds, there have been 1000 active requests in the past 10 seconds, and the allowed percentage of requests that can be retried is 20% (the default), then 200 of those requests may be composed of retries. Active requests will only be considered for the duration of the interval when calculating the retry budget. Retrying the same original request multiple times within the retry budget interval will lead to each retry being counted towards calculating the budget.\n\nConfiguring a RetryConstraint in BackendTrafficPolicy is compatible with HTTPRoute Retry settings for each HTTPRouteRule that targets the same backend. While the HTTPRouteRule Retry stanza can specify whether a request will be retried, and the number of retry attempts each client may perform, RetryConstraint helps prevent cascading failures such as retry storms during periods of consistent failures.\n\nAfter the retry budget has been exceeded, additional retries to the backend MUST return a 503 response to the client.\n\nAdditional configurations for defining a constraint on retries MAY be defined in the future.\n\nSupport: Extended\n\n", Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha2.RetryConstraint"), diff --git a/pkg/test/cel/backendtrafficpolicy_test.go b/pkg/test/cel/backendtrafficpolicy_test.go new file mode 100644 index 0000000000..a66daa3340 --- /dev/null +++ b/pkg/test/cel/backendtrafficpolicy_test.go @@ -0,0 +1,217 @@ +//go:build experimental +// +build experimental + +/* +Copyright 2025 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package main + +import ( + "context" + "fmt" + "testing" + "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gatewayv1 "sigs.k8s.io/gateway-api/apis/v1" + gatewayv1a2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" +) + +func TestBackendTrafficPolicyConfig(t *testing.T) { + tests := []struct { + name string + wantErrors []string + sessionPersistence gatewayv1a2.SessionPersistence + }{ + { + name: "valid BackendTrafficPolicyConfig no retryConstraint budgetPercent", + sessionPersistence: gatewayv1a2.SessionPersistence{ + SessionName: ptrTo("foo"), + AbsoluteTimeout: toDuration("1h"), + Type: ptrTo(gatewayv1.CookieBasedSessionPersistence), + }, + retryConstraint: gatewayv1a2.RetryConstraint{ + BudgetInterval: toDuration("10s"), + MinRetryRate: ptrTo(gatewayv1a2.RequestRate{ + Count: ptrTo(10), + Interval: toDuration("1s"), + }), + }, + wantErrors: []string{}, + }, + { + name: "valid BackendTrafficPolicyConfig no retryConstraint budgetInterval", + sessionPersistence: gatewayv1a2.SessionPersistence{ + SessionName: ptrTo("foo"), + AbsoluteTimeout: toDuration("1h"), + Type: ptrTo(gatewayv1.CookieBasedSessionPersistence), + }, + retryConstraint: gatewayv1a2.RetryConstraint{ + BudgetPercent: ptrTo(20), + MinRetryRate: ptrTo(gatewayv1a2.RequestRate{ + Count: ptrTo(10), + Interval: toDuration("1s"), + }), + }, + wantErrors: []string{}, + }, + { + name: "valid BackendTrafficPolicyConfig no retryConstraint minRetryRate", + sessionPersistence: gatewayv1a2.SessionPersistence{ + SessionName: ptrTo("foo"), + AbsoluteTimeout: toDuration("1h"), + Type: ptrTo(gatewayv1.CookieBasedSessionPersistence), + }, + retryConstraint: gatewayv1a2.RetryConstraint{ + BudgetPercent: ptrTo(20), + BudgetInterval: toDuration("10s"), + }, + wantErrors: []string{}, + }, + { + name: "valid BackendTrafficPolicyConfig no cookie lifetimeType", + sessionPersistence: gatewayv1a2.SessionPersistence{ + SessionName: ptrTo("foo"), + AbsoluteTimeout: toDuration("1h"), + Type: ptrTo(gatewayv1.CookieBasedSessionPersistence), + }, + retryConstraint: gatewayv1a2.RetryConstraint{ + BudgetPercent: ptrTo(20), + BudgetInterval: toDuration("10s"), + MinRetryRate: ptrTo(gatewayv1a2.RequestRate{ + Count: ptrTo(10), + Interval: toDuration("1s"), + }), + }, + wantErrors: []string{}, + }, + { + name: "valid BackendTrafficPolicyConfig session cookie", + sessionPersistence: gatewayv1a2.SessionPersistence{ + SessionName: ptrTo("foo"), + Type: ptrTo(gatewayv1.CookieBasedSessionPersistence), + CookieConfig: &gatewayv1.CookieConfig{ + LifetimeType: ptrTo(gatewayv1.SessionCookieLifetimeType), + }, + }, + retryConstraint: gatewayv1a2.RetryConstraint{ + BudgetPercent: ptrTo(20), + BudgetInterval: toDuration("10s"), + MinRetryRate: ptrTo(gatewayv1a2.RequestRate{ + Count: ptrTo(10), + Interval: toDuration("1s"), + }), + }, + wantErrors: []string{}, + }, + { + name: "invalid BackendTrafficPolicyConfig permanent cookie", + sessionPersistence: gatewayv1a2.SessionPersistence{ + SessionName: ptrTo("foo"), + Type: ptrTo(gatewayv1.CookieBasedSessionPersistence), + CookieConfig: &gatewayv1.CookieConfig{ + LifetimeType: ptrTo(gatewayv1.PermanentCookieLifetimeType), + }, + }, + retryConstraint: gatewayv1a2.RetryConstraint{ + BudgetPercent: ptrTo(20), + BudgetInterval: toDuration("10s"), + MinRetryRate: ptrTo(gatewayv1a2.RequestRate{ + Count: ptrTo(10), + Interval: toDuration("1s"), + }), + }, + wantErrors: []string{"AbsoluteTimeout must be specified when cookie lifetimeType is Permanent"}, + }, + { + name: "valid BackendTrafficPolicyConfig permanent cookie", + sessionPersistence: gatewayv1a2.SessionPersistence{ + SessionName: ptrTo("foo"), + AbsoluteTimeout: toDuration("1h"), + Type: ptrTo(gatewayv1.CookieBasedSessionPersistence), + CookieConfig: &gatewayv1.CookieConfig{ + LifetimeType: ptrTo(gatewayv1.PermanentCookieLifetimeType), + }, + }, + retryConstraint: gatewayv1a2.RetryConstraint{ + BudgetPercent: ptrTo(20), + BudgetInterval: toDuration("10s"), + MinRetryRate: ptrTo(gatewayv1a2.RequestRate{ + Count: ptrTo(10), + Interval: toDuration("1s"), + }), + }, + wantErrors: []string{}, + }, + { + name: "valid BackendTrafficPolicyConfig header-based session persistence", + sessionPersistence: gatewayv1a2.SessionPersistence{ + SessionName: ptrTo("foo"), + Type: ptrTo(gatewayv1.HeaderBasedSessionPersistence), + }, + retryConstraint: gatewayv1a2.RetryConstraint{ + BudgetPercent: ptrTo(20), + BudgetInterval: toDuration("10s"), + MinRetryRate: ptrTo(gatewayv1a2.RequestRate{ + Count: ptrTo(10), + Interval: toDuration("1s"), + }), + }, + wantErrors: []string{}, + }, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + trafficPolicy := &gatewayv1a2.BackendTrafficPolicy{ + ObjectMeta: metav1.ObjectMeta{ + Name: fmt.Sprintf("foo-%v", time.Now().UnixNano()), + Namespace: metav1.NamespaceDefault, + }, + Spec: gatewayv1a2.BackendTrafficPolicySpec{ + TargetRefs: []gatewayv1a2.LocalPolicyTargetReference{{ + Group: "group", + Kind: "kind", + Name: "name", + }}, + RetryConstraint: &tc.retryConstraint, + SessionPersistence: &tc.sessionPersistence, + }, + } + validateBackendTrafficPolicy(t, trafficPolicy, tc.wantErrors) + }) + } +} + +func validateBackendTrafficPolicy(t *testing.T, trafficPolicy *gatewayv1a2.BackendTrafficPolicy, wantErrors []string) { + t.Helper() + + ctx := context.Background() + err := k8sClient.Create(ctx, trafficPolicy) + + if (len(wantErrors) != 0) != (err != nil) { + t.Fatalf("Unexpected response while creating BackendTrafficPolicy %q; got err=\n%v\n;want error=%v", fmt.Sprintf("%v/%v", trafficPolicy.Namespace, trafficPolicy.Name), err, wantErrors) + } + + var missingErrorStrings []string + for _, wantError := range wantErrors { + if !celErrorStringMatches(err.Error(), wantError) { + missingErrorStrings = append(missingErrorStrings, wantError) + } + } + if len(missingErrorStrings) != 0 { + t.Errorf("Unexpected response while creating BackendTrafficPolicy %q; got err=\n%v\n;missing strings within error=%q", fmt.Sprintf("%v/%v", trafficPolicy.Namespace, trafficPolicy.Name), err, missingErrorStrings) + } +} From ad75b710063768db0020351c5c90eb4e2500c1c9 Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Mon, 3 Mar 2025 18:20:27 -0500 Subject: [PATCH 24/32] fix missing retryConstraint in test struct; add tests for invalid config --- pkg/test/cel/backendtrafficpolicy_test.go | 52 +++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/pkg/test/cel/backendtrafficpolicy_test.go b/pkg/test/cel/backendtrafficpolicy_test.go index a66daa3340..b5aaf0a011 100644 --- a/pkg/test/cel/backendtrafficpolicy_test.go +++ b/pkg/test/cel/backendtrafficpolicy_test.go @@ -35,6 +35,7 @@ func TestBackendTrafficPolicyConfig(t *testing.T) { name string wantErrors []string sessionPersistence gatewayv1a2.SessionPersistence + retryConstraint gatewayv1a2.RetryConstraint }{ { name: "valid BackendTrafficPolicyConfig no retryConstraint budgetPercent", @@ -81,6 +82,57 @@ func TestBackendTrafficPolicyConfig(t *testing.T) { }, wantErrors: []string{}, }, + { + name: "invalid BackendTrafficPolicyConfig budgetInterval too long", + sessionPersistence: gatewayv1a2.SessionPersistence{ + SessionName: ptrTo("foo"), + AbsoluteTimeout: toDuration("1h"), + Type: ptrTo(gatewayv1.CookieBasedSessionPersistence), + }, + retryConstraint: gatewayv1a2.RetryConstraint{ + BudgetPercent: ptrTo(20), + BudgetInterval: toDuration("2h"), + MinRetryRate: ptrTo(gatewayv1a2.RequestRate{ + Count: ptrTo(10), + Interval: toDuration("10s"), + }), + }, + wantErrors: []string{"budgetInterval can not be greater than one hour or less than one second"}, + }, + { + name: "invalid BackendTrafficPolicyConfig budgetInterval too short", + sessionPersistence: gatewayv1a2.SessionPersistence{ + SessionName: ptrTo("foo"), + AbsoluteTimeout: toDuration("1h"), + Type: ptrTo(gatewayv1.CookieBasedSessionPersistence), + }, + retryConstraint: gatewayv1a2.RetryConstraint{ + BudgetPercent: ptrTo(20), + BudgetInterval: toDuration("1ms"), + MinRetryRate: ptrTo(gatewayv1a2.RequestRate{ + Count: ptrTo(10), + Interval: toDuration("10s"), + }), + }, + wantErrors: []string{"budgetInterval can not be greater than one hour or less than one second"}, + }, + { + name: "invalid BackendTrafficPolicyConfig minRetryRate interval", + sessionPersistence: gatewayv1a2.SessionPersistence{ + SessionName: ptrTo("foo"), + AbsoluteTimeout: toDuration("1h"), + Type: ptrTo(gatewayv1.CookieBasedSessionPersistence), + }, + retryConstraint: gatewayv1a2.RetryConstraint{ + BudgetPercent: ptrTo(20), + BudgetInterval: toDuration("10s"), + MinRetryRate: ptrTo(gatewayv1a2.RequestRate{ + Count: ptrTo(10), + Interval: toDuration("2h"), + }), + }, + wantErrors: []string{"interval can not be greater than one hour"}, + }, { name: "valid BackendTrafficPolicyConfig no cookie lifetimeType", sessionPersistence: gatewayv1a2.SessionPersistence{ From 4d7bc3fd73f7e9dda6dd95dc82405778507995f4 Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Mon, 3 Mar 2025 18:54:21 -0500 Subject: [PATCH 25/32] move to apis/v1alpha1 --- .../backendtrafficpolicy.go | 2 +- apisx/v1alpha1/shared_types.go | 31 +- apisx/v1alpha1/zz_generated.deepcopy.go | 145 ++++++++ apisx/v1alpha1/zz_generated.register.go | 2 + apisx/v1alpha2/doc.go | 24 -- apisx/v1alpha2/shared_types.go | 51 --- apisx/v1alpha2/zz_generated.deepcopy.go | 171 ---------- apisx/v1alpha2/zz_generated.register.go | 70 ---- .../apisx/v1alpha1/backendtrafficpolicy.go | 265 +++++++++++++++ .../v1alpha1/backendtrafficpolicyspec.go | 67 ++++ .../apisx/v1alpha1/requestrate.go | 52 +++ .../apisx/v1alpha1/retryconstraint.go | 61 ++++ applyconfiguration/internal/internal.go | 86 ++--- applyconfiguration/utils.go | 20 +- pkg/client/clientset/versioned/clientset.go | 13 - .../versioned/fake/clientset_generated.go | 7 - .../clientset/versioned/fake/register.go | 2 - .../clientset/versioned/scheme/register.go | 2 - .../typed/apisx/v1alpha1/apisx_client.go | 5 + .../apisx/v1alpha1/backendtrafficpolicy.go | 73 ++++ .../apisx/v1alpha1/fake/fake_apisx_client.go | 4 + .../fake/fake_backendtrafficpolicy.go | 197 +++++++++++ .../apisx/v1alpha1/generated_expansion.go | 2 + .../externalversions/apisx/interface.go | 8 - .../apisx/v1alpha1/backendtrafficpolicy.go | 90 +++++ .../apisx/v1alpha1/interface.go | 7 + .../informers/externalversions/generic.go | 7 +- .../apisx/v1alpha1/backendtrafficpolicy.go | 70 ++++ .../apisx/v1alpha1/expansion_generated.go | 8 + pkg/generated/openapi/zz_generated.openapi.go | 320 +++++++++--------- pkg/test/cel/backendtrafficpolicy_test.go | 2 +- 31 files changed, 1293 insertions(+), 571 deletions(-) rename apisx/{v1alpha2 => v1alpha1}/backendtrafficpolicy.go (99%) delete mode 100644 apisx/v1alpha2/doc.go delete mode 100644 apisx/v1alpha2/shared_types.go delete mode 100644 apisx/v1alpha2/zz_generated.deepcopy.go delete mode 100644 apisx/v1alpha2/zz_generated.register.go create mode 100644 applyconfiguration/apisx/v1alpha1/backendtrafficpolicy.go create mode 100644 applyconfiguration/apisx/v1alpha1/backendtrafficpolicyspec.go create mode 100644 applyconfiguration/apisx/v1alpha1/requestrate.go create mode 100644 applyconfiguration/apisx/v1alpha1/retryconstraint.go create mode 100644 pkg/client/clientset/versioned/typed/apisx/v1alpha1/backendtrafficpolicy.go create mode 100644 pkg/client/clientset/versioned/typed/apisx/v1alpha1/fake/fake_backendtrafficpolicy.go create mode 100644 pkg/client/informers/externalversions/apisx/v1alpha1/backendtrafficpolicy.go create mode 100644 pkg/client/listers/apisx/v1alpha1/backendtrafficpolicy.go diff --git a/apisx/v1alpha2/backendtrafficpolicy.go b/apisx/v1alpha1/backendtrafficpolicy.go similarity index 99% rename from apisx/v1alpha2/backendtrafficpolicy.go rename to apisx/v1alpha1/backendtrafficpolicy.go index 8fde9a99f2..e58d8867fe 100644 --- a/apisx/v1alpha2/backendtrafficpolicy.go +++ b/apisx/v1alpha1/backendtrafficpolicy.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha2 +package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/apisx/v1alpha1/shared_types.go b/apisx/v1alpha1/shared_types.go index 190eeaecb7..ef93c6f9c0 100644 --- a/apisx/v1alpha1/shared_types.go +++ b/apisx/v1alpha1/shared_types.go @@ -16,7 +16,10 @@ limitations under the License. package v1alpha1 -import v1 "sigs.k8s.io/gateway-api/apis/v1" +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" + v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" +) type ( // +k8s:deepcopy-gen=false @@ -41,6 +44,14 @@ type ( SectionName = v1.SectionName // +k8s:deepcopy-gen=false Namespace = v1.Namespace + // +k8s:deepcopy-gen=false + Duration = v1.Duration + // +k8s:deepcopy-gen=false + PolicyStatus = v1alpha2.PolicyStatus + // +k8s:deepcopy-gen=false + LocalPolicyTargetReference = v1alpha2.LocalPolicyTargetReference + // +k8s:deepcopy-gen=false + SessionPersistence = v1.SessionPersistence ) // ParentGatewayReference identifies an API object including its namespace, @@ -68,3 +79,21 @@ type ParentGatewayReference struct { // +optional Namespace *Namespace `json:"namespace,omitempty"` } + +// RequestRate expresses a rate of requests over a given period of time. +// +// +kubebuilder:validation:XValidation:message="interval can not be greater than one hour",rule="!(duration(self.interval) == duration('0s') || duration(self.interval) > duration('1h'))" +type RequestRate struct { + // Count specifies the number of requests per time interval. + // + // Support: Extended + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=1000000 + Count *int `json:"count,omitempty"` + + // Interval specifies the divisor of the rate of requests, the amount of + // time during which the given count of requests occur. + // + // Support: Extended + Interval *Duration `json:"interval,omitempty"` +} diff --git a/apisx/v1alpha1/zz_generated.deepcopy.go b/apisx/v1alpha1/zz_generated.deepcopy.go index c3a547570d..985d4b3a2f 100644 --- a/apisx/v1alpha1/zz_generated.deepcopy.go +++ b/apisx/v1alpha1/zz_generated.deepcopy.go @@ -24,8 +24,98 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" "sigs.k8s.io/gateway-api/apis/v1" + "sigs.k8s.io/gateway-api/apis/v1alpha2" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackendTrafficPolicy) DeepCopyInto(out *BackendTrafficPolicy) { + *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 BackendTrafficPolicy. +func (in *BackendTrafficPolicy) DeepCopy() *BackendTrafficPolicy { + if in == nil { + return nil + } + out := new(BackendTrafficPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BackendTrafficPolicy) 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 *BackendTrafficPolicyList) DeepCopyInto(out *BackendTrafficPolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]BackendTrafficPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendTrafficPolicyList. +func (in *BackendTrafficPolicyList) DeepCopy() *BackendTrafficPolicyList { + if in == nil { + return nil + } + out := new(BackendTrafficPolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BackendTrafficPolicyList) 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 *BackendTrafficPolicySpec) DeepCopyInto(out *BackendTrafficPolicySpec) { + *out = *in + if in.TargetRefs != nil { + in, out := &in.TargetRefs, &out.TargetRefs + *out = make([]v1alpha2.LocalPolicyTargetReference, len(*in)) + copy(*out, *in) + } + if in.RetryConstraint != nil { + in, out := &in.RetryConstraint, &out.RetryConstraint + *out = new(RetryConstraint) + (*in).DeepCopyInto(*out) + } + if in.SessionPersistence != nil { + in, out := &in.SessionPersistence, &out.SessionPersistence + *out = new(v1.SessionPersistence) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendTrafficPolicySpec. +func (in *BackendTrafficPolicySpec) DeepCopy() *BackendTrafficPolicySpec { + if in == nil { + return nil + } + out := new(BackendTrafficPolicySpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ListenerEntry) DeepCopyInto(out *ListenerEntry) { *out = *in @@ -225,3 +315,58 @@ func (in *ParentGatewayReference) DeepCopy() *ParentGatewayReference { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RequestRate) DeepCopyInto(out *RequestRate) { + *out = *in + if in.Count != nil { + in, out := &in.Count, &out.Count + *out = new(int) + **out = **in + } + if in.Interval != nil { + in, out := &in.Interval, &out.Interval + *out = new(v1.Duration) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequestRate. +func (in *RequestRate) DeepCopy() *RequestRate { + if in == nil { + return nil + } + out := new(RequestRate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RetryConstraint) DeepCopyInto(out *RetryConstraint) { + *out = *in + if in.BudgetPercent != nil { + in, out := &in.BudgetPercent, &out.BudgetPercent + *out = new(int) + **out = **in + } + if in.BudgetInterval != nil { + in, out := &in.BudgetInterval, &out.BudgetInterval + *out = new(v1.Duration) + **out = **in + } + if in.MinRetryRate != nil { + in, out := &in.MinRetryRate, &out.MinRetryRate + *out = new(RequestRate) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetryConstraint. +func (in *RetryConstraint) DeepCopy() *RetryConstraint { + if in == nil { + return nil + } + out := new(RetryConstraint) + in.DeepCopyInto(out) + return out +} diff --git a/apisx/v1alpha1/zz_generated.register.go b/apisx/v1alpha1/zz_generated.register.go index 9f76164bd0..ecbd109235 100644 --- a/apisx/v1alpha1/zz_generated.register.go +++ b/apisx/v1alpha1/zz_generated.register.go @@ -61,6 +61,8 @@ func init() { // Adds the list of known types to Scheme. func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, + &BackendTrafficPolicy{}, + &BackendTrafficPolicyList{}, &ListenerSet{}, &ListenerSetList{}, ) diff --git a/apisx/v1alpha2/doc.go b/apisx/v1alpha2/doc.go deleted file mode 100644 index 4f21c7b000..0000000000 --- a/apisx/v1alpha2/doc.go +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha1 contains API Schema definitions for the gateway.networking.x-k8s.io -// API group. -// -// +k8s:openapi-gen=true -// +kubebuilder:object:generate=true -// +groupName=gateway.networking.x-k8s.io -// +groupGoName=Experimental -package v1alpha2 diff --git a/apisx/v1alpha2/shared_types.go b/apisx/v1alpha2/shared_types.go deleted file mode 100644 index 7a2868f3f5..0000000000 --- a/apisx/v1alpha2/shared_types.go +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2025 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha2 - -import ( - v1 "sigs.k8s.io/gateway-api/apis/v1" - v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" -) - -type ( - // +k8s:deepcopy-gen=false - SessionPersistence = v1.SessionPersistence - // +k8s:deepcopy-gen=false - Duration = v1.Duration - // +k8s:deepcopy-gen=false - PolicyStatus = v1alpha2.PolicyStatus - // +k8s:deepcopy-gen=false - LocalPolicyTargetReference = v1alpha2.LocalPolicyTargetReference -) - -// RequestRate expresses a rate of requests over a given period of time. -// -// +kubebuilder:validation:XValidation:message="interval can not be greater than one hour",rule="!(duration(self.interval) == duration('0s') || duration(self.interval) > duration('1h'))" -type RequestRate struct { - // Count specifies the number of requests per time interval. - // - // Support: Extended - // +kubebuilder:validation:Minimum=1 - // +kubebuilder:validation:Maximum=1000000 - Count *int `json:"count,omitempty"` - - // Interval specifies the divisor of the rate of requests, the amount of - // time during which the given count of requests occur. - // - // Support: Extended - Interval *Duration `json:"interval,omitempty"` -} diff --git a/apisx/v1alpha2/zz_generated.deepcopy.go b/apisx/v1alpha2/zz_generated.deepcopy.go deleted file mode 100644 index 92268a7fac..0000000000 --- a/apisx/v1alpha2/zz_generated.deepcopy.go +++ /dev/null @@ -1,171 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" - "sigs.k8s.io/gateway-api/apis/v1" - apisv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BackendTrafficPolicy) DeepCopyInto(out *BackendTrafficPolicy) { - *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 BackendTrafficPolicy. -func (in *BackendTrafficPolicy) DeepCopy() *BackendTrafficPolicy { - if in == nil { - return nil - } - out := new(BackendTrafficPolicy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BackendTrafficPolicy) 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 *BackendTrafficPolicyList) DeepCopyInto(out *BackendTrafficPolicyList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]BackendTrafficPolicy, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendTrafficPolicyList. -func (in *BackendTrafficPolicyList) DeepCopy() *BackendTrafficPolicyList { - if in == nil { - return nil - } - out := new(BackendTrafficPolicyList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BackendTrafficPolicyList) 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 *BackendTrafficPolicySpec) DeepCopyInto(out *BackendTrafficPolicySpec) { - *out = *in - if in.TargetRefs != nil { - in, out := &in.TargetRefs, &out.TargetRefs - *out = make([]apisv1alpha2.LocalPolicyTargetReference, len(*in)) - copy(*out, *in) - } - if in.RetryConstraint != nil { - in, out := &in.RetryConstraint, &out.RetryConstraint - *out = new(RetryConstraint) - (*in).DeepCopyInto(*out) - } - if in.SessionPersistence != nil { - in, out := &in.SessionPersistence, &out.SessionPersistence - *out = new(v1.SessionPersistence) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendTrafficPolicySpec. -func (in *BackendTrafficPolicySpec) DeepCopy() *BackendTrafficPolicySpec { - if in == nil { - return nil - } - out := new(BackendTrafficPolicySpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RequestRate) DeepCopyInto(out *RequestRate) { - *out = *in - if in.Count != nil { - in, out := &in.Count, &out.Count - *out = new(int) - **out = **in - } - if in.Interval != nil { - in, out := &in.Interval, &out.Interval - *out = new(v1.Duration) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequestRate. -func (in *RequestRate) DeepCopy() *RequestRate { - if in == nil { - return nil - } - out := new(RequestRate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RetryConstraint) DeepCopyInto(out *RetryConstraint) { - *out = *in - if in.BudgetPercent != nil { - in, out := &in.BudgetPercent, &out.BudgetPercent - *out = new(int) - **out = **in - } - if in.BudgetInterval != nil { - in, out := &in.BudgetInterval, &out.BudgetInterval - *out = new(v1.Duration) - **out = **in - } - if in.MinRetryRate != nil { - in, out := &in.MinRetryRate, &out.MinRetryRate - *out = new(RequestRate) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RetryConstraint. -func (in *RetryConstraint) DeepCopy() *RetryConstraint { - if in == nil { - return nil - } - out := new(RetryConstraint) - in.DeepCopyInto(out) - return out -} diff --git a/apisx/v1alpha2/zz_generated.register.go b/apisx/v1alpha2/zz_generated.register.go deleted file mode 100644 index e91c575edf..0000000000 --- a/apisx/v1alpha2/zz_generated.register.go +++ /dev/null @@ -1,70 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by register-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// GroupName specifies the group name used to register the objects. -const GroupName = "gateway.networking.x-k8s.io" - -// GroupVersion specifies the group and the version used to register the objects. -var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v1alpha2"} - -// SchemeGroupVersion is group version used to register these objects -// Deprecated: use GroupVersion instead. -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha2"} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. - SchemeBuilder runtime.SchemeBuilder - localSchemeBuilder = &SchemeBuilder - // Deprecated: use Install instead - AddToScheme = localSchemeBuilder.AddToScheme - Install = localSchemeBuilder.AddToScheme -) - -func init() { - // We only register manually written functions here. The registration of the - // generated functions takes place in the generated files. The separation - // makes the code compile even when the generated files are missing. - localSchemeBuilder.Register(addKnownTypes) -} - -// Adds the list of known types to Scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &BackendTrafficPolicy{}, - &BackendTrafficPolicyList{}, - ) - // AddToGroupVersion allows the serialization of client types like ListOptions. - v1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/applyconfiguration/apisx/v1alpha1/backendtrafficpolicy.go b/applyconfiguration/apisx/v1alpha1/backendtrafficpolicy.go new file mode 100644 index 0000000000..49288efca8 --- /dev/null +++ b/applyconfiguration/apisx/v1alpha1/backendtrafficpolicy.go @@ -0,0 +1,265 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" + apisxv1alpha1 "sigs.k8s.io/gateway-api/apisx/v1alpha1" + v1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha2" + internal "sigs.k8s.io/gateway-api/applyconfiguration/internal" +) + +// BackendTrafficPolicyApplyConfiguration represents a declarative configuration of the BackendTrafficPolicy type for use +// with apply. +type BackendTrafficPolicyApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *BackendTrafficPolicySpecApplyConfiguration `json:"spec,omitempty"` + Status *v1alpha2.PolicyStatusApplyConfiguration `json:"status,omitempty"` +} + +// BackendTrafficPolicy constructs a declarative configuration of the BackendTrafficPolicy type for use with +// apply. +func BackendTrafficPolicy(name, namespace string) *BackendTrafficPolicyApplyConfiguration { + b := &BackendTrafficPolicyApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("BackendTrafficPolicy") + b.WithAPIVersion("gateway.networking.x-k8s.io/v1alpha1") + return b +} + +// ExtractBackendTrafficPolicy extracts the applied configuration owned by fieldManager from +// backendTrafficPolicy. If no managedFields are found in backendTrafficPolicy for fieldManager, a +// BackendTrafficPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// backendTrafficPolicy must be a unmodified BackendTrafficPolicy API object that was retrieved from the Kubernetes API. +// ExtractBackendTrafficPolicy provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractBackendTrafficPolicy(backendTrafficPolicy *apisxv1alpha1.BackendTrafficPolicy, fieldManager string) (*BackendTrafficPolicyApplyConfiguration, error) { + return extractBackendTrafficPolicy(backendTrafficPolicy, fieldManager, "") +} + +// ExtractBackendTrafficPolicyStatus is the same as ExtractBackendTrafficPolicy except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractBackendTrafficPolicyStatus(backendTrafficPolicy *apisxv1alpha1.BackendTrafficPolicy, fieldManager string) (*BackendTrafficPolicyApplyConfiguration, error) { + return extractBackendTrafficPolicy(backendTrafficPolicy, fieldManager, "status") +} + +func extractBackendTrafficPolicy(backendTrafficPolicy *apisxv1alpha1.BackendTrafficPolicy, fieldManager string, subresource string) (*BackendTrafficPolicyApplyConfiguration, error) { + b := &BackendTrafficPolicyApplyConfiguration{} + err := managedfields.ExtractInto(backendTrafficPolicy, internal.Parser().Type("io.k8s.sigs.gateway-api.apisx.v1alpha1.BackendTrafficPolicy"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(backendTrafficPolicy.Name) + b.WithNamespace(backendTrafficPolicy.Namespace) + + b.WithKind("BackendTrafficPolicy") + b.WithAPIVersion("gateway.networking.x-k8s.io/v1alpha1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithKind(value string) *BackendTrafficPolicyApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithAPIVersion(value string) *BackendTrafficPolicyApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithName(value string) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithGenerateName(value string) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithNamespace(value string) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithUID(value types.UID) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithResourceVersion(value string) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithGeneration(value int64) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *BackendTrafficPolicyApplyConfiguration) WithLabels(entries map[string]string) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *BackendTrafficPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *BackendTrafficPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *BackendTrafficPolicyApplyConfiguration) WithFinalizers(values ...string) *BackendTrafficPolicyApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *BackendTrafficPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithSpec(value *BackendTrafficPolicySpecApplyConfiguration) *BackendTrafficPolicyApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *BackendTrafficPolicyApplyConfiguration) WithStatus(value *v1alpha2.PolicyStatusApplyConfiguration) *BackendTrafficPolicyApplyConfiguration { + b.Status = value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *BackendTrafficPolicyApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfiguration/apisx/v1alpha1/backendtrafficpolicyspec.go b/applyconfiguration/apisx/v1alpha1/backendtrafficpolicyspec.go new file mode 100644 index 0000000000..205609b882 --- /dev/null +++ b/applyconfiguration/apisx/v1alpha1/backendtrafficpolicyspec.go @@ -0,0 +1,67 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" + v1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha2" +) + +// BackendTrafficPolicySpecApplyConfiguration represents a declarative configuration of the BackendTrafficPolicySpec type for use +// with apply. +type BackendTrafficPolicySpecApplyConfiguration struct { + TargetRefs []v1alpha2.LocalPolicyTargetReferenceApplyConfiguration `json:"targetRefs,omitempty"` + RetryConstraint *RetryConstraintApplyConfiguration `json:"retryConstraint,omitempty"` + SessionPersistence *v1.SessionPersistenceApplyConfiguration `json:"sessionPersistence,omitempty"` +} + +// BackendTrafficPolicySpecApplyConfiguration constructs a declarative configuration of the BackendTrafficPolicySpec type for use with +// apply. +func BackendTrafficPolicySpec() *BackendTrafficPolicySpecApplyConfiguration { + return &BackendTrafficPolicySpecApplyConfiguration{} +} + +// WithTargetRefs adds the given value to the TargetRefs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the TargetRefs field. +func (b *BackendTrafficPolicySpecApplyConfiguration) WithTargetRefs(values ...*v1alpha2.LocalPolicyTargetReferenceApplyConfiguration) *BackendTrafficPolicySpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTargetRefs") + } + b.TargetRefs = append(b.TargetRefs, *values[i]) + } + return b +} + +// WithRetryConstraint sets the RetryConstraint field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RetryConstraint field is set to the value of the last call. +func (b *BackendTrafficPolicySpecApplyConfiguration) WithRetryConstraint(value *RetryConstraintApplyConfiguration) *BackendTrafficPolicySpecApplyConfiguration { + b.RetryConstraint = value + return b +} + +// WithSessionPersistence sets the SessionPersistence field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SessionPersistence field is set to the value of the last call. +func (b *BackendTrafficPolicySpecApplyConfiguration) WithSessionPersistence(value *v1.SessionPersistenceApplyConfiguration) *BackendTrafficPolicySpecApplyConfiguration { + b.SessionPersistence = value + return b +} diff --git a/applyconfiguration/apisx/v1alpha1/requestrate.go b/applyconfiguration/apisx/v1alpha1/requestrate.go new file mode 100644 index 0000000000..a5c874a43c --- /dev/null +++ b/applyconfiguration/apisx/v1alpha1/requestrate.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// RequestRateApplyConfiguration represents a declarative configuration of the RequestRate type for use +// with apply. +type RequestRateApplyConfiguration struct { + Count *int `json:"count,omitempty"` + Interval *v1.Duration `json:"interval,omitempty"` +} + +// RequestRateApplyConfiguration constructs a declarative configuration of the RequestRate type for use with +// apply. +func RequestRate() *RequestRateApplyConfiguration { + return &RequestRateApplyConfiguration{} +} + +// WithCount sets the Count field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Count field is set to the value of the last call. +func (b *RequestRateApplyConfiguration) WithCount(value int) *RequestRateApplyConfiguration { + b.Count = &value + return b +} + +// WithInterval sets the Interval field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Interval field is set to the value of the last call. +func (b *RequestRateApplyConfiguration) WithInterval(value v1.Duration) *RequestRateApplyConfiguration { + b.Interval = &value + return b +} diff --git a/applyconfiguration/apisx/v1alpha1/retryconstraint.go b/applyconfiguration/apisx/v1alpha1/retryconstraint.go new file mode 100644 index 0000000000..4248ea83fc --- /dev/null +++ b/applyconfiguration/apisx/v1alpha1/retryconstraint.go @@ -0,0 +1,61 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// RetryConstraintApplyConfiguration represents a declarative configuration of the RetryConstraint type for use +// with apply. +type RetryConstraintApplyConfiguration struct { + BudgetPercent *int `json:"budgetPercent,omitempty"` + BudgetInterval *v1.Duration `json:"budgetInterval,omitempty"` + MinRetryRate *RequestRateApplyConfiguration `json:"minRetryRate,omitempty"` +} + +// RetryConstraintApplyConfiguration constructs a declarative configuration of the RetryConstraint type for use with +// apply. +func RetryConstraint() *RetryConstraintApplyConfiguration { + return &RetryConstraintApplyConfiguration{} +} + +// WithBudgetPercent sets the BudgetPercent field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BudgetPercent field is set to the value of the last call. +func (b *RetryConstraintApplyConfiguration) WithBudgetPercent(value int) *RetryConstraintApplyConfiguration { + b.BudgetPercent = &value + return b +} + +// WithBudgetInterval sets the BudgetInterval field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BudgetInterval field is set to the value of the last call. +func (b *RetryConstraintApplyConfiguration) WithBudgetInterval(value v1.Duration) *RetryConstraintApplyConfiguration { + b.BudgetInterval = &value + return b +} + +// WithMinRetryRate sets the MinRetryRate field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinRetryRate field is set to the value of the last call. +func (b *RetryConstraintApplyConfiguration) WithMinRetryRate(value *RequestRateApplyConfiguration) *RetryConstraintApplyConfiguration { + b.MinRetryRate = value + return b +} diff --git a/applyconfiguration/internal/internal.go b/applyconfiguration/internal/internal.go index 369a08cac0..c47f0b1064 100644 --- a/applyconfiguration/internal/internal.go +++ b/applyconfiguration/internal/internal.go @@ -1711,6 +1711,46 @@ var schemaYAML = typed.YAMLObject(`types: - name: name type: scalar: string +- name: io.k8s.sigs.gateway-api.apisx.v1alpha1.BackendTrafficPolicy + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.sigs.gateway-api.apisx.v1alpha1.BackendTrafficPolicySpec + default: {} + - name: status + type: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.PolicyStatus + default: {} +- name: io.k8s.sigs.gateway-api.apisx.v1alpha1.BackendTrafficPolicySpec + map: + fields: + - name: retryConstraint + type: + namedType: io.k8s.sigs.gateway-api.apisx.v1alpha1.RetryConstraint + - name: sessionPersistence + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.SessionPersistence + - name: targetRefs + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.LocalPolicyTargetReference + elementRelationship: associative + keys: + - group + - kind + - name - name: io.k8s.sigs.gateway-api.apisx.v1alpha1.ListenerEntry map: fields: @@ -1834,47 +1874,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: namespace type: scalar: string -- name: io.k8s.sigs.gateway-api.apisx.v1alpha2.BackendTrafficPolicy - map: - fields: - - name: apiVersion - type: - scalar: string - - name: kind - type: - scalar: string - - name: metadata - type: - namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta - default: {} - - name: spec - type: - namedType: io.k8s.sigs.gateway-api.apisx.v1alpha2.BackendTrafficPolicySpec - default: {} - - name: status - type: - namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.PolicyStatus - default: {} -- name: io.k8s.sigs.gateway-api.apisx.v1alpha2.BackendTrafficPolicySpec - map: - fields: - - name: retryConstraint - type: - namedType: io.k8s.sigs.gateway-api.apisx.v1alpha2.RetryConstraint - - name: sessionPersistence - type: - namedType: io.k8s.sigs.gateway-api.apis.v1.SessionPersistence - - name: targetRefs - type: - list: - elementType: - namedType: io.k8s.sigs.gateway-api.apis.v1alpha2.LocalPolicyTargetReference - elementRelationship: associative - keys: - - group - - kind - - name -- name: io.k8s.sigs.gateway-api.apisx.v1alpha2.RequestRate +- name: io.k8s.sigs.gateway-api.apisx.v1alpha1.RequestRate map: fields: - name: count @@ -1883,7 +1883,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: interval type: scalar: string -- name: io.k8s.sigs.gateway-api.apisx.v1alpha2.RetryConstraint +- name: io.k8s.sigs.gateway-api.apisx.v1alpha1.RetryConstraint map: fields: - name: budgetInterval @@ -1894,7 +1894,7 @@ var schemaYAML = typed.YAMLObject(`types: scalar: numeric - name: minRetryRate type: - namedType: io.k8s.sigs.gateway-api.apisx.v1alpha2.RequestRate + namedType: io.k8s.sigs.gateway-api.apisx.v1alpha1.RequestRate - name: __untyped_atomic_ scalar: untyped list: diff --git a/applyconfiguration/utils.go b/applyconfiguration/utils.go index 03178a9c3c..05210f8807 100644 --- a/applyconfiguration/utils.go +++ b/applyconfiguration/utils.go @@ -27,13 +27,11 @@ import ( v1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" v1alpha1 "sigs.k8s.io/gateway-api/apisx/v1alpha1" - apisxv1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" apisv1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" apisv1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha2" apisv1alpha3 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha3" apisv1beta1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1beta1" apisxv1alpha1 "sigs.k8s.io/gateway-api/applyconfiguration/apisx/v1alpha1" - applyconfigurationapisxv1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apisx/v1alpha2" internal "sigs.k8s.io/gateway-api/applyconfiguration/internal" ) @@ -234,6 +232,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &apisv1beta1.ReferenceGrantToApplyConfiguration{} // Group=gateway.networking.x-k8s.io, Version=v1alpha1 + case v1alpha1.SchemeGroupVersion.WithKind("BackendTrafficPolicy"): + return &apisxv1alpha1.BackendTrafficPolicyApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("BackendTrafficPolicySpec"): + return &apisxv1alpha1.BackendTrafficPolicySpecApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("ListenerEntry"): return &apisxv1alpha1.ListenerEntryApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("ListenerEntryStatus"): @@ -246,16 +248,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &apisxv1alpha1.ListenerSetStatusApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("ParentGatewayReference"): return &apisxv1alpha1.ParentGatewayReferenceApplyConfiguration{} - - // Group=gateway.networking.x-k8s.io, Version=v1alpha2 - case apisxv1alpha2.SchemeGroupVersion.WithKind("BackendTrafficPolicy"): - return &applyconfigurationapisxv1alpha2.BackendTrafficPolicyApplyConfiguration{} - case apisxv1alpha2.SchemeGroupVersion.WithKind("BackendTrafficPolicySpec"): - return &applyconfigurationapisxv1alpha2.BackendTrafficPolicySpecApplyConfiguration{} - case apisxv1alpha2.SchemeGroupVersion.WithKind("RequestRate"): - return &applyconfigurationapisxv1alpha2.RequestRateApplyConfiguration{} - case apisxv1alpha2.SchemeGroupVersion.WithKind("RetryConstraint"): - return &applyconfigurationapisxv1alpha2.RetryConstraintApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("RequestRate"): + return &apisxv1alpha1.RequestRateApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("RetryConstraint"): + return &apisxv1alpha1.RetryConstraintApplyConfiguration{} } return nil diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index eff26f7036..c65cf8f516 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -30,7 +30,6 @@ import ( gatewayv1alpha3 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3" gatewayv1beta1 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1" experimentalv1alpha1 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apisx/v1alpha1" - experimentalv1alpha2 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apisx/v1alpha2" ) type Interface interface { @@ -40,7 +39,6 @@ type Interface interface { GatewayV1alpha3() gatewayv1alpha3.GatewayV1alpha3Interface GatewayV1beta1() gatewayv1beta1.GatewayV1beta1Interface ExperimentalV1alpha1() experimentalv1alpha1.ExperimentalV1alpha1Interface - ExperimentalV1alpha2() experimentalv1alpha2.ExperimentalV1alpha2Interface } // Clientset contains the clients for groups. @@ -51,7 +49,6 @@ type Clientset struct { gatewayV1alpha3 *gatewayv1alpha3.GatewayV1alpha3Client gatewayV1beta1 *gatewayv1beta1.GatewayV1beta1Client experimentalV1alpha1 *experimentalv1alpha1.ExperimentalV1alpha1Client - experimentalV1alpha2 *experimentalv1alpha2.ExperimentalV1alpha2Client } // GatewayV1 retrieves the GatewayV1Client @@ -79,11 +76,6 @@ func (c *Clientset) ExperimentalV1alpha1() experimentalv1alpha1.ExperimentalV1al return c.experimentalV1alpha1 } -// ExperimentalV1alpha2 retrieves the ExperimentalV1alpha2Client -func (c *Clientset) ExperimentalV1alpha2() experimentalv1alpha2.ExperimentalV1alpha2Interface { - return c.experimentalV1alpha2 -} - // Discovery retrieves the DiscoveryClient func (c *Clientset) Discovery() discovery.DiscoveryInterface { if c == nil { @@ -148,10 +140,6 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } - cs.experimentalV1alpha2, err = experimentalv1alpha2.NewForConfigAndClient(&configShallowCopy, httpClient) - if err != nil { - return nil, err - } cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) if err != nil { @@ -178,7 +166,6 @@ func New(c rest.Interface) *Clientset { cs.gatewayV1alpha3 = gatewayv1alpha3.New(c) cs.gatewayV1beta1 = gatewayv1beta1.New(c) cs.experimentalV1alpha1 = experimentalv1alpha1.New(c) - cs.experimentalV1alpha2 = experimentalv1alpha2.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index b00e588bed..ecf37e8b51 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -36,8 +36,6 @@ import ( fakegatewayv1beta1 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1/fake" experimentalv1alpha1 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apisx/v1alpha1" fakeexperimentalv1alpha1 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apisx/v1alpha1/fake" - experimentalv1alpha2 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apisx/v1alpha2" - fakeexperimentalv1alpha2 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apisx/v1alpha2/fake" ) // NewSimpleClientset returns a clientset that will respond with the provided objects. @@ -150,8 +148,3 @@ func (c *Clientset) GatewayV1beta1() gatewayv1beta1.GatewayV1beta1Interface { func (c *Clientset) ExperimentalV1alpha1() experimentalv1alpha1.ExperimentalV1alpha1Interface { return &fakeexperimentalv1alpha1.FakeExperimentalV1alpha1{Fake: &c.Fake} } - -// ExperimentalV1alpha2 retrieves the ExperimentalV1alpha2Client -func (c *Clientset) ExperimentalV1alpha2() experimentalv1alpha2.ExperimentalV1alpha2Interface { - return &fakeexperimentalv1alpha2.FakeExperimentalV1alpha2{Fake: &c.Fake} -} diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index e19a80d6eb..4a4e3f846e 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -29,7 +29,6 @@ import ( gatewayv1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" experimentalv1alpha1 "sigs.k8s.io/gateway-api/apisx/v1alpha1" - experimentalv1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" ) var scheme = runtime.NewScheme() @@ -41,7 +40,6 @@ var localSchemeBuilder = runtime.SchemeBuilder{ gatewayv1alpha3.AddToScheme, gatewayv1beta1.AddToScheme, experimentalv1alpha1.AddToScheme, - experimentalv1alpha2.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index 056640a706..673060f9d9 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -29,7 +29,6 @@ import ( gatewayv1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" experimentalv1alpha1 "sigs.k8s.io/gateway-api/apisx/v1alpha1" - experimentalv1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" ) var Scheme = runtime.NewScheme() @@ -41,7 +40,6 @@ var localSchemeBuilder = runtime.SchemeBuilder{ gatewayv1alpha3.AddToScheme, gatewayv1beta1.AddToScheme, experimentalv1alpha1.AddToScheme, - experimentalv1alpha2.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/typed/apisx/v1alpha1/apisx_client.go b/pkg/client/clientset/versioned/typed/apisx/v1alpha1/apisx_client.go index 056800e4ac..9cbdd89238 100644 --- a/pkg/client/clientset/versioned/typed/apisx/v1alpha1/apisx_client.go +++ b/pkg/client/clientset/versioned/typed/apisx/v1alpha1/apisx_client.go @@ -28,6 +28,7 @@ import ( type ExperimentalV1alpha1Interface interface { RESTClient() rest.Interface + BackendTrafficPoliciesGetter ListenerSetsGetter } @@ -36,6 +37,10 @@ type ExperimentalV1alpha1Client struct { restClient rest.Interface } +func (c *ExperimentalV1alpha1Client) BackendTrafficPolicies(namespace string) BackendTrafficPolicyInterface { + return newBackendTrafficPolicies(c, namespace) +} + func (c *ExperimentalV1alpha1Client) ListenerSets(namespace string) ListenerSetInterface { return newListenerSets(c, namespace) } diff --git a/pkg/client/clientset/versioned/typed/apisx/v1alpha1/backendtrafficpolicy.go b/pkg/client/clientset/versioned/typed/apisx/v1alpha1/backendtrafficpolicy.go new file mode 100644 index 0000000000..74455d9064 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/apisx/v1alpha1/backendtrafficpolicy.go @@ -0,0 +1,73 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" + v1alpha1 "sigs.k8s.io/gateway-api/apisx/v1alpha1" + apisxv1alpha1 "sigs.k8s.io/gateway-api/applyconfiguration/apisx/v1alpha1" + scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" +) + +// BackendTrafficPoliciesGetter has a method to return a BackendTrafficPolicyInterface. +// A group's client should implement this interface. +type BackendTrafficPoliciesGetter interface { + BackendTrafficPolicies(namespace string) BackendTrafficPolicyInterface +} + +// BackendTrafficPolicyInterface has methods to work with BackendTrafficPolicy resources. +type BackendTrafficPolicyInterface interface { + Create(ctx context.Context, backendTrafficPolicy *v1alpha1.BackendTrafficPolicy, opts v1.CreateOptions) (*v1alpha1.BackendTrafficPolicy, error) + Update(ctx context.Context, backendTrafficPolicy *v1alpha1.BackendTrafficPolicy, opts v1.UpdateOptions) (*v1alpha1.BackendTrafficPolicy, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, backendTrafficPolicy *v1alpha1.BackendTrafficPolicy, opts v1.UpdateOptions) (*v1alpha1.BackendTrafficPolicy, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.BackendTrafficPolicy, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.BackendTrafficPolicyList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BackendTrafficPolicy, err error) + Apply(ctx context.Context, backendTrafficPolicy *apisxv1alpha1.BackendTrafficPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.BackendTrafficPolicy, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, backendTrafficPolicy *apisxv1alpha1.BackendTrafficPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.BackendTrafficPolicy, err error) + BackendTrafficPolicyExpansion +} + +// backendTrafficPolicies implements BackendTrafficPolicyInterface +type backendTrafficPolicies struct { + *gentype.ClientWithListAndApply[*v1alpha1.BackendTrafficPolicy, *v1alpha1.BackendTrafficPolicyList, *apisxv1alpha1.BackendTrafficPolicyApplyConfiguration] +} + +// newBackendTrafficPolicies returns a BackendTrafficPolicies +func newBackendTrafficPolicies(c *ExperimentalV1alpha1Client, namespace string) *backendTrafficPolicies { + return &backendTrafficPolicies{ + gentype.NewClientWithListAndApply[*v1alpha1.BackendTrafficPolicy, *v1alpha1.BackendTrafficPolicyList, *apisxv1alpha1.BackendTrafficPolicyApplyConfiguration]( + "backendtrafficpolicies", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.BackendTrafficPolicy { return &v1alpha1.BackendTrafficPolicy{} }, + func() *v1alpha1.BackendTrafficPolicyList { return &v1alpha1.BackendTrafficPolicyList{} }), + } +} diff --git a/pkg/client/clientset/versioned/typed/apisx/v1alpha1/fake/fake_apisx_client.go b/pkg/client/clientset/versioned/typed/apisx/v1alpha1/fake/fake_apisx_client.go index 28f74e4041..12f35d1b13 100644 --- a/pkg/client/clientset/versioned/typed/apisx/v1alpha1/fake/fake_apisx_client.go +++ b/pkg/client/clientset/versioned/typed/apisx/v1alpha1/fake/fake_apisx_client.go @@ -28,6 +28,10 @@ type FakeExperimentalV1alpha1 struct { *testing.Fake } +func (c *FakeExperimentalV1alpha1) BackendTrafficPolicies(namespace string) v1alpha1.BackendTrafficPolicyInterface { + return &FakeBackendTrafficPolicies{c, namespace} +} + func (c *FakeExperimentalV1alpha1) ListenerSets(namespace string) v1alpha1.ListenerSetInterface { return &FakeListenerSets{c, namespace} } diff --git a/pkg/client/clientset/versioned/typed/apisx/v1alpha1/fake/fake_backendtrafficpolicy.go b/pkg/client/clientset/versioned/typed/apisx/v1alpha1/fake/fake_backendtrafficpolicy.go new file mode 100644 index 0000000000..905e295b85 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/apisx/v1alpha1/fake/fake_backendtrafficpolicy.go @@ -0,0 +1,197 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1 "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" + v1alpha1 "sigs.k8s.io/gateway-api/apisx/v1alpha1" + apisxv1alpha1 "sigs.k8s.io/gateway-api/applyconfiguration/apisx/v1alpha1" +) + +// FakeBackendTrafficPolicies implements BackendTrafficPolicyInterface +type FakeBackendTrafficPolicies struct { + Fake *FakeExperimentalV1alpha1 + ns string +} + +var backendtrafficpoliciesResource = v1alpha1.SchemeGroupVersion.WithResource("backendtrafficpolicies") + +var backendtrafficpoliciesKind = v1alpha1.SchemeGroupVersion.WithKind("BackendTrafficPolicy") + +// Get takes name of the backendTrafficPolicy, and returns the corresponding backendTrafficPolicy object, and an error if there is any. +func (c *FakeBackendTrafficPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BackendTrafficPolicy, err error) { + emptyResult := &v1alpha1.BackendTrafficPolicy{} + obj, err := c.Fake. + Invokes(testing.NewGetActionWithOptions(backendtrafficpoliciesResource, c.ns, name, options), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha1.BackendTrafficPolicy), err +} + +// List takes label and field selectors, and returns the list of BackendTrafficPolicies that match those selectors. +func (c *FakeBackendTrafficPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BackendTrafficPolicyList, err error) { + emptyResult := &v1alpha1.BackendTrafficPolicyList{} + obj, err := c.Fake. + Invokes(testing.NewListActionWithOptions(backendtrafficpoliciesResource, backendtrafficpoliciesKind, c.ns, opts), emptyResult) + + if obj == nil { + return emptyResult, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.BackendTrafficPolicyList{ListMeta: obj.(*v1alpha1.BackendTrafficPolicyList).ListMeta} + for _, item := range obj.(*v1alpha1.BackendTrafficPolicyList).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 backendTrafficPolicies. +func (c *FakeBackendTrafficPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchActionWithOptions(backendtrafficpoliciesResource, c.ns, opts)) + +} + +// Create takes the representation of a backendTrafficPolicy and creates it. Returns the server's representation of the backendTrafficPolicy, and an error, if there is any. +func (c *FakeBackendTrafficPolicies) Create(ctx context.Context, backendTrafficPolicy *v1alpha1.BackendTrafficPolicy, opts v1.CreateOptions) (result *v1alpha1.BackendTrafficPolicy, err error) { + emptyResult := &v1alpha1.BackendTrafficPolicy{} + obj, err := c.Fake. + Invokes(testing.NewCreateActionWithOptions(backendtrafficpoliciesResource, c.ns, backendTrafficPolicy, opts), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha1.BackendTrafficPolicy), err +} + +// Update takes the representation of a backendTrafficPolicy and updates it. Returns the server's representation of the backendTrafficPolicy, and an error, if there is any. +func (c *FakeBackendTrafficPolicies) Update(ctx context.Context, backendTrafficPolicy *v1alpha1.BackendTrafficPolicy, opts v1.UpdateOptions) (result *v1alpha1.BackendTrafficPolicy, err error) { + emptyResult := &v1alpha1.BackendTrafficPolicy{} + obj, err := c.Fake. + Invokes(testing.NewUpdateActionWithOptions(backendtrafficpoliciesResource, c.ns, backendTrafficPolicy, opts), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha1.BackendTrafficPolicy), 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 *FakeBackendTrafficPolicies) UpdateStatus(ctx context.Context, backendTrafficPolicy *v1alpha1.BackendTrafficPolicy, opts v1.UpdateOptions) (result *v1alpha1.BackendTrafficPolicy, err error) { + emptyResult := &v1alpha1.BackendTrafficPolicy{} + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceActionWithOptions(backendtrafficpoliciesResource, "status", c.ns, backendTrafficPolicy, opts), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha1.BackendTrafficPolicy), err +} + +// Delete takes name of the backendTrafficPolicy and deletes it. Returns an error if one occurs. +func (c *FakeBackendTrafficPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(backendtrafficpoliciesResource, c.ns, name, opts), &v1alpha1.BackendTrafficPolicy{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeBackendTrafficPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionActionWithOptions(backendtrafficpoliciesResource, c.ns, opts, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.BackendTrafficPolicyList{}) + return err +} + +// Patch applies the patch and returns the patched backendTrafficPolicy. +func (c *FakeBackendTrafficPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BackendTrafficPolicy, err error) { + emptyResult := &v1alpha1.BackendTrafficPolicy{} + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceActionWithOptions(backendtrafficpoliciesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha1.BackendTrafficPolicy), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied backendTrafficPolicy. +func (c *FakeBackendTrafficPolicies) Apply(ctx context.Context, backendTrafficPolicy *apisxv1alpha1.BackendTrafficPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.BackendTrafficPolicy, err error) { + if backendTrafficPolicy == nil { + return nil, fmt.Errorf("backendTrafficPolicy provided to Apply must not be nil") + } + data, err := json.Marshal(backendTrafficPolicy) + if err != nil { + return nil, err + } + name := backendTrafficPolicy.Name + if name == nil { + return nil, fmt.Errorf("backendTrafficPolicy.Name must be provided to Apply") + } + emptyResult := &v1alpha1.BackendTrafficPolicy{} + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceActionWithOptions(backendtrafficpoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha1.BackendTrafficPolicy), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeBackendTrafficPolicies) ApplyStatus(ctx context.Context, backendTrafficPolicy *apisxv1alpha1.BackendTrafficPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.BackendTrafficPolicy, err error) { + if backendTrafficPolicy == nil { + return nil, fmt.Errorf("backendTrafficPolicy provided to Apply must not be nil") + } + data, err := json.Marshal(backendTrafficPolicy) + if err != nil { + return nil, err + } + name := backendTrafficPolicy.Name + if name == nil { + return nil, fmt.Errorf("backendTrafficPolicy.Name must be provided to Apply") + } + emptyResult := &v1alpha1.BackendTrafficPolicy{} + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceActionWithOptions(backendtrafficpoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha1.BackendTrafficPolicy), err +} diff --git a/pkg/client/clientset/versioned/typed/apisx/v1alpha1/generated_expansion.go b/pkg/client/clientset/versioned/typed/apisx/v1alpha1/generated_expansion.go index f42f0ed53e..ad8c5e1498 100644 --- a/pkg/client/clientset/versioned/typed/apisx/v1alpha1/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/apisx/v1alpha1/generated_expansion.go @@ -18,4 +18,6 @@ limitations under the License. package v1alpha1 +type BackendTrafficPolicyExpansion interface{} + type ListenerSetExpansion interface{} diff --git a/pkg/client/informers/externalversions/apisx/interface.go b/pkg/client/informers/externalversions/apisx/interface.go index 56e4504b88..458ec817b4 100644 --- a/pkg/client/informers/externalversions/apisx/interface.go +++ b/pkg/client/informers/externalversions/apisx/interface.go @@ -20,7 +20,6 @@ package apisx import ( v1alpha1 "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apisx/v1alpha1" - v1alpha2 "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apisx/v1alpha2" internalinterfaces "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/internalinterfaces" ) @@ -28,8 +27,6 @@ import ( type Interface interface { // V1alpha1 provides access to shared informers for resources in V1alpha1. V1alpha1() v1alpha1.Interface - // V1alpha2 provides access to shared informers for resources in V1alpha2. - V1alpha2() v1alpha2.Interface } type group struct { @@ -47,8 +44,3 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList func (g *group) V1alpha1() v1alpha1.Interface { return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) } - -// V1alpha2 returns a new v1alpha2.Interface. -func (g *group) V1alpha2() v1alpha2.Interface { - return v1alpha2.New(g.factory, g.namespace, g.tweakListOptions) -} diff --git a/pkg/client/informers/externalversions/apisx/v1alpha1/backendtrafficpolicy.go b/pkg/client/informers/externalversions/apisx/v1alpha1/backendtrafficpolicy.go new file mode 100644 index 0000000000..27a5e77fb9 --- /dev/null +++ b/pkg/client/informers/externalversions/apisx/v1alpha1/backendtrafficpolicy.go @@ -0,0 +1,90 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + apisxv1alpha1 "sigs.k8s.io/gateway-api/apisx/v1alpha1" + versioned "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned" + internalinterfaces "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/internalinterfaces" + v1alpha1 "sigs.k8s.io/gateway-api/pkg/client/listers/apisx/v1alpha1" +) + +// BackendTrafficPolicyInformer provides access to a shared informer and lister for +// BackendTrafficPolicies. +type BackendTrafficPolicyInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.BackendTrafficPolicyLister +} + +type backendTrafficPolicyInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewBackendTrafficPolicyInformer constructs a new informer for BackendTrafficPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewBackendTrafficPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredBackendTrafficPolicyInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredBackendTrafficPolicyInformer constructs a new informer for BackendTrafficPolicy type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredBackendTrafficPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExperimentalV1alpha1().BackendTrafficPolicies(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExperimentalV1alpha1().BackendTrafficPolicies(namespace).Watch(context.TODO(), options) + }, + }, + &apisxv1alpha1.BackendTrafficPolicy{}, + resyncPeriod, + indexers, + ) +} + +func (f *backendTrafficPolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredBackendTrafficPolicyInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *backendTrafficPolicyInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apisxv1alpha1.BackendTrafficPolicy{}, f.defaultInformer) +} + +func (f *backendTrafficPolicyInformer) Lister() v1alpha1.BackendTrafficPolicyLister { + return v1alpha1.NewBackendTrafficPolicyLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/informers/externalversions/apisx/v1alpha1/interface.go b/pkg/client/informers/externalversions/apisx/v1alpha1/interface.go index f5eaef9b76..b95538a998 100644 --- a/pkg/client/informers/externalversions/apisx/v1alpha1/interface.go +++ b/pkg/client/informers/externalversions/apisx/v1alpha1/interface.go @@ -24,6 +24,8 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { + // BackendTrafficPolicies returns a BackendTrafficPolicyInformer. + BackendTrafficPolicies() BackendTrafficPolicyInformer // ListenerSets returns a ListenerSetInformer. ListenerSets() ListenerSetInformer } @@ -39,6 +41,11 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } +// BackendTrafficPolicies returns a BackendTrafficPolicyInformer. +func (v *version) BackendTrafficPolicies() BackendTrafficPolicyInformer { + return &backendTrafficPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + // ListenerSets returns a ListenerSetInformer. func (v *version) ListenerSets() ListenerSetInformer { return &listenerSetInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index 9218f3eb68..d034a3b057 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -28,7 +28,6 @@ import ( v1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" v1alpha1 "sigs.k8s.io/gateway-api/apisx/v1alpha1" - apisxv1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" ) // GenericInformer is type of SharedIndexInformer which will locate and delegate to other @@ -96,13 +95,11 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Gateway().V1beta1().ReferenceGrants().Informer()}, nil // Group=gateway.networking.x-k8s.io, Version=v1alpha1 + case v1alpha1.SchemeGroupVersion.WithResource("backendtrafficpolicies"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Experimental().V1alpha1().BackendTrafficPolicies().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("listenersets"): return &genericInformer{resource: resource.GroupResource(), informer: f.Experimental().V1alpha1().ListenerSets().Informer()}, nil - // Group=gateway.networking.x-k8s.io, Version=v1alpha2 - case apisxv1alpha2.SchemeGroupVersion.WithResource("backendtrafficpolicies"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Experimental().V1alpha2().BackendTrafficPolicies().Informer()}, nil - } return nil, fmt.Errorf("no informer found for %v", resource) diff --git a/pkg/client/listers/apisx/v1alpha1/backendtrafficpolicy.go b/pkg/client/listers/apisx/v1alpha1/backendtrafficpolicy.go new file mode 100644 index 0000000000..5f6d3b4e54 --- /dev/null +++ b/pkg/client/listers/apisx/v1alpha1/backendtrafficpolicy.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" + "k8s.io/client-go/tools/cache" + v1alpha1 "sigs.k8s.io/gateway-api/apisx/v1alpha1" +) + +// BackendTrafficPolicyLister helps list BackendTrafficPolicies. +// All objects returned here must be treated as read-only. +type BackendTrafficPolicyLister interface { + // List lists all BackendTrafficPolicies in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.BackendTrafficPolicy, err error) + // BackendTrafficPolicies returns an object that can list and get BackendTrafficPolicies. + BackendTrafficPolicies(namespace string) BackendTrafficPolicyNamespaceLister + BackendTrafficPolicyListerExpansion +} + +// backendTrafficPolicyLister implements the BackendTrafficPolicyLister interface. +type backendTrafficPolicyLister struct { + listers.ResourceIndexer[*v1alpha1.BackendTrafficPolicy] +} + +// NewBackendTrafficPolicyLister returns a new BackendTrafficPolicyLister. +func NewBackendTrafficPolicyLister(indexer cache.Indexer) BackendTrafficPolicyLister { + return &backendTrafficPolicyLister{listers.New[*v1alpha1.BackendTrafficPolicy](indexer, v1alpha1.Resource("backendtrafficpolicy"))} +} + +// BackendTrafficPolicies returns an object that can list and get BackendTrafficPolicies. +func (s *backendTrafficPolicyLister) BackendTrafficPolicies(namespace string) BackendTrafficPolicyNamespaceLister { + return backendTrafficPolicyNamespaceLister{listers.NewNamespaced[*v1alpha1.BackendTrafficPolicy](s.ResourceIndexer, namespace)} +} + +// BackendTrafficPolicyNamespaceLister helps list and get BackendTrafficPolicies. +// All objects returned here must be treated as read-only. +type BackendTrafficPolicyNamespaceLister interface { + // List lists all BackendTrafficPolicies in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.BackendTrafficPolicy, err error) + // Get retrieves the BackendTrafficPolicy from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.BackendTrafficPolicy, error) + BackendTrafficPolicyNamespaceListerExpansion +} + +// backendTrafficPolicyNamespaceLister implements the BackendTrafficPolicyNamespaceLister +// interface. +type backendTrafficPolicyNamespaceLister struct { + listers.ResourceIndexer[*v1alpha1.BackendTrafficPolicy] +} diff --git a/pkg/client/listers/apisx/v1alpha1/expansion_generated.go b/pkg/client/listers/apisx/v1alpha1/expansion_generated.go index 7c717d0c17..cfeb378ce7 100644 --- a/pkg/client/listers/apisx/v1alpha1/expansion_generated.go +++ b/pkg/client/listers/apisx/v1alpha1/expansion_generated.go @@ -18,6 +18,14 @@ limitations under the License. package v1alpha1 +// BackendTrafficPolicyListerExpansion allows custom methods to be added to +// BackendTrafficPolicyLister. +type BackendTrafficPolicyListerExpansion interface{} + +// BackendTrafficPolicyNamespaceListerExpansion allows custom methods to be added to +// BackendTrafficPolicyNamespaceLister. +type BackendTrafficPolicyNamespaceListerExpansion interface{} + // ListenerSetListerExpansion allows custom methods to be added to // ListenerSetLister. type ListenerSetListerExpansion interface{} diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go index 88b5f2e014..4477cf2bb6 100644 --- a/pkg/generated/openapi/zz_generated.openapi.go +++ b/pkg/generated/openapi/zz_generated.openapi.go @@ -191,6 +191,9 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "sigs.k8s.io/gateway-api/apis/v1beta1.ReferenceGrantList": schema_sigsk8sio_gateway_api_apis_v1beta1_ReferenceGrantList(ref), "sigs.k8s.io/gateway-api/apis/v1beta1.ReferenceGrantSpec": schema_sigsk8sio_gateway_api_apis_v1beta1_ReferenceGrantSpec(ref), "sigs.k8s.io/gateway-api/apis/v1beta1.ReferenceGrantTo": schema_sigsk8sio_gateway_api_apis_v1beta1_ReferenceGrantTo(ref), + "sigs.k8s.io/gateway-api/apisx/v1alpha1.BackendTrafficPolicy": schema_sigsk8sio_gateway_api_apisx_v1alpha1_BackendTrafficPolicy(ref), + "sigs.k8s.io/gateway-api/apisx/v1alpha1.BackendTrafficPolicyList": schema_sigsk8sio_gateway_api_apisx_v1alpha1_BackendTrafficPolicyList(ref), + "sigs.k8s.io/gateway-api/apisx/v1alpha1.BackendTrafficPolicySpec": schema_sigsk8sio_gateway_api_apisx_v1alpha1_BackendTrafficPolicySpec(ref), "sigs.k8s.io/gateway-api/apisx/v1alpha1.ListenerEntry": schema_sigsk8sio_gateway_api_apisx_v1alpha1_ListenerEntry(ref), "sigs.k8s.io/gateway-api/apisx/v1alpha1.ListenerEntryStatus": schema_sigsk8sio_gateway_api_apisx_v1alpha1_ListenerEntryStatus(ref), "sigs.k8s.io/gateway-api/apisx/v1alpha1.ListenerSet": schema_sigsk8sio_gateway_api_apisx_v1alpha1_ListenerSet(ref), @@ -198,11 +201,8 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "sigs.k8s.io/gateway-api/apisx/v1alpha1.ListenerSetSpec": schema_sigsk8sio_gateway_api_apisx_v1alpha1_ListenerSetSpec(ref), "sigs.k8s.io/gateway-api/apisx/v1alpha1.ListenerSetStatus": schema_sigsk8sio_gateway_api_apisx_v1alpha1_ListenerSetStatus(ref), "sigs.k8s.io/gateway-api/apisx/v1alpha1.ParentGatewayReference": schema_sigsk8sio_gateway_api_apisx_v1alpha1_ParentGatewayReference(ref), - "sigs.k8s.io/gateway-api/apisx/v1alpha2.BackendTrafficPolicy": schema_sigsk8sio_gateway_api_apisx_v1alpha2_BackendTrafficPolicy(ref), - "sigs.k8s.io/gateway-api/apisx/v1alpha2.BackendTrafficPolicyList": schema_sigsk8sio_gateway_api_apisx_v1alpha2_BackendTrafficPolicyList(ref), - "sigs.k8s.io/gateway-api/apisx/v1alpha2.BackendTrafficPolicySpec": schema_sigsk8sio_gateway_api_apisx_v1alpha2_BackendTrafficPolicySpec(ref), - "sigs.k8s.io/gateway-api/apisx/v1alpha2.RequestRate": schema_sigsk8sio_gateway_api_apisx_v1alpha2_RequestRate(ref), - "sigs.k8s.io/gateway-api/apisx/v1alpha2.RetryConstraint": schema_sigsk8sio_gateway_api_apisx_v1alpha2_RetryConstraint(ref), + "sigs.k8s.io/gateway-api/apisx/v1alpha1.RequestRate": schema_sigsk8sio_gateway_api_apisx_v1alpha1_RequestRate(ref), + "sigs.k8s.io/gateway-api/apisx/v1alpha1.RetryConstraint": schema_sigsk8sio_gateway_api_apisx_v1alpha1_RetryConstraint(ref), } } @@ -7673,6 +7673,157 @@ func schema_sigsk8sio_gateway_api_apis_v1beta1_ReferenceGrantTo(ref common.Refer } } +func schema_sigsk8sio_gateway_api_apisx_v1alpha1_BackendTrafficPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "BackendTrafficPolicy defines the configuration for how traffic to a target backend should be handled.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "Spec defines the desired state of BackendTrafficPolicy.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha1.BackendTrafficPolicySpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "Status defines the current state of BackendTrafficPolicy.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyStatus"), + }, + }, + }, + Required: []string{"spec"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyStatus", "sigs.k8s.io/gateway-api/apisx/v1alpha1.BackendTrafficPolicySpec"}, + } +} + +func schema_sigsk8sio_gateway_api_apisx_v1alpha1_BackendTrafficPolicyList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "BackendTrafficPolicyList contains a list of BackendTrafficPolicies", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha1.BackendTrafficPolicy"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/gateway-api/apisx/v1alpha1.BackendTrafficPolicy"}, + } +} + +func schema_sigsk8sio_gateway_api_apisx_v1alpha1_BackendTrafficPolicySpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "BackendTrafficPolicySpec define the desired state of BackendTrafficPolicy Note: there is no Override or Default policy configuration.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "targetRefs": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "group", + "kind", + "name", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "TargetRefs identifies API object(s) to apply this policy to. Currently, Backends (A grouping of like endpoints such as Service, ServiceImport, or any implementation-specific backendRef) are the only valid API target references.\n\nCurrently, a TargetRef can not be scoped to a specific port on a Service.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.LocalPolicyTargetReference"), + }, + }, + }, + }, + }, + "retryConstraint": { + SchemaProps: spec.SchemaProps{ + Description: "RetryConstraint defines the configuration for when to allow or prevent further retries to a target backend, by dynamically calculating a 'retry budget'. This budget is calculated based on the percentage of incoming traffic composed of retries over a given time interval. Once the budget is exceeded, additional retries will be rejected.\n\nFor example, if the retry budget interval is 10 seconds, there have been 1000 active requests in the past 10 seconds, and the allowed percentage of requests that can be retried is 20% (the default), then 200 of those requests may be composed of retries. Active requests will only be considered for the duration of the interval when calculating the retry budget. Retrying the same original request multiple times within the retry budget interval will lead to each retry being counted towards calculating the budget.\n\nConfiguring a RetryConstraint in BackendTrafficPolicy is compatible with HTTPRoute Retry settings for each HTTPRouteRule that targets the same backend. While the HTTPRouteRule Retry stanza can specify whether a request will be retried, and the number of retry attempts each client may perform, RetryConstraint helps prevent cascading failures such as retry storms during periods of consistent failures.\n\nAfter the retry budget has been exceeded, additional retries to the backend MUST return a 503 response to the client.\n\nAdditional configurations for defining a constraint on retries MAY be defined in the future.\n\nSupport: Extended\n\n", + Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha1.RetryConstraint"), + }, + }, + "sessionPersistence": { + SchemaProps: spec.SchemaProps{ + Description: "SessionPersistence defines and configures session persistence for the backend.\n\nSupport: Extended", + Ref: ref("sigs.k8s.io/gateway-api/apis/v1.SessionPersistence"), + }, + }, + }, + Required: []string{"targetRefs"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/gateway-api/apis/v1.SessionPersistence", "sigs.k8s.io/gateway-api/apis/v1alpha2.LocalPolicyTargetReference", "sigs.k8s.io/gateway-api/apisx/v1alpha1.RetryConstraint"}, + } +} + func schema_sigsk8sio_gateway_api_apisx_v1alpha1_ListenerEntry(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -8050,158 +8201,7 @@ func schema_sigsk8sio_gateway_api_apisx_v1alpha1_ParentGatewayReference(ref comm } } -func schema_sigsk8sio_gateway_api_apisx_v1alpha2_BackendTrafficPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "BackendTrafficPolicy defines the configuration for how traffic to a target backend should be handled.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the desired state of BackendTrafficPolicy.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha2.BackendTrafficPolicySpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status defines the current state of BackendTrafficPolicy.", - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyStatus"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/gateway-api/apis/v1alpha2.PolicyStatus", "sigs.k8s.io/gateway-api/apisx/v1alpha2.BackendTrafficPolicySpec"}, - } -} - -func schema_sigsk8sio_gateway_api_apisx_v1alpha2_BackendTrafficPolicyList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "BackendTrafficPolicyList contains a list of BackendTrafficPolicies", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha2.BackendTrafficPolicy"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/gateway-api/apisx/v1alpha2.BackendTrafficPolicy"}, - } -} - -func schema_sigsk8sio_gateway_api_apisx_v1alpha2_BackendTrafficPolicySpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "BackendTrafficPolicySpec define the desired state of BackendTrafficPolicy Note: there is no Override or Default policy configuration.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "targetRefs": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "group", - "kind", - "name", - }, - "x-kubernetes-list-type": "map", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "TargetRefs identifies API object(s) to apply this policy to. Currently, Backends (A grouping of like endpoints such as Service, ServiceImport, or any implementation-specific backendRef) are the only valid API target references.\n\nCurrently, a TargetRef can not be scoped to a specific port on a Service.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/gateway-api/apis/v1alpha2.LocalPolicyTargetReference"), - }, - }, - }, - }, - }, - "retryConstraint": { - SchemaProps: spec.SchemaProps{ - Description: "RetryConstraint defines the configuration for when to allow or prevent further retries to a target backend, by dynamically calculating a 'retry budget'. This budget is calculated based on the percentage of incoming traffic composed of retries over a given time interval. Once the budget is exceeded, additional retries will be rejected.\n\nFor example, if the retry budget interval is 10 seconds, there have been 1000 active requests in the past 10 seconds, and the allowed percentage of requests that can be retried is 20% (the default), then 200 of those requests may be composed of retries. Active requests will only be considered for the duration of the interval when calculating the retry budget. Retrying the same original request multiple times within the retry budget interval will lead to each retry being counted towards calculating the budget.\n\nConfiguring a RetryConstraint in BackendTrafficPolicy is compatible with HTTPRoute Retry settings for each HTTPRouteRule that targets the same backend. While the HTTPRouteRule Retry stanza can specify whether a request will be retried, and the number of retry attempts each client may perform, RetryConstraint helps prevent cascading failures such as retry storms during periods of consistent failures.\n\nAfter the retry budget has been exceeded, additional retries to the backend MUST return a 503 response to the client.\n\nAdditional configurations for defining a constraint on retries MAY be defined in the future.\n\nSupport: Extended\n\n", - Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha2.RetryConstraint"), - }, - }, - "sessionPersistence": { - SchemaProps: spec.SchemaProps{ - Description: "SessionPersistence defines and configures session persistence for the backend.\n\nSupport: Extended", - Ref: ref("sigs.k8s.io/gateway-api/apis/v1.SessionPersistence"), - }, - }, - }, - Required: []string{"targetRefs"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/gateway-api/apis/v1.SessionPersistence", "sigs.k8s.io/gateway-api/apis/v1alpha2.LocalPolicyTargetReference", "sigs.k8s.io/gateway-api/apisx/v1alpha2.RetryConstraint"}, - } -} - -func schema_sigsk8sio_gateway_api_apisx_v1alpha2_RequestRate(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_sigsk8sio_gateway_api_apisx_v1alpha1_RequestRate(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -8228,7 +8228,7 @@ func schema_sigsk8sio_gateway_api_apisx_v1alpha2_RequestRate(ref common.Referenc } } -func schema_sigsk8sio_gateway_api_apisx_v1alpha2_RetryConstraint(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_sigsk8sio_gateway_api_apisx_v1alpha1_RetryConstraint(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -8252,13 +8252,13 @@ func schema_sigsk8sio_gateway_api_apisx_v1alpha2_RetryConstraint(ref common.Refe "minRetryRate": { SchemaProps: spec.SchemaProps{ Description: "MinRetryRate defines the minimum rate of retries that will be allowable over a specified duration of time.\n\nThe effective overall minimum rate of retries targeting the backend service may be much higher, as there can be any number of clients which are applying this setting locally.\n\nThis ensures that requests can still be retried during periods of low traffic, where the budget for retries may be calculated as a very low value.\n\nSupport: Extended", - Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha2.RequestRate"), + Ref: ref("sigs.k8s.io/gateway-api/apisx/v1alpha1.RequestRate"), }, }, }, }, }, Dependencies: []string{ - "sigs.k8s.io/gateway-api/apisx/v1alpha2.RequestRate"}, + "sigs.k8s.io/gateway-api/apisx/v1alpha1.RequestRate"}, } } diff --git a/pkg/test/cel/backendtrafficpolicy_test.go b/pkg/test/cel/backendtrafficpolicy_test.go index b5aaf0a011..ca7aee691f 100644 --- a/pkg/test/cel/backendtrafficpolicy_test.go +++ b/pkg/test/cel/backendtrafficpolicy_test.go @@ -27,7 +27,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" gatewayv1 "sigs.k8s.io/gateway-api/apis/v1" - gatewayv1a2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" + gatewayv1a2 "sigs.k8s.io/gateway-api/apisx/v1alpha1" ) func TestBackendTrafficPolicyConfig(t *testing.T) { From 7c8fe592b9361f395bf043ea5dcad18bc2c32ffa Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Mon, 3 Mar 2025 19:19:29 -0500 Subject: [PATCH 26/32] add main_test --- pkg/test/cel/main_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/test/cel/main_test.go b/pkg/test/cel/main_test.go index 96502432ef..3ba7de1d20 100644 --- a/pkg/test/cel/main_test.go +++ b/pkg/test/cel/main_test.go @@ -27,6 +27,7 @@ import ( "sigs.k8s.io/gateway-api/apis/v1alpha2" "sigs.k8s.io/gateway-api/apis/v1alpha3" "sigs.k8s.io/gateway-api/apis/v1beta1" + apisxv1alpha1 "sigs.k8s.io/gateway-api/apisx/v1alpha1" "k8s.io/client-go/tools/clientcmd" "sigs.k8s.io/controller-runtime/pkg/client" @@ -53,6 +54,7 @@ func TestMain(m *testing.M) { v1alpha2.Install(k8sClient.Scheme()) v1beta1.Install(k8sClient.Scheme()) v1.Install(k8sClient.Scheme()) + apisxv1alpha1.Install(k8sClient.Scheme()) os.Exit(m.Run()) } From 6fc4796544cd94a51caa2f00a51bdbee9da594c8 Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Mon, 3 Mar 2025 19:23:50 -0500 Subject: [PATCH 27/32] rename file --- .../{backendtrafficpolicy.go => backendtrafficpolicy_types.go} | 1 - 1 file changed, 1 deletion(-) rename apisx/v1alpha1/{backendtrafficpolicy.go => backendtrafficpolicy_types.go} (99%) diff --git a/apisx/v1alpha1/backendtrafficpolicy.go b/apisx/v1alpha1/backendtrafficpolicy_types.go similarity index 99% rename from apisx/v1alpha1/backendtrafficpolicy.go rename to apisx/v1alpha1/backendtrafficpolicy_types.go index e58d8867fe..166fdf8294 100644 --- a/apisx/v1alpha1/backendtrafficpolicy.go +++ b/apisx/v1alpha1/backendtrafficpolicy_types.go @@ -36,7 +36,6 @@ type BackendTrafficPolicy struct { // Support: Extended // // +optional - // metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` From bc35cad657435641b0be4ae3be611adf45df980d Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Mon, 3 Mar 2025 19:44:01 -0500 Subject: [PATCH 28/32] fix missing quotes :) --- apisx/v1alpha1/backendtrafficpolicy_types.go | 4 +- ...rking.x-k8s.io_backendtrafficpolicies.yaml | 598 ++++++++++++++++++ 2 files changed, 600 insertions(+), 2 deletions(-) create mode 100644 config/crd/experimental/gateway.networking.x-k8s.io_backendtrafficpolicies.yaml diff --git a/apisx/v1alpha1/backendtrafficpolicy_types.go b/apisx/v1alpha1/backendtrafficpolicy_types.go index 166fdf8294..6e043bf561 100644 --- a/apisx/v1alpha1/backendtrafficpolicy_types.go +++ b/apisx/v1alpha1/backendtrafficpolicy_types.go @@ -136,7 +136,7 @@ type RetryConstraint struct { // Support: Extended // // +optional - // +kubebuilder:default=10s + // +kubebuilder:default="10s" // +kubebuilder:validation:XValidation:message="budgetInterval can not be greater than one hour or less than one second",rule="!(duration(self.budgetInterval) < duration('1s') || duration(self.budgetInterval) > duration('1h'))" BudgetInterval *Duration `json:"budgetInterval,omitempty"` @@ -154,6 +154,6 @@ type RetryConstraint struct { // Support: Extended // // +optional - // +kubebuilder:default={count: 10, interval: 1s} + // +kubebuilder:default={count: 10, interval: "1s"} MinRetryRate *RequestRate `json:"minRetryRate,omitempty"` } diff --git a/config/crd/experimental/gateway.networking.x-k8s.io_backendtrafficpolicies.yaml b/config/crd/experimental/gateway.networking.x-k8s.io_backendtrafficpolicies.yaml new file mode 100644 index 0000000000..a018a245d2 --- /dev/null +++ b/config/crd/experimental/gateway.networking.x-k8s.io_backendtrafficpolicies.yaml @@ -0,0 +1,598 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.kubernetes.io: https://github.com/kubernetes-sigs/gateway-api/pull/3328 + gateway.networking.k8s.io/bundle-version: v1.2.1 + gateway.networking.k8s.io/channel: experimental + creationTimestamp: null + labels: + gateway.networking.k8s.io/policy: Direct + name: backendtrafficpolicies.gateway.networking.x-k8s.io +spec: + group: gateway.networking.x-k8s.io + names: + categories: + - gateway-api + kind: BackendTrafficPolicy + listKind: BackendTrafficPolicyList + plural: backendtrafficpolicies + shortNames: + - btrafficpolicy + singular: backendtrafficpolicy + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + BackendTrafficPolicy defines the configuration for how traffic to a + target backend should be handled. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: Spec defines the desired state of BackendTrafficPolicy. + properties: + retryConstraint: + description: |- + RetryConstraint defines the configuration for when to allow or prevent + further retries to a target backend, by dynamically calculating a 'retry + budget'. This budget is calculated based on the percentage of incoming + traffic composed of retries over a given time interval. Once the budget + is exceeded, additional retries will be rejected. + + For example, if the retry budget interval is 10 seconds, there have been + 1000 active requests in the past 10 seconds, and the allowed percentage + of requests that can be retried is 20% (the default), then 200 of those + requests may be composed of retries. Active requests will only be + considered for the duration of the interval when calculating the retry + budget. Retrying the same original request multiple times within the + retry budget interval will lead to each retry being counted towards + calculating the budget. + + Configuring a RetryConstraint in BackendTrafficPolicy is compatible with + HTTPRoute Retry settings for each HTTPRouteRule that targets the same + backend. While the HTTPRouteRule Retry stanza can specify whether a + request will be retried, and the number of retry attempts each client + may perform, RetryConstraint helps prevent cascading failures such as + retry storms during periods of consistent failures. + + After the retry budget has been exceeded, additional retries to the + backend MUST return a 503 response to the client. + + Additional configurations for defining a constraint on retries MAY be + defined in the future. + + Support: Extended + properties: + budgetInterval: + default: 10s + description: |- + BudgetInterval defines the duration in which requests will be considered + for calculating the budget for retries. + + Support: Extended + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string + x-kubernetes-validations: + - message: budgetInterval can not be greater than one hour or + less than one second + rule: '!(duration(self.budgetInterval) < duration(''1s'') || + duration(self.budgetInterval) > duration(''1h''))' + budgetPercent: + default: 20 + description: |- + BudgetPercent defines the maximum percentage of active requests that may + be made up of retries. + + Support: Extended + maximum: 100 + minimum: 0 + type: integer + minRetryRate: + default: + count: 10 + interval: 1s + description: |- + MinRetryRate defines the minimum rate of retries that will be allowable + over a specified duration of time. + + The effective overall minimum rate of retries targeting the backend + service may be much higher, as there can be any number of clients which + are applying this setting locally. + + This ensures that requests can still be retried during periods of low + traffic, where the budget for retries may be calculated as a very low + value. + + Support: Extended + properties: + count: + description: |- + Count specifies the number of requests per time interval. + + Support: Extended + maximum: 1000000 + minimum: 1 + type: integer + interval: + description: |- + Interval specifies the divisor of the rate of requests, the amount of + time during which the given count of requests occur. + + Support: Extended + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string + type: object + x-kubernetes-validations: + - message: interval can not be greater than one hour + rule: '!(duration(self.interval) == duration(''0s'') || duration(self.interval) + > duration(''1h''))' + type: object + sessionPersistence: + description: |- + SessionPersistence defines and configures session persistence + for the backend. + + Support: Extended + properties: + absoluteTimeout: + description: |- + AbsoluteTimeout defines the absolute timeout of the persistent + session. Once the AbsoluteTimeout duration has elapsed, the + session becomes invalid. + + Support: Extended + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string + cookieConfig: + description: |- + CookieConfig provides configuration settings that are specific + to cookie-based session persistence. + + Support: Core + properties: + lifetimeType: + default: Session + description: |- + LifetimeType specifies whether the cookie has a permanent or + session-based lifetime. A permanent cookie persists until its + specified expiry time, defined by the Expires or Max-Age cookie + attributes, while a session cookie is deleted when the current + session ends. + + When set to "Permanent", AbsoluteTimeout indicates the + cookie's lifetime via the Expires or Max-Age cookie attributes + and is required. + + When set to "Session", AbsoluteTimeout indicates the + absolute lifetime of the cookie tracked by the gateway and + is optional. + + Defaults to "Session". + + Support: Core for "Session" type + + Support: Extended for "Permanent" type + enum: + - Permanent + - Session + type: string + type: object + idleTimeout: + description: |- + IdleTimeout defines the idle timeout of the persistent session. + Once the session has been idle for more than the specified + IdleTimeout duration, the session becomes invalid. + + Support: Extended + pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ + type: string + sessionName: + description: |- + SessionName defines the name of the persistent session token + which may be reflected in the cookie or the header. Users + should avoid reusing session names to prevent unintended + consequences, such as rejection or unpredictable behavior. + + Support: Implementation-specific + maxLength: 128 + type: string + type: + default: Cookie + description: |- + Type defines the type of session persistence such as through + the use a header or cookie. Defaults to cookie based session + persistence. + + Support: Core for "Cookie" type + + Support: Extended for "Header" type + enum: + - Cookie + - Header + type: string + type: object + x-kubernetes-validations: + - message: AbsoluteTimeout must be specified when cookie lifetimeType + is Permanent + rule: '!has(self.cookieConfig) || !has(self.cookieConfig.lifetimeType) + || self.cookieConfig.lifetimeType != ''Permanent'' || has(self.absoluteTimeout)' + targetRefs: + description: |- + TargetRefs identifies API object(s) to apply this policy to. + Currently, Backends (A grouping of like endpoints such as Service, + ServiceImport, or any implementation-specific backendRef) are the only + valid API target references. + + Currently, a TargetRef can not be scoped to a specific port on a + Service. + items: + description: |- + LocalPolicyTargetReference identifies an API object to apply a direct or + inherited policy to. This should be used as part of Policy resources + that can target Gateway API resources. For more information on how this + policy attachment model works, and a sample Policy resource, refer to + the policy attachment documentation for Gateway API. + properties: + group: + description: Group is the group of the target resource. + maxLength: 253 + pattern: ^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + type: string + kind: + description: Kind is kind of the target resource. + maxLength: 63 + minLength: 1 + pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$ + type: string + name: + description: Name is the name of the target resource. + maxLength: 253 + minLength: 1 + type: string + required: + - group + - kind + - name + type: object + maxItems: 16 + minItems: 1 + type: array + x-kubernetes-list-map-keys: + - group + - kind + - name + x-kubernetes-list-type: map + required: + - targetRefs + type: object + status: + description: Status defines the current state of BackendTrafficPolicy. + properties: + ancestors: + description: |- + Ancestors is a list of ancestor resources (usually Gateways) that are + associated with the policy, and the status of the policy with respect to + each ancestor. When this policy attaches to a parent, the controller that + manages the parent and the ancestors MUST add an entry to this list when + 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 + here. For example, if this list was full on BackendTLSPolicy, no + additional Gateways would be able to reference the Service targeted by + the BackendTLSPolicy. + items: + description: |- + 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 + the GatewayClass. Almost always, in this hierarchy, the Gateway will be the most + useful object to place Policy status on, so we recommend that implementations + 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: + ancestorRef: + description: |- + AncestorRef corresponds with a ParentRef in the spec that this + PolicyAncestorStatus struct describes the status of. + properties: + group: + default: gateway.networking.k8s.io + description: |- + Group is the group of the referent. + When unspecified, "gateway.networking.k8s.io" is inferred. + 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])?)*$ + type: string + kind: + default: Gateway + 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 + pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$ + type: string + name: + description: |- + Name is the name of the referent. + + Support: Core + maxLength: 253 + minLength: 1 + type: string + namespace: + description: |- + 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 + the intended destination of the connections are a Service targeted as a + ParentRef of the Route. + + + Support: Core + maxLength: 63 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + port: + description: |- + 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 + networking behaviors specified in a Route must apply to a specific port + as opposed to a listener(s) whose port(s) may be changed. When both Port + 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, + namespace, or hostname. If 1 of 2 Gateway listeners accept attachment + from the referencing Route, the Route MUST be considered successfully + 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 + minimum: 1 + type: integer + sectionName: + description: |- + 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. + * Service: Port name. When both Port (experimental) and SectionName + 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 + listeners can restrict which Routes can attach to them by Route kind, + namespace, or hostname. If 1 of 2 Gateway listeners accept attachment from + the referencing Route, the Route MUST be considered successfully + 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 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + type: string + required: + - name + type: object + conditions: + 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. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, + Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + 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 + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 8 + minItems: 1 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + controllerName: + description: |- + ControllerName is a domain/path string that indicates the name of the + 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. + maxLength: 253 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$ + type: string + required: + - ancestorRef + - controllerName + type: object + maxItems: 16 + type: array + required: + - ancestors + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null From 9a1f63ba4c5554eb113036f3871c1c954663b307 Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Mon, 3 Mar 2025 19:48:57 -0500 Subject: [PATCH 29/32] fix CEL condition --- apisx/v1alpha1/backendtrafficpolicy_types.go | 2 +- .../gateway.networking.x-k8s.io_backendtrafficpolicies.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apisx/v1alpha1/backendtrafficpolicy_types.go b/apisx/v1alpha1/backendtrafficpolicy_types.go index 6e043bf561..802decd4bd 100644 --- a/apisx/v1alpha1/backendtrafficpolicy_types.go +++ b/apisx/v1alpha1/backendtrafficpolicy_types.go @@ -137,7 +137,7 @@ type RetryConstraint struct { // // +optional // +kubebuilder:default="10s" - // +kubebuilder:validation:XValidation:message="budgetInterval can not be greater than one hour or less than one second",rule="!(duration(self.budgetInterval) < duration('1s') || duration(self.budgetInterval) > duration('1h'))" + // +kubebuilder:validation:XValidation:message="budgetInterval can not be greater than one hour or less than one second",rule="!(duration(self) < duration('1s') || duration(self) > duration('1h'))" BudgetInterval *Duration `json:"budgetInterval,omitempty"` // MinRetryRate defines the minimum rate of retries that will be allowable diff --git a/config/crd/experimental/gateway.networking.x-k8s.io_backendtrafficpolicies.yaml b/config/crd/experimental/gateway.networking.x-k8s.io_backendtrafficpolicies.yaml index a018a245d2..1249a95171 100644 --- a/config/crd/experimental/gateway.networking.x-k8s.io_backendtrafficpolicies.yaml +++ b/config/crd/experimental/gateway.networking.x-k8s.io_backendtrafficpolicies.yaml @@ -97,8 +97,8 @@ spec: x-kubernetes-validations: - message: budgetInterval can not be greater than one hour or less than one second - rule: '!(duration(self.budgetInterval) < duration(''1s'') || - duration(self.budgetInterval) > duration(''1h''))' + rule: '!(duration(self) < duration(''1s'') || duration(self) + > duration(''1h''))' budgetPercent: default: 20 description: |- From 46431b36b2708c7899ca77c3ee6bfaace8cd8eba Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Mon, 3 Mar 2025 20:03:27 -0500 Subject: [PATCH 30/32] move validation message to interval field directly --- apisx/v1alpha1/shared_types.go | 3 +-- ...ateway.networking.x-k8s.io_backendtrafficpolicies.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/apisx/v1alpha1/shared_types.go b/apisx/v1alpha1/shared_types.go index ef93c6f9c0..f811ace877 100644 --- a/apisx/v1alpha1/shared_types.go +++ b/apisx/v1alpha1/shared_types.go @@ -81,8 +81,6 @@ type ParentGatewayReference struct { } // RequestRate expresses a rate of requests over a given period of time. -// -// +kubebuilder:validation:XValidation:message="interval can not be greater than one hour",rule="!(duration(self.interval) == duration('0s') || duration(self.interval) > duration('1h'))" type RequestRate struct { // Count specifies the number of requests per time interval. // @@ -95,5 +93,6 @@ type RequestRate struct { // time during which the given count of requests occur. // // Support: Extended + // +kubebuilder:validation:XValidation:message="interval can not be greater than one hour",rule="!(duration(self) == duration('0s') || duration(self) > duration('1h'))" Interval *Duration `json:"interval,omitempty"` } diff --git a/config/crd/experimental/gateway.networking.x-k8s.io_backendtrafficpolicies.yaml b/config/crd/experimental/gateway.networking.x-k8s.io_backendtrafficpolicies.yaml index 1249a95171..f1bc424579 100644 --- a/config/crd/experimental/gateway.networking.x-k8s.io_backendtrafficpolicies.yaml +++ b/config/crd/experimental/gateway.networking.x-k8s.io_backendtrafficpolicies.yaml @@ -143,11 +143,11 @@ spec: Support: Extended pattern: ^([0-9]{1,5}(h|m|s|ms)){1,4}$ type: string + x-kubernetes-validations: + - message: interval can not be greater than one hour + rule: '!(duration(self) == duration(''0s'') || duration(self) + > duration(''1h''))' type: object - x-kubernetes-validations: - - message: interval can not be greater than one hour - rule: '!(duration(self.interval) == duration(''0s'') || duration(self.interval) - > duration(''1h''))' type: object sessionPersistence: description: |- From a7a263bf9fc9a7479cb6fc28e5783008e853cfb2 Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Mon, 3 Mar 2025 20:11:56 -0500 Subject: [PATCH 31/32] remove unused apisx/v1alpha2 file --- .../apisx/v1alpha2/backendtrafficpolicy.go | 90 ------------------- 1 file changed, 90 deletions(-) delete mode 100644 pkg/client/informers/externalversions/apisx/v1alpha2/backendtrafficpolicy.go diff --git a/pkg/client/informers/externalversions/apisx/v1alpha2/backendtrafficpolicy.go b/pkg/client/informers/externalversions/apisx/v1alpha2/backendtrafficpolicy.go deleted file mode 100644 index 45b3508436..0000000000 --- a/pkg/client/informers/externalversions/apisx/v1alpha2/backendtrafficpolicy.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "context" - time "time" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" - apisxv1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" - versioned "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned" - internalinterfaces "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/internalinterfaces" - v1alpha2 "sigs.k8s.io/gateway-api/pkg/client/listers/apisx/v1alpha2" -) - -// BackendTrafficPolicyInformer provides access to a shared informer and lister for -// BackendTrafficPolicies. -type BackendTrafficPolicyInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha2.BackendTrafficPolicyLister -} - -type backendTrafficPolicyInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewBackendTrafficPolicyInformer constructs a new informer for BackendTrafficPolicy type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewBackendTrafficPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredBackendTrafficPolicyInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredBackendTrafficPolicyInformer constructs a new informer for BackendTrafficPolicy type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredBackendTrafficPolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ExperimentalV1alpha2().BackendTrafficPolicies(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ExperimentalV1alpha2().BackendTrafficPolicies(namespace).Watch(context.TODO(), options) - }, - }, - &apisxv1alpha2.BackendTrafficPolicy{}, - resyncPeriod, - indexers, - ) -} - -func (f *backendTrafficPolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredBackendTrafficPolicyInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *backendTrafficPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apisxv1alpha2.BackendTrafficPolicy{}, f.defaultInformer) -} - -func (f *backendTrafficPolicyInformer) Lister() v1alpha2.BackendTrafficPolicyLister { - return v1alpha2.NewBackendTrafficPolicyLister(f.Informer().GetIndexer()) -} From 9a1d005f078ecb99f22021c6ce9c71dc986cc12d Mon Sep 17 00:00:00 2001 From: ericdbishop Date: Mon, 3 Mar 2025 20:16:35 -0500 Subject: [PATCH 32/32] remove more files from before merging experimental api versions --- .../apisx/v1alpha2/backendtrafficpolicy.go | 265 ------------------ .../v1alpha2/backendtrafficpolicyspec.go | 67 ----- .../apisx/v1alpha2/requestrate.go | 52 ---- .../apisx/v1alpha2/retryconstraint.go | 61 ---- .../typed/apisx/v1alpha2/apisx_client.go | 107 ------- .../apisx/v1alpha2/backendtrafficpolicy.go | 73 ----- .../versioned/typed/apisx/v1alpha2/doc.go | 20 -- .../typed/apisx/v1alpha2/fake/doc.go | 20 -- .../apisx/v1alpha2/fake/fake_apisx_client.go | 40 --- .../fake/fake_backendtrafficpolicy.go | 197 ------------- .../apisx/v1alpha2/generated_expansion.go | 21 -- .../apisx/v1alpha2/interface.go | 45 --- .../apisx/v1alpha2/backendtrafficpolicy.go | 70 ----- .../apisx/v1alpha2/expansion_generated.go | 27 -- 14 files changed, 1065 deletions(-) delete mode 100644 applyconfiguration/apisx/v1alpha2/backendtrafficpolicy.go delete mode 100644 applyconfiguration/apisx/v1alpha2/backendtrafficpolicyspec.go delete mode 100644 applyconfiguration/apisx/v1alpha2/requestrate.go delete mode 100644 applyconfiguration/apisx/v1alpha2/retryconstraint.go delete mode 100644 pkg/client/clientset/versioned/typed/apisx/v1alpha2/apisx_client.go delete mode 100644 pkg/client/clientset/versioned/typed/apisx/v1alpha2/backendtrafficpolicy.go delete mode 100644 pkg/client/clientset/versioned/typed/apisx/v1alpha2/doc.go delete mode 100644 pkg/client/clientset/versioned/typed/apisx/v1alpha2/fake/doc.go delete mode 100644 pkg/client/clientset/versioned/typed/apisx/v1alpha2/fake/fake_apisx_client.go delete mode 100644 pkg/client/clientset/versioned/typed/apisx/v1alpha2/fake/fake_backendtrafficpolicy.go delete mode 100644 pkg/client/clientset/versioned/typed/apisx/v1alpha2/generated_expansion.go delete mode 100644 pkg/client/informers/externalversions/apisx/v1alpha2/interface.go delete mode 100644 pkg/client/listers/apisx/v1alpha2/backendtrafficpolicy.go delete mode 100644 pkg/client/listers/apisx/v1alpha2/expansion_generated.go diff --git a/applyconfiguration/apisx/v1alpha2/backendtrafficpolicy.go b/applyconfiguration/apisx/v1alpha2/backendtrafficpolicy.go deleted file mode 100644 index ebc26151fc..0000000000 --- a/applyconfiguration/apisx/v1alpha2/backendtrafficpolicy.go +++ /dev/null @@ -1,265 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - managedfields "k8s.io/apimachinery/pkg/util/managedfields" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" - apisxv1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" - apisv1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha2" - internal "sigs.k8s.io/gateway-api/applyconfiguration/internal" -) - -// BackendTrafficPolicyApplyConfiguration represents a declarative configuration of the BackendTrafficPolicy type for use -// with apply. -type BackendTrafficPolicyApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *BackendTrafficPolicySpecApplyConfiguration `json:"spec,omitempty"` - Status *apisv1alpha2.PolicyStatusApplyConfiguration `json:"status,omitempty"` -} - -// BackendTrafficPolicy constructs a declarative configuration of the BackendTrafficPolicy type for use with -// apply. -func BackendTrafficPolicy(name, namespace string) *BackendTrafficPolicyApplyConfiguration { - b := &BackendTrafficPolicyApplyConfiguration{} - b.WithName(name) - b.WithNamespace(namespace) - b.WithKind("BackendTrafficPolicy") - b.WithAPIVersion("gateway.networking.x-k8s.io/v1alpha2") - return b -} - -// ExtractBackendTrafficPolicy extracts the applied configuration owned by fieldManager from -// backendTrafficPolicy. If no managedFields are found in backendTrafficPolicy for fieldManager, a -// BackendTrafficPolicyApplyConfiguration is returned with only the Name, Namespace (if applicable), -// APIVersion and Kind populated. It is possible that no managed fields were found for because other -// field managers have taken ownership of all the fields previously owned by fieldManager, or because -// the fieldManager never owned fields any fields. -// backendTrafficPolicy must be a unmodified BackendTrafficPolicy API object that was retrieved from the Kubernetes API. -// ExtractBackendTrafficPolicy provides a way to perform a extract/modify-in-place/apply workflow. -// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously -// applied if another fieldManager has updated or force applied any of the previously applied fields. -// Experimental! -func ExtractBackendTrafficPolicy(backendTrafficPolicy *apisxv1alpha2.BackendTrafficPolicy, fieldManager string) (*BackendTrafficPolicyApplyConfiguration, error) { - return extractBackendTrafficPolicy(backendTrafficPolicy, fieldManager, "") -} - -// ExtractBackendTrafficPolicyStatus is the same as ExtractBackendTrafficPolicy except -// that it extracts the status subresource applied configuration. -// Experimental! -func ExtractBackendTrafficPolicyStatus(backendTrafficPolicy *apisxv1alpha2.BackendTrafficPolicy, fieldManager string) (*BackendTrafficPolicyApplyConfiguration, error) { - return extractBackendTrafficPolicy(backendTrafficPolicy, fieldManager, "status") -} - -func extractBackendTrafficPolicy(backendTrafficPolicy *apisxv1alpha2.BackendTrafficPolicy, fieldManager string, subresource string) (*BackendTrafficPolicyApplyConfiguration, error) { - b := &BackendTrafficPolicyApplyConfiguration{} - err := managedfields.ExtractInto(backendTrafficPolicy, internal.Parser().Type("io.k8s.sigs.gateway-api.apisx.v1alpha2.BackendTrafficPolicy"), fieldManager, b, subresource) - if err != nil { - return nil, err - } - b.WithName(backendTrafficPolicy.Name) - b.WithNamespace(backendTrafficPolicy.Namespace) - - b.WithKind("BackendTrafficPolicy") - b.WithAPIVersion("gateway.networking.x-k8s.io/v1alpha2") - return b, nil -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithKind(value string) *BackendTrafficPolicyApplyConfiguration { - b.Kind = &value - return b -} - -// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIVersion field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithAPIVersion(value string) *BackendTrafficPolicyApplyConfiguration { - b.APIVersion = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithName(value string) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value - return b -} - -// WithGenerateName sets the GenerateName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GenerateName field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithGenerateName(value string) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithNamespace(value string) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value - return b -} - -// WithUID sets the UID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the UID field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithUID(value types.UID) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value - return b -} - -// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceVersion field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithResourceVersion(value string) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value - return b -} - -// WithGeneration sets the Generation field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Generation field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithGeneration(value int64) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value - return b -} - -// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value - return b -} - -// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value - return b -} - -// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value - return b -} - -// WithLabels puts the entries into the Labels field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Labels field, -// overwriting an existing map entries in Labels field with the same key. -func (b *BackendTrafficPolicyApplyConfiguration) WithLabels(entries map[string]string) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Labels[k] = v - } - return b -} - -// WithAnnotations puts the entries into the Annotations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Annotations field, -// overwriting an existing map entries in Annotations field with the same key. -func (b *BackendTrafficPolicyApplyConfiguration) WithAnnotations(entries map[string]string) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Annotations[k] = v - } - return b -} - -// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the OwnerReferences field. -func (b *BackendTrafficPolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - if values[i] == nil { - panic("nil value passed to WithOwnerReferences") - } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) - } - return b -} - -// WithFinalizers adds the given value to the Finalizers field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Finalizers field. -func (b *BackendTrafficPolicyApplyConfiguration) WithFinalizers(values ...string) *BackendTrafficPolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) - } - return b -} - -func (b *BackendTrafficPolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { - if b.ObjectMetaApplyConfiguration == nil { - b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} - } -} - -// WithSpec sets the Spec field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Spec field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithSpec(value *BackendTrafficPolicySpecApplyConfiguration) *BackendTrafficPolicyApplyConfiguration { - b.Spec = value - return b -} - -// WithStatus sets the Status field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Status field is set to the value of the last call. -func (b *BackendTrafficPolicyApplyConfiguration) WithStatus(value *apisv1alpha2.PolicyStatusApplyConfiguration) *BackendTrafficPolicyApplyConfiguration { - b.Status = value - return b -} - -// GetName retrieves the value of the Name field in the declarative configuration. -func (b *BackendTrafficPolicyApplyConfiguration) GetName() *string { - b.ensureObjectMetaApplyConfigurationExists() - return b.Name -} diff --git a/applyconfiguration/apisx/v1alpha2/backendtrafficpolicyspec.go b/applyconfiguration/apisx/v1alpha2/backendtrafficpolicyspec.go deleted file mode 100644 index c1a9368f81..0000000000 --- a/applyconfiguration/apisx/v1alpha2/backendtrafficpolicyspec.go +++ /dev/null @@ -1,67 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - v1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" - v1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha2" -) - -// BackendTrafficPolicySpecApplyConfiguration represents a declarative configuration of the BackendTrafficPolicySpec type for use -// with apply. -type BackendTrafficPolicySpecApplyConfiguration struct { - TargetRefs []v1alpha2.LocalPolicyTargetReferenceApplyConfiguration `json:"targetRefs,omitempty"` - RetryConstraint *RetryConstraintApplyConfiguration `json:"retryConstraint,omitempty"` - SessionPersistence *v1.SessionPersistenceApplyConfiguration `json:"sessionPersistence,omitempty"` -} - -// BackendTrafficPolicySpecApplyConfiguration constructs a declarative configuration of the BackendTrafficPolicySpec type for use with -// apply. -func BackendTrafficPolicySpec() *BackendTrafficPolicySpecApplyConfiguration { - return &BackendTrafficPolicySpecApplyConfiguration{} -} - -// WithTargetRefs adds the given value to the TargetRefs field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the TargetRefs field. -func (b *BackendTrafficPolicySpecApplyConfiguration) WithTargetRefs(values ...*v1alpha2.LocalPolicyTargetReferenceApplyConfiguration) *BackendTrafficPolicySpecApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithTargetRefs") - } - b.TargetRefs = append(b.TargetRefs, *values[i]) - } - return b -} - -// WithRetryConstraint sets the RetryConstraint field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the RetryConstraint field is set to the value of the last call. -func (b *BackendTrafficPolicySpecApplyConfiguration) WithRetryConstraint(value *RetryConstraintApplyConfiguration) *BackendTrafficPolicySpecApplyConfiguration { - b.RetryConstraint = value - return b -} - -// WithSessionPersistence sets the SessionPersistence field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the SessionPersistence field is set to the value of the last call. -func (b *BackendTrafficPolicySpecApplyConfiguration) WithSessionPersistence(value *v1.SessionPersistenceApplyConfiguration) *BackendTrafficPolicySpecApplyConfiguration { - b.SessionPersistence = value - return b -} diff --git a/applyconfiguration/apisx/v1alpha2/requestrate.go b/applyconfiguration/apisx/v1alpha2/requestrate.go deleted file mode 100644 index e71fcd534a..0000000000 --- a/applyconfiguration/apisx/v1alpha2/requestrate.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - v1 "sigs.k8s.io/gateway-api/apis/v1" -) - -// RequestRateApplyConfiguration represents a declarative configuration of the RequestRate type for use -// with apply. -type RequestRateApplyConfiguration struct { - Count *int `json:"count,omitempty"` - Interval *v1.Duration `json:"interval,omitempty"` -} - -// RequestRateApplyConfiguration constructs a declarative configuration of the RequestRate type for use with -// apply. -func RequestRate() *RequestRateApplyConfiguration { - return &RequestRateApplyConfiguration{} -} - -// WithCount sets the Count field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Count field is set to the value of the last call. -func (b *RequestRateApplyConfiguration) WithCount(value int) *RequestRateApplyConfiguration { - b.Count = &value - return b -} - -// WithInterval sets the Interval field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Interval field is set to the value of the last call. -func (b *RequestRateApplyConfiguration) WithInterval(value v1.Duration) *RequestRateApplyConfiguration { - b.Interval = &value - return b -} diff --git a/applyconfiguration/apisx/v1alpha2/retryconstraint.go b/applyconfiguration/apisx/v1alpha2/retryconstraint.go deleted file mode 100644 index 36f0068138..0000000000 --- a/applyconfiguration/apisx/v1alpha2/retryconstraint.go +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - v1 "sigs.k8s.io/gateway-api/apis/v1" -) - -// RetryConstraintApplyConfiguration represents a declarative configuration of the RetryConstraint type for use -// with apply. -type RetryConstraintApplyConfiguration struct { - BudgetPercent *int `json:"budgetPercent,omitempty"` - BudgetInterval *v1.Duration `json:"budgetInterval,omitempty"` - MinRetryRate *RequestRateApplyConfiguration `json:"minRetryRate,omitempty"` -} - -// RetryConstraintApplyConfiguration constructs a declarative configuration of the RetryConstraint type for use with -// apply. -func RetryConstraint() *RetryConstraintApplyConfiguration { - return &RetryConstraintApplyConfiguration{} -} - -// WithBudgetPercent sets the BudgetPercent field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the BudgetPercent field is set to the value of the last call. -func (b *RetryConstraintApplyConfiguration) WithBudgetPercent(value int) *RetryConstraintApplyConfiguration { - b.BudgetPercent = &value - return b -} - -// WithBudgetInterval sets the BudgetInterval field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the BudgetInterval field is set to the value of the last call. -func (b *RetryConstraintApplyConfiguration) WithBudgetInterval(value v1.Duration) *RetryConstraintApplyConfiguration { - b.BudgetInterval = &value - return b -} - -// WithMinRetryRate sets the MinRetryRate field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the MinRetryRate field is set to the value of the last call. -func (b *RetryConstraintApplyConfiguration) WithMinRetryRate(value *RequestRateApplyConfiguration) *RetryConstraintApplyConfiguration { - b.MinRetryRate = value - return b -} diff --git a/pkg/client/clientset/versioned/typed/apisx/v1alpha2/apisx_client.go b/pkg/client/clientset/versioned/typed/apisx/v1alpha2/apisx_client.go deleted file mode 100644 index d8b437a5cf..0000000000 --- a/pkg/client/clientset/versioned/typed/apisx/v1alpha2/apisx_client.go +++ /dev/null @@ -1,107 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "net/http" - - rest "k8s.io/client-go/rest" - v1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" - "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" -) - -type ExperimentalV1alpha2Interface interface { - RESTClient() rest.Interface - BackendTrafficPoliciesGetter -} - -// ExperimentalV1alpha2Client is used to interact with features provided by the gateway.networking.x-k8s.io group. -type ExperimentalV1alpha2Client struct { - restClient rest.Interface -} - -func (c *ExperimentalV1alpha2Client) BackendTrafficPolicies(namespace string) BackendTrafficPolicyInterface { - return newBackendTrafficPolicies(c, namespace) -} - -// NewForConfig creates a new ExperimentalV1alpha2Client for the given config. -// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), -// where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*ExperimentalV1alpha2Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - httpClient, err := rest.HTTPClientFor(&config) - if err != nil { - return nil, err - } - return NewForConfigAndClient(&config, httpClient) -} - -// NewForConfigAndClient creates a new ExperimentalV1alpha2Client for the given config and http client. -// Note the http client provided takes precedence over the configured transport values. -func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ExperimentalV1alpha2Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientForConfigAndClient(&config, h) - if err != nil { - return nil, err - } - return &ExperimentalV1alpha2Client{client}, nil -} - -// NewForConfigOrDie creates a new ExperimentalV1alpha2Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *ExperimentalV1alpha2Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new ExperimentalV1alpha2Client for the given RESTClient. -func New(c rest.Interface) *ExperimentalV1alpha2Client { - return &ExperimentalV1alpha2Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1alpha2.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *ExperimentalV1alpha2Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/pkg/client/clientset/versioned/typed/apisx/v1alpha2/backendtrafficpolicy.go b/pkg/client/clientset/versioned/typed/apisx/v1alpha2/backendtrafficpolicy.go deleted file mode 100644 index e042141b13..0000000000 --- a/pkg/client/clientset/versioned/typed/apisx/v1alpha2/backendtrafficpolicy.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - gentype "k8s.io/client-go/gentype" - v1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" - apisxv1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apisx/v1alpha2" - scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" -) - -// BackendTrafficPoliciesGetter has a method to return a BackendTrafficPolicyInterface. -// A group's client should implement this interface. -type BackendTrafficPoliciesGetter interface { - BackendTrafficPolicies(namespace string) BackendTrafficPolicyInterface -} - -// BackendTrafficPolicyInterface has methods to work with BackendTrafficPolicy resources. -type BackendTrafficPolicyInterface interface { - Create(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.CreateOptions) (*v1alpha2.BackendTrafficPolicy, error) - Update(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.UpdateOptions) (*v1alpha2.BackendTrafficPolicy, error) - // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.UpdateOptions) (*v1alpha2.BackendTrafficPolicy, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.BackendTrafficPolicy, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.BackendTrafficPolicyList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.BackendTrafficPolicy, err error) - Apply(ctx context.Context, backendTrafficPolicy *apisxv1alpha2.BackendTrafficPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendTrafficPolicy, err error) - // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). - ApplyStatus(ctx context.Context, backendTrafficPolicy *apisxv1alpha2.BackendTrafficPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendTrafficPolicy, err error) - BackendTrafficPolicyExpansion -} - -// backendTrafficPolicies implements BackendTrafficPolicyInterface -type backendTrafficPolicies struct { - *gentype.ClientWithListAndApply[*v1alpha2.BackendTrafficPolicy, *v1alpha2.BackendTrafficPolicyList, *apisxv1alpha2.BackendTrafficPolicyApplyConfiguration] -} - -// newBackendTrafficPolicies returns a BackendTrafficPolicies -func newBackendTrafficPolicies(c *ExperimentalV1alpha2Client, namespace string) *backendTrafficPolicies { - return &backendTrafficPolicies{ - gentype.NewClientWithListAndApply[*v1alpha2.BackendTrafficPolicy, *v1alpha2.BackendTrafficPolicyList, *apisxv1alpha2.BackendTrafficPolicyApplyConfiguration]( - "backendtrafficpolicies", - c.RESTClient(), - scheme.ParameterCodec, - namespace, - func() *v1alpha2.BackendTrafficPolicy { return &v1alpha2.BackendTrafficPolicy{} }, - func() *v1alpha2.BackendTrafficPolicyList { return &v1alpha2.BackendTrafficPolicyList{} }), - } -} diff --git a/pkg/client/clientset/versioned/typed/apisx/v1alpha2/doc.go b/pkg/client/clientset/versioned/typed/apisx/v1alpha2/doc.go deleted file mode 100644 index baaf2d9853..0000000000 --- a/pkg/client/clientset/versioned/typed/apisx/v1alpha2/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1alpha2 diff --git a/pkg/client/clientset/versioned/typed/apisx/v1alpha2/fake/doc.go b/pkg/client/clientset/versioned/typed/apisx/v1alpha2/fake/doc.go deleted file mode 100644 index 16f4439906..0000000000 --- a/pkg/client/clientset/versioned/typed/apisx/v1alpha2/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/pkg/client/clientset/versioned/typed/apisx/v1alpha2/fake/fake_apisx_client.go b/pkg/client/clientset/versioned/typed/apisx/v1alpha2/fake/fake_apisx_client.go deleted file mode 100644 index 3a65546f2e..0000000000 --- a/pkg/client/clientset/versioned/typed/apisx/v1alpha2/fake/fake_apisx_client.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" - v1alpha2 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apisx/v1alpha2" -) - -type FakeExperimentalV1alpha2 struct { - *testing.Fake -} - -func (c *FakeExperimentalV1alpha2) BackendTrafficPolicies(namespace string) v1alpha2.BackendTrafficPolicyInterface { - return &FakeBackendTrafficPolicies{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeExperimentalV1alpha2) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/pkg/client/clientset/versioned/typed/apisx/v1alpha2/fake/fake_backendtrafficpolicy.go b/pkg/client/clientset/versioned/typed/apisx/v1alpha2/fake/fake_backendtrafficpolicy.go deleted file mode 100644 index 58e28ddc86..0000000000 --- a/pkg/client/clientset/versioned/typed/apisx/v1alpha2/fake/fake_backendtrafficpolicy.go +++ /dev/null @@ -1,197 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1 "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" - v1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" - apisxv1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apisx/v1alpha2" -) - -// FakeBackendTrafficPolicies implements BackendTrafficPolicyInterface -type FakeBackendTrafficPolicies struct { - Fake *FakeExperimentalV1alpha2 - ns string -} - -var backendtrafficpoliciesResource = v1alpha2.SchemeGroupVersion.WithResource("backendtrafficpolicies") - -var backendtrafficpoliciesKind = v1alpha2.SchemeGroupVersion.WithKind("BackendTrafficPolicy") - -// Get takes name of the backendTrafficPolicy, and returns the corresponding backendTrafficPolicy object, and an error if there is any. -func (c *FakeBackendTrafficPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { - emptyResult := &v1alpha2.BackendTrafficPolicy{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(backendtrafficpoliciesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BackendTrafficPolicy), err -} - -// List takes label and field selectors, and returns the list of BackendTrafficPolicies that match those selectors. -func (c *FakeBackendTrafficPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.BackendTrafficPolicyList, err error) { - emptyResult := &v1alpha2.BackendTrafficPolicyList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(backendtrafficpoliciesResource, backendtrafficpoliciesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha2.BackendTrafficPolicyList{ListMeta: obj.(*v1alpha2.BackendTrafficPolicyList).ListMeta} - for _, item := range obj.(*v1alpha2.BackendTrafficPolicyList).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 backendTrafficPolicies. -func (c *FakeBackendTrafficPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(backendtrafficpoliciesResource, c.ns, opts)) - -} - -// Create takes the representation of a backendTrafficPolicy and creates it. Returns the server's representation of the backendTrafficPolicy, and an error, if there is any. -func (c *FakeBackendTrafficPolicies) Create(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.CreateOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { - emptyResult := &v1alpha2.BackendTrafficPolicy{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(backendtrafficpoliciesResource, c.ns, backendTrafficPolicy, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BackendTrafficPolicy), err -} - -// Update takes the representation of a backendTrafficPolicy and updates it. Returns the server's representation of the backendTrafficPolicy, and an error, if there is any. -func (c *FakeBackendTrafficPolicies) Update(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.UpdateOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { - emptyResult := &v1alpha2.BackendTrafficPolicy{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(backendtrafficpoliciesResource, c.ns, backendTrafficPolicy, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BackendTrafficPolicy), 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 *FakeBackendTrafficPolicies) UpdateStatus(ctx context.Context, backendTrafficPolicy *v1alpha2.BackendTrafficPolicy, opts v1.UpdateOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { - emptyResult := &v1alpha2.BackendTrafficPolicy{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(backendtrafficpoliciesResource, "status", c.ns, backendTrafficPolicy, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BackendTrafficPolicy), err -} - -// Delete takes name of the backendTrafficPolicy and deletes it. Returns an error if one occurs. -func (c *FakeBackendTrafficPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(backendtrafficpoliciesResource, c.ns, name, opts), &v1alpha2.BackendTrafficPolicy{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeBackendTrafficPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(backendtrafficpoliciesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha2.BackendTrafficPolicyList{}) - return err -} - -// Patch applies the patch and returns the patched backendTrafficPolicy. -func (c *FakeBackendTrafficPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.BackendTrafficPolicy, err error) { - emptyResult := &v1alpha2.BackendTrafficPolicy{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(backendtrafficpoliciesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BackendTrafficPolicy), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied backendTrafficPolicy. -func (c *FakeBackendTrafficPolicies) Apply(ctx context.Context, backendTrafficPolicy *apisxv1alpha2.BackendTrafficPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { - if backendTrafficPolicy == nil { - return nil, fmt.Errorf("backendTrafficPolicy provided to Apply must not be nil") - } - data, err := json.Marshal(backendTrafficPolicy) - if err != nil { - return nil, err - } - name := backendTrafficPolicy.Name - if name == nil { - return nil, fmt.Errorf("backendTrafficPolicy.Name must be provided to Apply") - } - emptyResult := &v1alpha2.BackendTrafficPolicy{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(backendtrafficpoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BackendTrafficPolicy), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeBackendTrafficPolicies) ApplyStatus(ctx context.Context, backendTrafficPolicy *apisxv1alpha2.BackendTrafficPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.BackendTrafficPolicy, err error) { - if backendTrafficPolicy == nil { - return nil, fmt.Errorf("backendTrafficPolicy provided to Apply must not be nil") - } - data, err := json.Marshal(backendTrafficPolicy) - if err != nil { - return nil, err - } - name := backendTrafficPolicy.Name - if name == nil { - return nil, fmt.Errorf("backendTrafficPolicy.Name must be provided to Apply") - } - emptyResult := &v1alpha2.BackendTrafficPolicy{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(backendtrafficpoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha2.BackendTrafficPolicy), err -} diff --git a/pkg/client/clientset/versioned/typed/apisx/v1alpha2/generated_expansion.go b/pkg/client/clientset/versioned/typed/apisx/v1alpha2/generated_expansion.go deleted file mode 100644 index 2ca07ad3bf..0000000000 --- a/pkg/client/clientset/versioned/typed/apisx/v1alpha2/generated_expansion.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha2 - -type BackendTrafficPolicyExpansion interface{} diff --git a/pkg/client/informers/externalversions/apisx/v1alpha2/interface.go b/pkg/client/informers/externalversions/apisx/v1alpha2/interface.go deleted file mode 100644 index 7bc2db13dd..0000000000 --- a/pkg/client/informers/externalversions/apisx/v1alpha2/interface.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - internalinterfaces "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/internalinterfaces" -) - -// Interface provides access to all the informers in this group version. -type Interface interface { - // BackendTrafficPolicies returns a BackendTrafficPolicyInformer. - BackendTrafficPolicies() BackendTrafficPolicyInformer -} - -type version struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// BackendTrafficPolicies returns a BackendTrafficPolicyInformer. -func (v *version) BackendTrafficPolicies() BackendTrafficPolicyInformer { - return &backendTrafficPolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} diff --git a/pkg/client/listers/apisx/v1alpha2/backendtrafficpolicy.go b/pkg/client/listers/apisx/v1alpha2/backendtrafficpolicy.go deleted file mode 100644 index 8e8f95ba67..0000000000 --- a/pkg/client/listers/apisx/v1alpha2/backendtrafficpolicy.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha2 - -import ( - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" - v1alpha2 "sigs.k8s.io/gateway-api/apisx/v1alpha2" -) - -// BackendTrafficPolicyLister helps list BackendTrafficPolicies. -// All objects returned here must be treated as read-only. -type BackendTrafficPolicyLister interface { - // List lists all BackendTrafficPolicies in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.BackendTrafficPolicy, err error) - // BackendTrafficPolicies returns an object that can list and get BackendTrafficPolicies. - BackendTrafficPolicies(namespace string) BackendTrafficPolicyNamespaceLister - BackendTrafficPolicyListerExpansion -} - -// backendTrafficPolicyLister implements the BackendTrafficPolicyLister interface. -type backendTrafficPolicyLister struct { - listers.ResourceIndexer[*v1alpha2.BackendTrafficPolicy] -} - -// NewBackendTrafficPolicyLister returns a new BackendTrafficPolicyLister. -func NewBackendTrafficPolicyLister(indexer cache.Indexer) BackendTrafficPolicyLister { - return &backendTrafficPolicyLister{listers.New[*v1alpha2.BackendTrafficPolicy](indexer, v1alpha2.Resource("backendtrafficpolicy"))} -} - -// BackendTrafficPolicies returns an object that can list and get BackendTrafficPolicies. -func (s *backendTrafficPolicyLister) BackendTrafficPolicies(namespace string) BackendTrafficPolicyNamespaceLister { - return backendTrafficPolicyNamespaceLister{listers.NewNamespaced[*v1alpha2.BackendTrafficPolicy](s.ResourceIndexer, namespace)} -} - -// BackendTrafficPolicyNamespaceLister helps list and get BackendTrafficPolicies. -// All objects returned here must be treated as read-only. -type BackendTrafficPolicyNamespaceLister interface { - // List lists all BackendTrafficPolicies in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.BackendTrafficPolicy, err error) - // Get retrieves the BackendTrafficPolicy from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.BackendTrafficPolicy, error) - BackendTrafficPolicyNamespaceListerExpansion -} - -// backendTrafficPolicyNamespaceLister implements the BackendTrafficPolicyNamespaceLister -// interface. -type backendTrafficPolicyNamespaceLister struct { - listers.ResourceIndexer[*v1alpha2.BackendTrafficPolicy] -} diff --git a/pkg/client/listers/apisx/v1alpha2/expansion_generated.go b/pkg/client/listers/apisx/v1alpha2/expansion_generated.go deleted file mode 100644 index ff3d49e565..0000000000 --- a/pkg/client/listers/apisx/v1alpha2/expansion_generated.go +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha2 - -// BackendTrafficPolicyListerExpansion allows custom methods to be added to -// BackendTrafficPolicyLister. -type BackendTrafficPolicyListerExpansion interface{} - -// BackendTrafficPolicyNamespaceListerExpansion allows custom methods to be added to -// BackendTrafficPolicyNamespaceLister. -type BackendTrafficPolicyNamespaceListerExpansion interface{}