diff --git a/apis/v1/gateway_types.go b/apis/v1/gateway_types.go index 83af1c453e..c50f4469db 100644 --- a/apis/v1/gateway_types.go +++ b/apis/v1/gateway_types.go @@ -279,6 +279,40 @@ type GatewaySpec struct { // +optional // BackendTLS *GatewayBackendTLS `json:"backendTLS,omitempty"` + + // AllowedListeners defines which ListenerSets can be attached to this Gateway. + // While this feature is experimental, the default value is to allow no ListenerSets. + // + // + // + // +optional + AllowedListeners *[]AllowedListeners `json:"allowedListeners,omitempty"` +} + +// AllowedListeners defines which ListenerSets can be attached to this Gateway. +type AllowedListeners struct { + // Namespaces defines which namespaces ListenerSets can be attached to this Gateway. + // While this feature is experimental, the default value is to allow no ListenerSets. + // + // +optional + // +kubebuilder:default={from: None} + Namespaces *ListenerNamespaces `json:"namespaces,omitempty"` +} + +// ListenerNamespaces indicate which namespaces ListenerSets should be selected from. +type ListenerNamespaces struct { + // From indicates where ListenerSets can attach to this Gateway. Possible + // values are: + // + // * Same: Only ListenerSets in the same namespace may be attached to this Gateway. + // * None: Only listeners defined in the Gateway's spec are allowed + // + // While this feature is experimental, the default value None + // + // +optional + // +kubebuilder:default=None + // +kubebuilder:validation:Enum=Same;None + From *FromNamespaces `json:"from,omitempty"` } // Listener embodies the concept of a logical endpoint where a Gateway accepts @@ -602,21 +636,23 @@ type AllowedRoutes struct { Kinds []RouteGroupKind `json:"kinds,omitempty"` } -// FromNamespaces specifies namespace from which Routes may be attached to a +// FromNamespaces specifies namespace from which Routes/ListenerSets may be attached to a // Gateway. // -// +kubebuilder:validation:Enum=All;Selector;Same +// +kubebuilder:validation:Enum=All;Selector;Same;None type FromNamespaces string const ( - // Routes in all namespaces may be attached to this Gateway. + // Routes/ListenerSets in all namespaces may be attached to this Gateway. NamespacesFromAll FromNamespaces = "All" - // Only Routes in namespaces selected by the selector may be attached to + // Only Routes/ListenerSets in namespaces selected by the selector may be attached to // this Gateway. NamespacesFromSelector FromNamespaces = "Selector" - // Only Routes in the same namespace as the Gateway may be attached to this + // Only Routes/ListenerSets in the same namespace as the Gateway may be attached to this // Gateway. NamespacesFromSame FromNamespaces = "Same" + // No Routes/ListenerSets may be attached to this Gateway. + NamespacesFromNone FromNamespaces = "None" ) // RouteNamespaces indicate which namespaces Routes should be selected from. diff --git a/apis/v1/zz_generated.deepcopy.go b/apis/v1/zz_generated.deepcopy.go index 62fb99b0d5..150f289c8f 100644 --- a/apis/v1/zz_generated.deepcopy.go +++ b/apis/v1/zz_generated.deepcopy.go @@ -25,6 +25,26 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AllowedListeners) DeepCopyInto(out *AllowedListeners) { + *out = *in + if in.Namespaces != nil { + in, out := &in.Namespaces, &out.Namespaces + *out = new(ListenerNamespaces) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllowedListeners. +func (in *AllowedListeners) DeepCopy() *AllowedListeners { + if in == nil { + return nil + } + out := new(AllowedListeners) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AllowedRoutes) DeepCopyInto(out *AllowedRoutes) { *out = *in @@ -747,6 +767,17 @@ func (in *GatewaySpec) DeepCopyInto(out *GatewaySpec) { *out = new(GatewayBackendTLS) (*in).DeepCopyInto(*out) } + if in.AllowedListeners != nil { + in, out := &in.AllowedListeners, &out.AllowedListeners + *out = new([]AllowedListeners) + if **in != nil { + in, out := *in, *out + *out = make([]AllowedListeners, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GatewaySpec. @@ -1431,6 +1462,26 @@ func (in *Listener) DeepCopy() *Listener { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ListenerNamespaces) DeepCopyInto(out *ListenerNamespaces) { + *out = *in + if in.From != nil { + in, out := &in.From, &out.From + *out = new(FromNamespaces) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ListenerNamespaces. +func (in *ListenerNamespaces) DeepCopy() *ListenerNamespaces { + if in == nil { + return nil + } + out := new(ListenerNamespaces) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ListenerStatus) DeepCopyInto(out *ListenerStatus) { *out = *in diff --git a/apisx/doc.go b/apisx/doc.go new file mode 100644 index 0000000000..acda533c29 --- /dev/null +++ b/apisx/doc.go @@ -0,0 +1,17 @@ +/* +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/v1alpha1/doc.go b/apisx/v1alpha1/doc.go new file mode 100644 index 0000000000..3ccc45b464 --- /dev/null +++ b/apisx/v1alpha1/doc.go @@ -0,0 +1,24 @@ +/* +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.k8s-x.io +// API group. +// +// +k8s:openapi-gen=true +// +kubebuilder:object:generate=true +// +groupName=gateway.networking.k8s-x.io +// +groupGoName=Experimental +package v1alpha1 diff --git a/apisx/v1alpha1/listenerset_types.go b/apisx/v1alpha1/listenerset_types.go new file mode 100644 index 0000000000..fa204e16d2 --- /dev/null +++ b/apisx/v1alpha1/listenerset_types.go @@ -0,0 +1,580 @@ +/* +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 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +kubebuilder:object:root=true +// +kubebuilder:resource:categories=gateway-api,shortName=lset +// +kubebuilder:subresource:status +// +kubebuilder:storageversion +// +kubebuilder:printcolumn:name="Accepted",type=string,JSONPath=`.status.conditions[?(@.type=="Accepted")].status` +// +kubebuilder:printcolumn:name="Programmed",type=string,JSONPath=`.status.conditions[?(@.type=="Programmed")].status` +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` + +// ListenerSet defines a set of additional listeners +// to attach to an existing Gateway. +type ListenerSet struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Spec defines the desired state of ListenerSet. + Spec ListenerSetSpec `json:"spec"` + + // Status defines the current state of ListenerSet. + // + // +kubebuilder:default={conditions: {{type: "Accepted", status: "Unknown", reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"},{type: "Programmed", status: "Unknown", reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"}}} + Status ListenerSetStatus `json:"status,omitempty"` +} + +// ListenerSetSpec defines the desired state of a ListenerSet. +type ListenerSetSpec struct { + // ParentRef references the Gateway that the listeners are attached to. + ParentRef ParentGatewayReference `json:"parentRef,omitempty"` + + // Listeners associated with this ListenerSet. Listeners define + // logical endpoints that are bound on this referenced parent Gateway's addresses. + // + // Listeners in a `Gateway` and their attached `ListenerSets` are concatenated + // as a list when programming the underlying infrastructure. + // + // Listeners should be merged using the following precedence: + // + // 1. "parent" Gateway + // 2. ListenerSet ordered by creation time (oldest first) + // 3. ListenerSet ordered alphabetically by “{namespace}/{name}”. + // + // +listType=map + // +listMapKey=name + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=64 + // +kubebuilder:validation:XValidation:message="tls must not be specified for protocols ['HTTP', 'TCP', 'UDP']",rule="self.all(l, l.protocol in ['HTTP', 'TCP', 'UDP'] ? !has(l.tls) : true)" + // +kubebuilder:validation:XValidation:message="tls mode must be Terminate for protocol HTTPS",rule="self.all(l, (l.protocol == 'HTTPS' && has(l.tls)) ? (l.tls.mode == '' || l.tls.mode == 'Terminate') : true)" + // +kubebuilder:validation:XValidation:message="hostname must not be specified for protocols ['TCP', 'UDP']",rule="self.all(l, l.protocol in ['TCP', 'UDP'] ? (!has(l.hostname) || l.hostname == '') : true)" + // +kubebuilder:validation:XValidation:message="Listener name must be unique within the Gateway",rule="self.all(l1, self.exists_one(l2, l1.name == l2.name))" + // +kubebuilder:validation:XValidation:message="Combination of port, protocol and hostname must be unique for each listener",rule="self.all(l1, !has(l1.port) || self.exists_one(l2, has(l2.port) && l1.port == l2.port && l1.protocol == l2.protocol && (has(l1.hostname) && has(l2.hostname) ? l1.hostname == l2.hostname : !has(l1.hostname) && !has(l2.hostname))))" + Listeners []ListenerEntry `json:"listeners"` +} + +type ListenerEntry struct { + // Name is the name of the Listener. This name MUST be unique within a + // Gateway. + // + // Support: Core + Name SectionName `json:"name"` + + // 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. + // + // Implementations MUST apply Hostname matching appropriately for each of + // the following protocols: + // + // * 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 + // protocol layers as described above. If an implementation does not + // ensure that both the SNI and Host header match the Listener hostname, + // it MUST clearly document that. + // + // For 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. + // + // Hostnames 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`. + // + // Support: Core + // + // +optional + Hostname *Hostname `json:"hostname,omitempty"` + + // Port is the network port. Multiple listeners may use the + // same port, subject to the Listener compatibility rules. + // + // Support: Core + // + // +optional + Port PortNumber `json:"port,omitempty"` + + // Protocol specifies the network protocol this listener expects to receive. + // + // Support: Core + Protocol ProtocolType `json:"protocol"` + + // 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". + // + // The association of SNIs to Certificate defined in GatewayTLSConfig is + // defined based on the Hostname field for this listener. + // + // The GatewayClass MUST use the longest matching SNI out of all + // available certificates for any TLS handshake. + // + // Support: Core + // + // +optional + TLS *GatewayTLSConfig `json:"tls,omitempty"` + + // AllowedRoutes defines the types of routes that MAY be attached to a + // Listener and the trusted namespaces where those Route resources MAY be + // present. + // + // Although 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: + // + // * The most specific match as defined by the Route type. + // * The oldest Route based on creation timestamp. For example, a Route with + // a creation timestamp of "2020-09-08 01:02:03" is given precedence over + // a Route with a creation timestamp of "2020-09-08 01:02:04". + // * If everything else is equivalent, the Route appearing first in + // alphabetical order (namespace/name) should be given precedence. For + // example, foo/bar is given precedence over foo/baz. + // + // All 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. + // + // Support: Core + // +kubebuilder:default={namespaces:{from: Same}} + // +optional + AllowedRoutes *AllowedRoutes `json:"allowedRoutes,omitempty"` +} + +type ListenerSetStatus struct { + // Conditions describe the current conditions of the ListenerSet. + // + // Implementations should prefer to express ListenerSet conditions + // using the `ListenerSetConditionType` and `ListenerSetConditionReason` + // constants so that operators and tools can converge on a common + // vocabulary to describe ListenerSet state. + // + // Known condition types are: + // + // * "Accepted" + // * "Programmed" + // + // +optional + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MaxItems=8 + // +kubebuilder:default={{type: "Accepted", status: "Unknown", reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"},{type: "Programmed", status: "Unknown", reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"}} + Conditions []metav1.Condition `json:"conditions,omitempty"` + + // Listeners provide status for each unique listener port defined in the Spec. + // + // +optional + // +listType=map + // +listMapKey=name + // +kubebuilder:validation:MaxItems=64 + Listeners []ListenerEntryStatus `json:"listeners,omitempty"` +} + +// ListenerStatus is the status associated with a Listener. +type ListenerEntryStatus struct { + // Name is the name of the Listener that this status corresponds to. + Name SectionName `json:"name"` + + // Port is the network port the listener is configured to listen on. + Port PortNumber `json:"port"` + + // SupportedKinds is the list indicating the Kinds supported by this + // listener. This MUST represent the kinds an implementation supports for + // that Listener configuration. + // + // If 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. + // + // +kubebuilder:validation:MaxItems=8 + SupportedKinds []RouteGroupKind `json:"supportedKinds"` + + // AttachedRoutes represents the total number of Routes that have been + // successfully attached to this Listener. + // + // Successful 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. + // + // Uses for this field include troubleshooting Route attachment and + // measuring blast radius/impact of changes to a Listener. + AttachedRoutes int32 `json:"attachedRoutes"` + + // Conditions describe the current condition of this listener. + // + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MaxItems=8 + Conditions []metav1.Condition `json:"conditions"` +} + +// ListenerSetConditionType is a type of condition associated with a +// ListenerSet. This type should be used with the ListenerSetStatus.Conditions +// field. +type ListenerSetConditionType string + +// ListenerSetConditionReason defines the set of reasons that explain why a +// particular ListenerSet condition type has been raised. +type ListenerSetConditionReason string + +const ( + // This condition indicates whether a ListenerSet has generated some + // configuration that is assumed to be ready soon in the underlying data + // plane. + // + // It is a positive-polarity summary condition, and so should always be + // present on the resource with ObservedGeneration set. + // + // It should be set to Unknown if the controller performs updates to the + // status before it has all the information it needs to be able to determine + // if the condition is true. + // + // Possible reasons for this condition to be True are: + // + // * "Programmed" + // + // Possible reasons for this condition to be False are: + // + // * "Invalid" + // + // Additional reasons for this condition to be False are influenced by + // child ListenerEntry conditions: + // + // * "PortUnavailable" + // + // Possible reasons for this condition to be Unknown are: + // + // * "Pending" + // + // Controllers may raise this condition with other reasons, + // but should prefer to use the reasons listed above to improve + // interoperability. + ListenerSetConditionProgrammed ListenerSetConditionType = "Programmed" + + // This reason is used with the "Programmed" condition when the condition is + // true. + ListenerSetReasonProgrammed ListenerSetConditionReason = "Programmed" +) + +const ( + // This condition is true when the controller managing the ListenerSet is + // syntactically and semantically valid enough to produce some configuration + // in the underlying data plane. This does not indicate whether or not the + // configuration has been propagated to the data plane. + // + // Possible reasons for this condition to be True are: + // + // * "Accepted" + // + // Possible reasons for this condition to be False are: + // + // * "Invalid" + // * "NotAllowed" + // * "ParentNotAccepted" + // * "ListenersNotValid" + // + // Possible reasons for this condition to be Unknown are: + // + // * "Pending" + // + // Controllers may raise this condition with other reasons, + // but should prefer to use the reasons listed above to improve + // interoperability. + ListenerSetConditionAccepted ListenerSetConditionType = "Accepted" + + // This reason is used with the "Accepted" condition when the condition is + // True. + ListenerSetReasonAccepted ListenerSetConditionReason = "Accepted" + + // This reason is used with the "Accepted" condition when the + // ListenerSet is not allowed to be attached to the Gateway. + ListenerSetReasonNotAllowed ListenerSetConditionReason = "NotAllowed" + + // This reason is used with the "Accepted" condition when the + // parent Gateway is not accepted. + ListenerSetReasonParentNotAccepted ListenerSetConditionReason = "ParentNotAccepted" + + // This reason is used with the "Accepted" condition when one or + // more Listeners have an invalid or unsupported configuration + // and cannot be configured on the Gateway. + // This can be the reason when "Accepted" is "True" or "False", depending on whether + // the listener being invalid causes the entire Gateway to not be accepted. + ListenerSetReasonListenersNotValid ListenerSetConditionReason = "ListenersNotValid" +) + +// Shared ListenerSet Reasons +const ( + // This reason is used with the "Programmed" and "Accepted" conditions when + // the ListenerSet is syntactically or semantically invalid. For example, this + // could include unspecified TLS configuration, or some unrecognized or + // invalid values in the TLS configuration. + ListenerSetReasonInvalid ListenerSetConditionReason = "Invalid" + + // This reason is used with the "Accepted" and "Programmed" + // conditions when the status is "Unknown" and no controller has reconciled + // the Gateway. + ListenerSetReasonPending ListenerSetConditionReason = "Pending" +) + +// ListenerEntryConditionType is a type of condition associated with the +// listener. This type should be used with the ListenerEntryStatus.Conditions +// field. +type ListenerEntryConditionType string + +// ListenerEntryConditionReason defines the set of reasons that explain +// why a particular ListenerEntry condition type has been raised. +type ListenerEntryConditionReason string + +const ( + // This condition indicates that the controller was unable to resolve + // conflicting specification requirements for this Listener. If a + // Listener is conflicted, its network port should not be configured + // on any network elements. + // + // Possible reasons for this condition to be true are: + // + // * "HostnameConflict" + // * "ProtocolConflict" + // * "ListenerConflict" + // + // Possible reasons for this condition to be False are: + // + // * "NoConflicts" + // + // Controllers may raise this condition with other reasons, + // but should prefer to use the reasons listed above to improve + // interoperability. + ListenerEntryConditionConflicted ListenerEntryConditionType = "Conflicted" + + // This reason is used with the "Conflicted" condition when + // the Listener conflicts with hostnames in other Listeners. For + // example, this reason would be used when multiple Listeners on + // the same port use `example.com` in the hostname field. + ListenerEntryReasonHostnameConflict ListenerEntryConditionReason = "HostnameConflict" + + // This reason is used with the "Conflicted" condition when + // multiple Listeners are specified with the same Listener port + // number, but have conflicting protocol specifications. + ListenerEntryReasonProtocolConflict ListenerEntryConditionReason = "ProtocolConflict" + + // This reason is used with the "Conflicted" condition when the condition + // is True. + // + // Implementations should prioritize surfacing the most specific conflict + // reason. For example, if a Listener is conflicted because it has the same + // port as another Listener, and it also has the same hostname as another + // Listener, the reason should be "ListenerConflict" and not + // "HostnameConflict" or "ProtocolConflict". + ListenerEntryReasonListenerConflict ListenerEntryConditionReason = "ListenerConflict" +) + +const ( + // This condition indicates that the listener is syntactically and + // semantically valid, and that all features used in the listener's spec are + // supported. + // + // In general, a Listener will be marked as Accepted when the supplied + // configuration will generate at least some data plane configuration. + // + // For example, a Listener with an unsupported protocol will never generate + // any data plane config, and so will have Accepted set to `false.` + // Conversely, a Listener that does not have any Routes will be able to + // generate data plane config, and so will have Accepted set to `true`. + // + // Possible reasons for this condition to be True are: + // + // * "Accepted" + // + // Possible reasons for this condition to be False are: + // + // * "PortUnavailable" + // * "UnsupportedProtocol" + // * "TooManyListeners" + // + // Possible reasons for this condition to be Unknown are: + // + // * "Pending" + // + // Controllers may raise this condition with other reasons, + // but should prefer to use the reasons listed above to improve + // interoperability. + ListenerEntryConditionAccepted ListenerEntryConditionType = "Accepted" + + // This reason is used with the "Accepted" condition when the condition is + // True. + ListenerEntryReasonAccepted ListenerEntryConditionReason = "Accepted" + + // This reason is used with the "Accepted" condition when the + // Listener could not be attached to be Gateway because its + // protocol type is not supported. + ListenerEntryReasonUnsupportedProtocol ListenerEntryConditionReason = "UnsupportedProtocol" + + // This reason is used with the "Accepted" condition when the + // Listener could not be attached to be Gateway because the Gateway + // has too many Listeners. + ListenerEntryReasonTooManyListeners ListenerEntryConditionReason = "TooManyListeners" +) + +const ( + // This condition indicates whether the controller was able to + // resolve all the object references for the Listener. + // + // Possible reasons for this condition to be true are: + // + // * "ResolvedRefs" + // + // Possible reasons for this condition to be False are: + // + // * "InvalidCertificateRef" + // * "InvalidRouteKinds" + // * "RefNotPermitted" + // + // Controllers may raise this condition with other reasons, + // but should prefer to use the reasons listed above to improve + // interoperability. + ListenerEntryConditionResolvedRefs ListenerEntryConditionType = "ResolvedRefs" + + // This reason is used with the "ResolvedRefs" condition when the condition + // is true. + ListenerEntryReasonResolvedRefs ListenerEntryConditionReason = "ResolvedRefs" + + // This reason is used with the "ResolvedRefs" condition when the + // Listener has a TLS configuration with at least one TLS CertificateRef + // that is invalid or does not exist. + // A CertificateRef is considered invalid when it refers to a nonexistent + // or unsupported resource or kind, or when the data within that resource + // is malformed. + // This reason must be used only when the reference is allowed, either by + // referencing an object in the same namespace as the Gateway, or when + // a cross-namespace reference has been explicitly allowed by a ReferenceGrant. + // If the reference is not allowed, the reason RefNotPermitted must be used + // instead. + ListenerEntryReasonInvalidCertificateRef ListenerEntryConditionReason = "InvalidCertificateRef" + + // This reason is used with the "ResolvedRefs" condition when an invalid or + // unsupported Route kind is specified by the Listener. + ListenerEntryReasonInvalidRouteKinds ListenerEntryConditionReason = "InvalidRouteKinds" + + // This reason is used with the "ResolvedRefs" condition when the + // Listener has a TLS configuration that references an object in another + // namespace, where the object in the other namespace does not have a + // ReferenceGrant explicitly allowing the reference. + ListenerEntryReasonRefNotPermitted ListenerEntryConditionReason = "RefNotPermitted" +) + +const ( + // This condition indicates whether a Listener has generated some + // configuration that will soon be ready in the underlying data plane. + // + // It is a positive-polarity summary condition, and so should always be + // present on the resource with ObservedGeneration set. + // + // It should be set to Unknown if the controller performs updates to the + // status before it has all the information it needs to be able to determine + // if the condition is true. + // + // Possible reasons for this condition to be True are: + // + // * "Programmed" + // + // Possible reasons for this condition to be False are: + // + // * "Invalid" + // * "PortUnavailable" + // + // Possible reasons for this condition to be Unknown are: + // + // * "Pending" + // + // Controllers may raise this condition with other reasons, + // but should prefer to use the reasons listed above to improve + // interoperability. + ListenerEntryConditionProgrammed ListenerEntryConditionType = "Programmed" + + // This reason is used with the "Programmed" condition when the condition is + // true. + ListenerEntryReasonProgrammed ListenerEntryConditionReason = "Programmed" +) + +// Shared ListenerEntry "Accepted" & "Programmed" Reasons +const ( + // This reason is used with the "Accepted" condition when the Listener + // requests a port that cannot be used on the Gateway. This reason could be + // used in a number of instances, including: + // + // * The port is already in use. + // * The port is not supported by the implementation. + // * The implementation is unable to assign the port to the Listener. + ListenerEntryReasonPortUnavailable ListenerEntryConditionReason = "PortUnavailable" + + // This reason is used with the "Accepted" and "Programmed" + // conditions when the Listener is either not yet reconciled or not yet not + // online and ready to accept client traffic. + ListenerEntryReasonPending ListenerEntryConditionReason = "Pending" + + // This reason is used with the "Accepted" and "Programmed" conditions when the + // Listener is syntactically or semantically invalid. + ListenerEntryReasonInvalid ListenerEntryConditionReason = "Invalid" +) + +const ( + // "Ready" is a condition type reserved for future use. It should not be used by implementations. + // Note: This condition is not really "deprecated", but rather "reserved"; however, deprecated triggers Go linters + // to alert about usage. + // + // If used in the future, "Ready" will represent the final state where all configuration is confirmed good + // _and has completely propagated to the data plane_. That is, it is a _guarantee_ that, as soon as something + // sees the Condition as `true`, then connections will be correctly routed _immediately_. + // + // This is a very strong guarantee, and to date no implementation has satisfied it enough to implement it. + // This reservation can be discussed in the future if necessary. + // + // Deprecated: Ready is reserved for future use + ListenerEntryConditionReady ListenerEntryConditionType = "Ready" + + // Deprecated: Ready is reserved for future use + ListenerEntryReasonReady ListenerEntryConditionReason = "Ready" +) + +// +kubebuilder:object:root=true +type ListenerSetList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ListenerSet `json:"items"` +} diff --git a/apisx/v1alpha1/shared_types.go b/apisx/v1alpha1/shared_types.go new file mode 100644 index 0000000000..fe5cf7b29d --- /dev/null +++ b/apisx/v1alpha1/shared_types.go @@ -0,0 +1,61 @@ +/* +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 + +import v1 "sigs.k8s.io/gateway-api/apis/v1" + +type ( + // +k8s:deepcopy-gen=false + AllowedRoutes = v1.AllowedRoutes + // +k8s:deepcopy-gen=false + GatewayTLSConfig = v1.GatewayTLSConfig + // +k8s:deepcopy-gen=false + Group = v1.Group + // +k8s:deepcopy-gen=false + Hostname = v1.Hostname + // +k8s:deepcopy-gen=false + Kind = v1.Kind + // +k8s:deepcopy-gen=false + ObjectName = v1.ObjectName + // +k8s:deepcopy-gen=false + PortNumber = v1.PortNumber + // +k8s:deepcopy-gen=false + ProtocolType = v1.ProtocolType + // +k8s:deepcopy-gen=false + RouteGroupKind = v1.RouteGroupKind + // +k8s:deepcopy-gen=false + SectionName = v1.SectionName +) + +// ParentGatewayReference identifies an API object including its namespace, +// defaulting to Gateway. +type ParentGatewayReference struct { + // Group is the group of the referent. + // + // +optional + // +kubebuilder:default="gateway.networking.k8s.io" + Group *Group `json:"group"` + + // Kind is kind of the referent. For example "Gateway". + // + // +optional + // +kubebuilder:default=Gateway + Kind *Kind `json:"kind"` + + // Name is the name of the referent. + Name ObjectName `json:"name"` +} diff --git a/apisx/v1alpha1/zz_generated.deepcopy.go b/apisx/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..0eeca2e595 --- /dev/null +++ b/apisx/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,222 @@ +//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 v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/gateway-api/apis/v1" +) + +// 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 + if in.Hostname != nil { + in, out := &in.Hostname, &out.Hostname + *out = new(v1.Hostname) + **out = **in + } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(v1.GatewayTLSConfig) + (*in).DeepCopyInto(*out) + } + if in.AllowedRoutes != nil { + in, out := &in.AllowedRoutes, &out.AllowedRoutes + *out = new(v1.AllowedRoutes) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ListenerEntry. +func (in *ListenerEntry) DeepCopy() *ListenerEntry { + if in == nil { + return nil + } + out := new(ListenerEntry) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ListenerEntryStatus) DeepCopyInto(out *ListenerEntryStatus) { + *out = *in + if in.SupportedKinds != nil { + in, out := &in.SupportedKinds, &out.SupportedKinds + *out = make([]v1.RouteGroupKind, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ListenerEntryStatus. +func (in *ListenerEntryStatus) DeepCopy() *ListenerEntryStatus { + if in == nil { + return nil + } + out := new(ListenerEntryStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ListenerSet) DeepCopyInto(out *ListenerSet) { + *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 ListenerSet. +func (in *ListenerSet) DeepCopy() *ListenerSet { + if in == nil { + return nil + } + out := new(ListenerSet) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ListenerSet) 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 *ListenerSetList) DeepCopyInto(out *ListenerSetList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ListenerSet, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ListenerSetList. +func (in *ListenerSetList) DeepCopy() *ListenerSetList { + if in == nil { + return nil + } + out := new(ListenerSetList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ListenerSetList) 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 *ListenerSetSpec) DeepCopyInto(out *ListenerSetSpec) { + *out = *in + in.ParentRef.DeepCopyInto(&out.ParentRef) + if in.Listeners != nil { + in, out := &in.Listeners, &out.Listeners + *out = make([]ListenerEntry, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ListenerSetSpec. +func (in *ListenerSetSpec) DeepCopy() *ListenerSetSpec { + if in == nil { + return nil + } + out := new(ListenerSetSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ListenerSetStatus) DeepCopyInto(out *ListenerSetStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Listeners != nil { + in, out := &in.Listeners, &out.Listeners + *out = make([]ListenerEntryStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ListenerSetStatus. +func (in *ListenerSetStatus) DeepCopy() *ListenerSetStatus { + if in == nil { + return nil + } + out := new(ListenerSetStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ParentGatewayReference) DeepCopyInto(out *ParentGatewayReference) { + *out = *in + if in.Group != nil { + in, out := &in.Group, &out.Group + *out = new(v1.Group) + **out = **in + } + if in.Kind != nil { + in, out := &in.Kind, &out.Kind + *out = new(v1.Kind) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ParentGatewayReference. +func (in *ParentGatewayReference) DeepCopy() *ParentGatewayReference { + if in == nil { + return nil + } + out := new(ParentGatewayReference) + in.DeepCopyInto(out) + return out +} diff --git a/apisx/v1alpha1/zz_generated.register.go b/apisx/v1alpha1/zz_generated.register.go new file mode 100644 index 0000000000..cecdc18c9f --- /dev/null +++ b/apisx/v1alpha1/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 v1alpha1 + +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: "v1alpha1"} + +// SchemeGroupVersion is group version used to register these objects +// Deprecated: use GroupVersion instead. +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. + SchemeBuilder runtime.SchemeBuilder + localSchemeBuilder = &SchemeBuilder + // Deprecated: use Install instead + AddToScheme = localSchemeBuilder.AddToScheme + Install = localSchemeBuilder.AddToScheme +) + +func init() { + // We only register manually written functions here. The registration of the + // generated functions takes place in the generated files. The separation + // makes the code compile even when the generated files are missing. + localSchemeBuilder.Register(addKnownTypes) +} + +// Adds the list of known types to Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &ListenerSet{}, + &ListenerSetList{}, + ) + // AddToGroupVersion allows the serialization of client types like ListOptions. + v1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/applyconfiguration/apis/v1/allowedlisteners.go b/applyconfiguration/apis/v1/allowedlisteners.go new file mode 100644 index 0000000000..61da03af41 --- /dev/null +++ b/applyconfiguration/apis/v1/allowedlisteners.go @@ -0,0 +1,39 @@ +/* +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 v1 + +// AllowedListenersApplyConfiguration represents a declarative configuration of the AllowedListeners type for use +// with apply. +type AllowedListenersApplyConfiguration struct { + Namespaces *ListenerNamespacesApplyConfiguration `json:"namespaces,omitempty"` +} + +// AllowedListenersApplyConfiguration constructs a declarative configuration of the AllowedListeners type for use with +// apply. +func AllowedListeners() *AllowedListenersApplyConfiguration { + return &AllowedListenersApplyConfiguration{} +} + +// WithNamespaces sets the Namespaces 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 Namespaces field is set to the value of the last call. +func (b *AllowedListenersApplyConfiguration) WithNamespaces(value *ListenerNamespacesApplyConfiguration) *AllowedListenersApplyConfiguration { + b.Namespaces = value + return b +} diff --git a/apis/applyconfiguration/apis/v1/allowedroutes.go b/applyconfiguration/apis/v1/allowedroutes.go similarity index 100% rename from apis/applyconfiguration/apis/v1/allowedroutes.go rename to applyconfiguration/apis/v1/allowedroutes.go diff --git a/apis/applyconfiguration/apis/v1/backendobjectreference.go b/applyconfiguration/apis/v1/backendobjectreference.go similarity index 100% rename from apis/applyconfiguration/apis/v1/backendobjectreference.go rename to applyconfiguration/apis/v1/backendobjectreference.go diff --git a/apis/applyconfiguration/apis/v1/backendref.go b/applyconfiguration/apis/v1/backendref.go similarity index 100% rename from apis/applyconfiguration/apis/v1/backendref.go rename to applyconfiguration/apis/v1/backendref.go diff --git a/apis/applyconfiguration/apis/v1/commonroutespec.go b/applyconfiguration/apis/v1/commonroutespec.go similarity index 100% rename from apis/applyconfiguration/apis/v1/commonroutespec.go rename to applyconfiguration/apis/v1/commonroutespec.go diff --git a/apis/applyconfiguration/apis/v1/cookieconfig.go b/applyconfiguration/apis/v1/cookieconfig.go similarity index 100% rename from apis/applyconfiguration/apis/v1/cookieconfig.go rename to applyconfiguration/apis/v1/cookieconfig.go diff --git a/apis/applyconfiguration/apis/v1/fraction.go b/applyconfiguration/apis/v1/fraction.go similarity index 100% rename from apis/applyconfiguration/apis/v1/fraction.go rename to applyconfiguration/apis/v1/fraction.go diff --git a/apis/applyconfiguration/apis/v1/frontendtlsvalidation.go b/applyconfiguration/apis/v1/frontendtlsvalidation.go similarity index 100% rename from apis/applyconfiguration/apis/v1/frontendtlsvalidation.go rename to applyconfiguration/apis/v1/frontendtlsvalidation.go diff --git a/apis/applyconfiguration/apis/v1/gateway.go b/applyconfiguration/apis/v1/gateway.go similarity index 99% rename from apis/applyconfiguration/apis/v1/gateway.go rename to applyconfiguration/apis/v1/gateway.go index 8e8f27e6fb..965ae3838d 100644 --- a/apis/applyconfiguration/apis/v1/gateway.go +++ b/applyconfiguration/apis/v1/gateway.go @@ -23,8 +23,8 @@ import ( 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" gatewayapiapisv1 "sigs.k8s.io/gateway-api/apis/v1" + internal "sigs.k8s.io/gateway-api/applyconfiguration/internal" ) // GatewayApplyConfiguration represents a declarative configuration of the Gateway type for use diff --git a/apis/applyconfiguration/apis/v1/gatewayaddress.go b/applyconfiguration/apis/v1/gatewayaddress.go similarity index 100% rename from apis/applyconfiguration/apis/v1/gatewayaddress.go rename to applyconfiguration/apis/v1/gatewayaddress.go diff --git a/apis/applyconfiguration/apis/v1/gatewaybackendtls.go b/applyconfiguration/apis/v1/gatewaybackendtls.go similarity index 100% rename from apis/applyconfiguration/apis/v1/gatewaybackendtls.go rename to applyconfiguration/apis/v1/gatewaybackendtls.go diff --git a/apis/applyconfiguration/apis/v1/gatewayclass.go b/applyconfiguration/apis/v1/gatewayclass.go similarity index 99% rename from apis/applyconfiguration/apis/v1/gatewayclass.go rename to applyconfiguration/apis/v1/gatewayclass.go index 7d1cfcbc5f..a356c50163 100644 --- a/apis/applyconfiguration/apis/v1/gatewayclass.go +++ b/applyconfiguration/apis/v1/gatewayclass.go @@ -23,8 +23,8 @@ import ( 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" gatewayapiapisv1 "sigs.k8s.io/gateway-api/apis/v1" + internal "sigs.k8s.io/gateway-api/applyconfiguration/internal" ) // GatewayClassApplyConfiguration represents a declarative configuration of the GatewayClass type for use diff --git a/apis/applyconfiguration/apis/v1/gatewayclassspec.go b/applyconfiguration/apis/v1/gatewayclassspec.go similarity index 100% rename from apis/applyconfiguration/apis/v1/gatewayclassspec.go rename to applyconfiguration/apis/v1/gatewayclassspec.go diff --git a/apis/applyconfiguration/apis/v1/gatewayclassstatus.go b/applyconfiguration/apis/v1/gatewayclassstatus.go similarity index 100% rename from apis/applyconfiguration/apis/v1/gatewayclassstatus.go rename to applyconfiguration/apis/v1/gatewayclassstatus.go diff --git a/apis/applyconfiguration/apis/v1/gatewayinfrastructure.go b/applyconfiguration/apis/v1/gatewayinfrastructure.go similarity index 100% rename from apis/applyconfiguration/apis/v1/gatewayinfrastructure.go rename to applyconfiguration/apis/v1/gatewayinfrastructure.go diff --git a/apis/applyconfiguration/apis/v1/gatewayspec.go b/applyconfiguration/apis/v1/gatewayspec.go similarity index 80% rename from apis/applyconfiguration/apis/v1/gatewayspec.go rename to applyconfiguration/apis/v1/gatewayspec.go index 89ff6b48b5..b278070b29 100644 --- a/apis/applyconfiguration/apis/v1/gatewayspec.go +++ b/applyconfiguration/apis/v1/gatewayspec.go @@ -30,6 +30,7 @@ type GatewaySpecApplyConfiguration struct { Addresses []GatewayAddressApplyConfiguration `json:"addresses,omitempty"` Infrastructure *GatewayInfrastructureApplyConfiguration `json:"infrastructure,omitempty"` BackendTLS *GatewayBackendTLSApplyConfiguration `json:"backendTLS,omitempty"` + AllowedListeners *[]AllowedListenersApplyConfiguration `json:"allowedListeners,omitempty"` } // GatewaySpecApplyConfiguration constructs a declarative configuration of the GatewaySpec type for use with @@ -87,3 +88,23 @@ func (b *GatewaySpecApplyConfiguration) WithBackendTLS(value *GatewayBackendTLSA b.BackendTLS = value return b } + +func (b *GatewaySpecApplyConfiguration) ensureAllowedListenersApplyConfigurationExists() { + if b.AllowedListeners == nil { + b.AllowedListeners = &[]AllowedListenersApplyConfiguration{} + } +} + +// WithAllowedListeners adds the given value to the AllowedListeners 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 AllowedListeners field. +func (b *GatewaySpecApplyConfiguration) WithAllowedListeners(values ...*AllowedListenersApplyConfiguration) *GatewaySpecApplyConfiguration { + b.ensureAllowedListenersApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAllowedListeners") + } + *b.AllowedListeners = append(*b.AllowedListeners, *values[i]) + } + return b +} diff --git a/apis/applyconfiguration/apis/v1/gatewaystatus.go b/applyconfiguration/apis/v1/gatewaystatus.go similarity index 100% rename from apis/applyconfiguration/apis/v1/gatewaystatus.go rename to applyconfiguration/apis/v1/gatewaystatus.go diff --git a/apis/applyconfiguration/apis/v1/gatewaystatusaddress.go b/applyconfiguration/apis/v1/gatewaystatusaddress.go similarity index 100% rename from apis/applyconfiguration/apis/v1/gatewaystatusaddress.go rename to applyconfiguration/apis/v1/gatewaystatusaddress.go diff --git a/apis/applyconfiguration/apis/v1/gatewaytlsconfig.go b/applyconfiguration/apis/v1/gatewaytlsconfig.go similarity index 100% rename from apis/applyconfiguration/apis/v1/gatewaytlsconfig.go rename to applyconfiguration/apis/v1/gatewaytlsconfig.go diff --git a/apis/applyconfiguration/apis/v1/grpcbackendref.go b/applyconfiguration/apis/v1/grpcbackendref.go similarity index 100% rename from apis/applyconfiguration/apis/v1/grpcbackendref.go rename to applyconfiguration/apis/v1/grpcbackendref.go diff --git a/apis/applyconfiguration/apis/v1/grpcheadermatch.go b/applyconfiguration/apis/v1/grpcheadermatch.go similarity index 100% rename from apis/applyconfiguration/apis/v1/grpcheadermatch.go rename to applyconfiguration/apis/v1/grpcheadermatch.go diff --git a/apis/applyconfiguration/apis/v1/grpcmethodmatch.go b/applyconfiguration/apis/v1/grpcmethodmatch.go similarity index 100% rename from apis/applyconfiguration/apis/v1/grpcmethodmatch.go rename to applyconfiguration/apis/v1/grpcmethodmatch.go diff --git a/apis/applyconfiguration/apis/v1/grpcroute.go b/applyconfiguration/apis/v1/grpcroute.go similarity index 99% rename from apis/applyconfiguration/apis/v1/grpcroute.go rename to applyconfiguration/apis/v1/grpcroute.go index 3c3b376dbf..5728e58334 100644 --- a/apis/applyconfiguration/apis/v1/grpcroute.go +++ b/applyconfiguration/apis/v1/grpcroute.go @@ -23,8 +23,8 @@ import ( 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" gatewayapiapisv1 "sigs.k8s.io/gateway-api/apis/v1" + internal "sigs.k8s.io/gateway-api/applyconfiguration/internal" ) // GRPCRouteApplyConfiguration represents a declarative configuration of the GRPCRoute type for use diff --git a/apis/applyconfiguration/apis/v1/grpcroutefilter.go b/applyconfiguration/apis/v1/grpcroutefilter.go similarity index 100% rename from apis/applyconfiguration/apis/v1/grpcroutefilter.go rename to applyconfiguration/apis/v1/grpcroutefilter.go diff --git a/apis/applyconfiguration/apis/v1/grpcroutematch.go b/applyconfiguration/apis/v1/grpcroutematch.go similarity index 100% rename from apis/applyconfiguration/apis/v1/grpcroutematch.go rename to applyconfiguration/apis/v1/grpcroutematch.go diff --git a/apis/applyconfiguration/apis/v1/grpcrouterule.go b/applyconfiguration/apis/v1/grpcrouterule.go similarity index 100% rename from apis/applyconfiguration/apis/v1/grpcrouterule.go rename to applyconfiguration/apis/v1/grpcrouterule.go diff --git a/apis/applyconfiguration/apis/v1/grpcroutespec.go b/applyconfiguration/apis/v1/grpcroutespec.go similarity index 100% rename from apis/applyconfiguration/apis/v1/grpcroutespec.go rename to applyconfiguration/apis/v1/grpcroutespec.go diff --git a/apis/applyconfiguration/apis/v1/grpcroutestatus.go b/applyconfiguration/apis/v1/grpcroutestatus.go similarity index 100% rename from apis/applyconfiguration/apis/v1/grpcroutestatus.go rename to applyconfiguration/apis/v1/grpcroutestatus.go diff --git a/apis/applyconfiguration/apis/v1/httpbackendref.go b/applyconfiguration/apis/v1/httpbackendref.go similarity index 100% rename from apis/applyconfiguration/apis/v1/httpbackendref.go rename to applyconfiguration/apis/v1/httpbackendref.go diff --git a/apis/applyconfiguration/apis/v1/httpheader.go b/applyconfiguration/apis/v1/httpheader.go similarity index 100% rename from apis/applyconfiguration/apis/v1/httpheader.go rename to applyconfiguration/apis/v1/httpheader.go diff --git a/apis/applyconfiguration/apis/v1/httpheaderfilter.go b/applyconfiguration/apis/v1/httpheaderfilter.go similarity index 100% rename from apis/applyconfiguration/apis/v1/httpheaderfilter.go rename to applyconfiguration/apis/v1/httpheaderfilter.go diff --git a/apis/applyconfiguration/apis/v1/httpheadermatch.go b/applyconfiguration/apis/v1/httpheadermatch.go similarity index 100% rename from apis/applyconfiguration/apis/v1/httpheadermatch.go rename to applyconfiguration/apis/v1/httpheadermatch.go diff --git a/apis/applyconfiguration/apis/v1/httppathmatch.go b/applyconfiguration/apis/v1/httppathmatch.go similarity index 100% rename from apis/applyconfiguration/apis/v1/httppathmatch.go rename to applyconfiguration/apis/v1/httppathmatch.go diff --git a/apis/applyconfiguration/apis/v1/httppathmodifier.go b/applyconfiguration/apis/v1/httppathmodifier.go similarity index 100% rename from apis/applyconfiguration/apis/v1/httppathmodifier.go rename to applyconfiguration/apis/v1/httppathmodifier.go diff --git a/apis/applyconfiguration/apis/v1/httpqueryparammatch.go b/applyconfiguration/apis/v1/httpqueryparammatch.go similarity index 100% rename from apis/applyconfiguration/apis/v1/httpqueryparammatch.go rename to applyconfiguration/apis/v1/httpqueryparammatch.go diff --git a/apis/applyconfiguration/apis/v1/httprequestmirrorfilter.go b/applyconfiguration/apis/v1/httprequestmirrorfilter.go similarity index 100% rename from apis/applyconfiguration/apis/v1/httprequestmirrorfilter.go rename to applyconfiguration/apis/v1/httprequestmirrorfilter.go diff --git a/apis/applyconfiguration/apis/v1/httprequestredirectfilter.go b/applyconfiguration/apis/v1/httprequestredirectfilter.go similarity index 100% rename from apis/applyconfiguration/apis/v1/httprequestredirectfilter.go rename to applyconfiguration/apis/v1/httprequestredirectfilter.go diff --git a/apis/applyconfiguration/apis/v1/httproute.go b/applyconfiguration/apis/v1/httproute.go similarity index 99% rename from apis/applyconfiguration/apis/v1/httproute.go rename to applyconfiguration/apis/v1/httproute.go index 0fabf88cda..ee961e0130 100644 --- a/apis/applyconfiguration/apis/v1/httproute.go +++ b/applyconfiguration/apis/v1/httproute.go @@ -23,8 +23,8 @@ import ( 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" gatewayapiapisv1 "sigs.k8s.io/gateway-api/apis/v1" + internal "sigs.k8s.io/gateway-api/applyconfiguration/internal" ) // HTTPRouteApplyConfiguration represents a declarative configuration of the HTTPRoute type for use diff --git a/apis/applyconfiguration/apis/v1/httproutefilter.go b/applyconfiguration/apis/v1/httproutefilter.go similarity index 100% rename from apis/applyconfiguration/apis/v1/httproutefilter.go rename to applyconfiguration/apis/v1/httproutefilter.go diff --git a/apis/applyconfiguration/apis/v1/httproutematch.go b/applyconfiguration/apis/v1/httproutematch.go similarity index 100% rename from apis/applyconfiguration/apis/v1/httproutematch.go rename to applyconfiguration/apis/v1/httproutematch.go diff --git a/apis/applyconfiguration/apis/v1/httprouteretry.go b/applyconfiguration/apis/v1/httprouteretry.go similarity index 100% rename from apis/applyconfiguration/apis/v1/httprouteretry.go rename to applyconfiguration/apis/v1/httprouteretry.go diff --git a/apis/applyconfiguration/apis/v1/httprouterule.go b/applyconfiguration/apis/v1/httprouterule.go similarity index 100% rename from apis/applyconfiguration/apis/v1/httprouterule.go rename to applyconfiguration/apis/v1/httprouterule.go diff --git a/apis/applyconfiguration/apis/v1/httproutespec.go b/applyconfiguration/apis/v1/httproutespec.go similarity index 100% rename from apis/applyconfiguration/apis/v1/httproutespec.go rename to applyconfiguration/apis/v1/httproutespec.go diff --git a/apis/applyconfiguration/apis/v1/httproutestatus.go b/applyconfiguration/apis/v1/httproutestatus.go similarity index 100% rename from apis/applyconfiguration/apis/v1/httproutestatus.go rename to applyconfiguration/apis/v1/httproutestatus.go diff --git a/apis/applyconfiguration/apis/v1/httproutetimeouts.go b/applyconfiguration/apis/v1/httproutetimeouts.go similarity index 100% rename from apis/applyconfiguration/apis/v1/httproutetimeouts.go rename to applyconfiguration/apis/v1/httproutetimeouts.go diff --git a/apis/applyconfiguration/apis/v1/httpurlrewritefilter.go b/applyconfiguration/apis/v1/httpurlrewritefilter.go similarity index 100% rename from apis/applyconfiguration/apis/v1/httpurlrewritefilter.go rename to applyconfiguration/apis/v1/httpurlrewritefilter.go diff --git a/apis/applyconfiguration/apis/v1/listener.go b/applyconfiguration/apis/v1/listener.go similarity index 100% rename from apis/applyconfiguration/apis/v1/listener.go rename to applyconfiguration/apis/v1/listener.go diff --git a/applyconfiguration/apis/v1/listenernamespaces.go b/applyconfiguration/apis/v1/listenernamespaces.go new file mode 100644 index 0000000000..33d0be045a --- /dev/null +++ b/applyconfiguration/apis/v1/listenernamespaces.go @@ -0,0 +1,43 @@ +/* +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 v1 + +import ( + v1 "sigs.k8s.io/gateway-api/apis/v1" +) + +// ListenerNamespacesApplyConfiguration represents a declarative configuration of the ListenerNamespaces type for use +// with apply. +type ListenerNamespacesApplyConfiguration struct { + From *v1.FromNamespaces `json:"from,omitempty"` +} + +// ListenerNamespacesApplyConfiguration constructs a declarative configuration of the ListenerNamespaces type for use with +// apply. +func ListenerNamespaces() *ListenerNamespacesApplyConfiguration { + return &ListenerNamespacesApplyConfiguration{} +} + +// WithFrom sets the From 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 From field is set to the value of the last call. +func (b *ListenerNamespacesApplyConfiguration) WithFrom(value v1.FromNamespaces) *ListenerNamespacesApplyConfiguration { + b.From = &value + return b +} diff --git a/apis/applyconfiguration/apis/v1/listenerstatus.go b/applyconfiguration/apis/v1/listenerstatus.go similarity index 100% rename from apis/applyconfiguration/apis/v1/listenerstatus.go rename to applyconfiguration/apis/v1/listenerstatus.go diff --git a/apis/applyconfiguration/apis/v1/localobjectreference.go b/applyconfiguration/apis/v1/localobjectreference.go similarity index 100% rename from apis/applyconfiguration/apis/v1/localobjectreference.go rename to applyconfiguration/apis/v1/localobjectreference.go diff --git a/apis/applyconfiguration/apis/v1/localparametersreference.go b/applyconfiguration/apis/v1/localparametersreference.go similarity index 100% rename from apis/applyconfiguration/apis/v1/localparametersreference.go rename to applyconfiguration/apis/v1/localparametersreference.go diff --git a/apis/applyconfiguration/apis/v1/objectreference.go b/applyconfiguration/apis/v1/objectreference.go similarity index 100% rename from apis/applyconfiguration/apis/v1/objectreference.go rename to applyconfiguration/apis/v1/objectreference.go diff --git a/apis/applyconfiguration/apis/v1/parametersreference.go b/applyconfiguration/apis/v1/parametersreference.go similarity index 100% rename from apis/applyconfiguration/apis/v1/parametersreference.go rename to applyconfiguration/apis/v1/parametersreference.go diff --git a/apis/applyconfiguration/apis/v1/parentreference.go b/applyconfiguration/apis/v1/parentreference.go similarity index 100% rename from apis/applyconfiguration/apis/v1/parentreference.go rename to applyconfiguration/apis/v1/parentreference.go diff --git a/apis/applyconfiguration/apis/v1/routegroupkind.go b/applyconfiguration/apis/v1/routegroupkind.go similarity index 100% rename from apis/applyconfiguration/apis/v1/routegroupkind.go rename to applyconfiguration/apis/v1/routegroupkind.go diff --git a/apis/applyconfiguration/apis/v1/routenamespaces.go b/applyconfiguration/apis/v1/routenamespaces.go similarity index 100% rename from apis/applyconfiguration/apis/v1/routenamespaces.go rename to applyconfiguration/apis/v1/routenamespaces.go diff --git a/apis/applyconfiguration/apis/v1/routeparentstatus.go b/applyconfiguration/apis/v1/routeparentstatus.go similarity index 100% rename from apis/applyconfiguration/apis/v1/routeparentstatus.go rename to applyconfiguration/apis/v1/routeparentstatus.go diff --git a/apis/applyconfiguration/apis/v1/routestatus.go b/applyconfiguration/apis/v1/routestatus.go similarity index 100% rename from apis/applyconfiguration/apis/v1/routestatus.go rename to applyconfiguration/apis/v1/routestatus.go diff --git a/apis/applyconfiguration/apis/v1/secretobjectreference.go b/applyconfiguration/apis/v1/secretobjectreference.go similarity index 100% rename from apis/applyconfiguration/apis/v1/secretobjectreference.go rename to applyconfiguration/apis/v1/secretobjectreference.go diff --git a/apis/applyconfiguration/apis/v1/sessionpersistence.go b/applyconfiguration/apis/v1/sessionpersistence.go similarity index 100% rename from apis/applyconfiguration/apis/v1/sessionpersistence.go rename to applyconfiguration/apis/v1/sessionpersistence.go diff --git a/apis/applyconfiguration/apis/v1/supportedfeature.go b/applyconfiguration/apis/v1/supportedfeature.go similarity index 100% rename from apis/applyconfiguration/apis/v1/supportedfeature.go rename to applyconfiguration/apis/v1/supportedfeature.go diff --git a/apis/applyconfiguration/apis/v1alpha2/backendlbpolicy.go b/applyconfiguration/apis/v1alpha2/backendlbpolicy.go similarity index 99% rename from apis/applyconfiguration/apis/v1alpha2/backendlbpolicy.go rename to applyconfiguration/apis/v1alpha2/backendlbpolicy.go index e63c8cd653..4c648144a3 100644 --- a/apis/applyconfiguration/apis/v1alpha2/backendlbpolicy.go +++ b/applyconfiguration/apis/v1alpha2/backendlbpolicy.go @@ -23,8 +23,8 @@ import ( 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" + internal "sigs.k8s.io/gateway-api/applyconfiguration/internal" ) // BackendLBPolicyApplyConfiguration represents a declarative configuration of the BackendLBPolicy type for use diff --git a/apis/applyconfiguration/apis/v1alpha2/backendlbpolicyspec.go b/applyconfiguration/apis/v1alpha2/backendlbpolicyspec.go similarity index 97% rename from apis/applyconfiguration/apis/v1alpha2/backendlbpolicyspec.go rename to applyconfiguration/apis/v1alpha2/backendlbpolicyspec.go index b443579a6b..9c8db9e60b 100644 --- a/apis/applyconfiguration/apis/v1alpha2/backendlbpolicyspec.go +++ b/applyconfiguration/apis/v1alpha2/backendlbpolicyspec.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha2 import ( - v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" + v1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" ) // BackendLBPolicySpecApplyConfiguration represents a declarative configuration of the BackendLBPolicySpec type for use diff --git a/apis/applyconfiguration/apis/v1alpha2/grpcroute.go b/applyconfiguration/apis/v1alpha2/grpcroute.go similarity index 98% rename from apis/applyconfiguration/apis/v1alpha2/grpcroute.go rename to applyconfiguration/apis/v1alpha2/grpcroute.go index 7e6f806b2c..b0896d92ff 100644 --- a/apis/applyconfiguration/apis/v1alpha2/grpcroute.go +++ b/applyconfiguration/apis/v1alpha2/grpcroute.go @@ -23,9 +23,9 @@ import ( types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" v1 "k8s.io/client-go/applyconfigurations/meta/v1" - apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" - internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" + apisv1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" + internal "sigs.k8s.io/gateway-api/applyconfiguration/internal" ) // GRPCRouteApplyConfiguration represents a declarative configuration of the GRPCRoute type for use diff --git a/apis/applyconfiguration/apis/v1alpha2/localpolicytargetreference.go b/applyconfiguration/apis/v1alpha2/localpolicytargetreference.go similarity index 100% rename from apis/applyconfiguration/apis/v1alpha2/localpolicytargetreference.go rename to applyconfiguration/apis/v1alpha2/localpolicytargetreference.go diff --git a/apis/applyconfiguration/apis/v1alpha2/localpolicytargetreferencewithsectionname.go b/applyconfiguration/apis/v1alpha2/localpolicytargetreferencewithsectionname.go similarity index 100% rename from apis/applyconfiguration/apis/v1alpha2/localpolicytargetreferencewithsectionname.go rename to applyconfiguration/apis/v1alpha2/localpolicytargetreferencewithsectionname.go diff --git a/apis/applyconfiguration/apis/v1alpha2/policyancestorstatus.go b/applyconfiguration/apis/v1alpha2/policyancestorstatus.go similarity index 97% rename from apis/applyconfiguration/apis/v1alpha2/policyancestorstatus.go rename to applyconfiguration/apis/v1alpha2/policyancestorstatus.go index d59b5c78ae..2237f51deb 100644 --- a/apis/applyconfiguration/apis/v1alpha2/policyancestorstatus.go +++ b/applyconfiguration/apis/v1alpha2/policyancestorstatus.go @@ -20,8 +20,8 @@ package v1alpha2 import ( metav1 "k8s.io/client-go/applyconfigurations/meta/v1" - v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" apisv1 "sigs.k8s.io/gateway-api/apis/v1" + v1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" ) // PolicyAncestorStatusApplyConfiguration represents a declarative configuration of the PolicyAncestorStatus type for use diff --git a/apis/applyconfiguration/apis/v1alpha2/policystatus.go b/applyconfiguration/apis/v1alpha2/policystatus.go similarity index 100% rename from apis/applyconfiguration/apis/v1alpha2/policystatus.go rename to applyconfiguration/apis/v1alpha2/policystatus.go diff --git a/apis/applyconfiguration/apis/v1alpha2/referencegrant.go b/applyconfiguration/apis/v1alpha2/referencegrant.go similarity index 98% rename from apis/applyconfiguration/apis/v1alpha2/referencegrant.go rename to applyconfiguration/apis/v1alpha2/referencegrant.go index e25a74a63e..e8ea62c9aa 100644 --- a/apis/applyconfiguration/apis/v1alpha2/referencegrant.go +++ b/applyconfiguration/apis/v1alpha2/referencegrant.go @@ -23,9 +23,9 @@ import ( types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" v1 "k8s.io/client-go/applyconfigurations/meta/v1" - v1beta1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1" - internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" v1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" + v1beta1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1beta1" + internal "sigs.k8s.io/gateway-api/applyconfiguration/internal" ) // ReferenceGrantApplyConfiguration represents a declarative configuration of the ReferenceGrant type for use diff --git a/apis/applyconfiguration/apis/v1alpha2/tcproute.go b/applyconfiguration/apis/v1alpha2/tcproute.go similarity index 99% rename from apis/applyconfiguration/apis/v1alpha2/tcproute.go rename to applyconfiguration/apis/v1alpha2/tcproute.go index 1edbd0d753..b56a8198ba 100644 --- a/apis/applyconfiguration/apis/v1alpha2/tcproute.go +++ b/applyconfiguration/apis/v1alpha2/tcproute.go @@ -23,8 +23,8 @@ import ( 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" + internal "sigs.k8s.io/gateway-api/applyconfiguration/internal" ) // TCPRouteApplyConfiguration represents a declarative configuration of the TCPRoute type for use diff --git a/apis/applyconfiguration/apis/v1alpha2/tcprouterule.go b/applyconfiguration/apis/v1alpha2/tcprouterule.go similarity index 97% rename from apis/applyconfiguration/apis/v1alpha2/tcprouterule.go rename to applyconfiguration/apis/v1alpha2/tcprouterule.go index 450d89992d..ea91c01648 100644 --- a/apis/applyconfiguration/apis/v1alpha2/tcprouterule.go +++ b/applyconfiguration/apis/v1alpha2/tcprouterule.go @@ -19,8 +19,8 @@ limitations under the License. package v1alpha2 import ( - apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" v1 "sigs.k8s.io/gateway-api/apis/v1" + apisv1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" ) // TCPRouteRuleApplyConfiguration represents a declarative configuration of the TCPRouteRule type for use diff --git a/apis/applyconfiguration/apis/v1alpha2/tcproutespec.go b/applyconfiguration/apis/v1alpha2/tcproutespec.go similarity index 97% rename from apis/applyconfiguration/apis/v1alpha2/tcproutespec.go rename to applyconfiguration/apis/v1alpha2/tcproutespec.go index 375a7f4b16..c693e96c70 100644 --- a/apis/applyconfiguration/apis/v1alpha2/tcproutespec.go +++ b/applyconfiguration/apis/v1alpha2/tcproutespec.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha2 import ( - v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" + v1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" ) // TCPRouteSpecApplyConfiguration represents a declarative configuration of the TCPRouteSpec type for use diff --git a/apis/applyconfiguration/apis/v1alpha2/tcproutestatus.go b/applyconfiguration/apis/v1alpha2/tcproutestatus.go similarity index 96% rename from apis/applyconfiguration/apis/v1alpha2/tcproutestatus.go rename to applyconfiguration/apis/v1alpha2/tcproutestatus.go index a32ffd2bfd..9094efd4d6 100644 --- a/apis/applyconfiguration/apis/v1alpha2/tcproutestatus.go +++ b/applyconfiguration/apis/v1alpha2/tcproutestatus.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha2 import ( - v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" + v1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" ) // TCPRouteStatusApplyConfiguration represents a declarative configuration of the TCPRouteStatus type for use diff --git a/apis/applyconfiguration/apis/v1alpha2/tlsroute.go b/applyconfiguration/apis/v1alpha2/tlsroute.go similarity index 99% rename from apis/applyconfiguration/apis/v1alpha2/tlsroute.go rename to applyconfiguration/apis/v1alpha2/tlsroute.go index 5cfdd67395..7dfe99da78 100644 --- a/apis/applyconfiguration/apis/v1alpha2/tlsroute.go +++ b/applyconfiguration/apis/v1alpha2/tlsroute.go @@ -23,8 +23,8 @@ import ( 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" + internal "sigs.k8s.io/gateway-api/applyconfiguration/internal" ) // TLSRouteApplyConfiguration represents a declarative configuration of the TLSRoute type for use diff --git a/apis/applyconfiguration/apis/v1alpha2/tlsrouterule.go b/applyconfiguration/apis/v1alpha2/tlsrouterule.go similarity index 97% rename from apis/applyconfiguration/apis/v1alpha2/tlsrouterule.go rename to applyconfiguration/apis/v1alpha2/tlsrouterule.go index e7124fc866..c8aecf0bf1 100644 --- a/apis/applyconfiguration/apis/v1alpha2/tlsrouterule.go +++ b/applyconfiguration/apis/v1alpha2/tlsrouterule.go @@ -19,8 +19,8 @@ limitations under the License. package v1alpha2 import ( - apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" v1 "sigs.k8s.io/gateway-api/apis/v1" + apisv1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" ) // TLSRouteRuleApplyConfiguration represents a declarative configuration of the TLSRouteRule type for use diff --git a/apis/applyconfiguration/apis/v1alpha2/tlsroutespec.go b/applyconfiguration/apis/v1alpha2/tlsroutespec.go similarity index 97% rename from apis/applyconfiguration/apis/v1alpha2/tlsroutespec.go rename to applyconfiguration/apis/v1alpha2/tlsroutespec.go index a8e3745ff2..4fc149ec32 100644 --- a/apis/applyconfiguration/apis/v1alpha2/tlsroutespec.go +++ b/applyconfiguration/apis/v1alpha2/tlsroutespec.go @@ -19,8 +19,8 @@ limitations under the License. package v1alpha2 import ( - v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" apisv1 "sigs.k8s.io/gateway-api/apis/v1" + v1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" ) // TLSRouteSpecApplyConfiguration represents a declarative configuration of the TLSRouteSpec type for use diff --git a/apis/applyconfiguration/apis/v1alpha2/tlsroutestatus.go b/applyconfiguration/apis/v1alpha2/tlsroutestatus.go similarity index 96% rename from apis/applyconfiguration/apis/v1alpha2/tlsroutestatus.go rename to applyconfiguration/apis/v1alpha2/tlsroutestatus.go index 4f0cb40826..43a48f42d0 100644 --- a/apis/applyconfiguration/apis/v1alpha2/tlsroutestatus.go +++ b/applyconfiguration/apis/v1alpha2/tlsroutestatus.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha2 import ( - v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" + v1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" ) // TLSRouteStatusApplyConfiguration represents a declarative configuration of the TLSRouteStatus type for use diff --git a/apis/applyconfiguration/apis/v1alpha2/udproute.go b/applyconfiguration/apis/v1alpha2/udproute.go similarity index 99% rename from apis/applyconfiguration/apis/v1alpha2/udproute.go rename to applyconfiguration/apis/v1alpha2/udproute.go index 377e85d87e..2ea4d5b460 100644 --- a/apis/applyconfiguration/apis/v1alpha2/udproute.go +++ b/applyconfiguration/apis/v1alpha2/udproute.go @@ -23,8 +23,8 @@ import ( 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" + internal "sigs.k8s.io/gateway-api/applyconfiguration/internal" ) // UDPRouteApplyConfiguration represents a declarative configuration of the UDPRoute type for use diff --git a/apis/applyconfiguration/apis/v1alpha2/udprouterule.go b/applyconfiguration/apis/v1alpha2/udprouterule.go similarity index 97% rename from apis/applyconfiguration/apis/v1alpha2/udprouterule.go rename to applyconfiguration/apis/v1alpha2/udprouterule.go index fd6171a2c7..4d77460dce 100644 --- a/apis/applyconfiguration/apis/v1alpha2/udprouterule.go +++ b/applyconfiguration/apis/v1alpha2/udprouterule.go @@ -19,8 +19,8 @@ limitations under the License. package v1alpha2 import ( - apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" v1 "sigs.k8s.io/gateway-api/apis/v1" + apisv1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" ) // UDPRouteRuleApplyConfiguration represents a declarative configuration of the UDPRouteRule type for use diff --git a/apis/applyconfiguration/apis/v1alpha2/udproutespec.go b/applyconfiguration/apis/v1alpha2/udproutespec.go similarity index 97% rename from apis/applyconfiguration/apis/v1alpha2/udproutespec.go rename to applyconfiguration/apis/v1alpha2/udproutespec.go index eed193696b..c75a0b520f 100644 --- a/apis/applyconfiguration/apis/v1alpha2/udproutespec.go +++ b/applyconfiguration/apis/v1alpha2/udproutespec.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha2 import ( - v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" + v1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" ) // UDPRouteSpecApplyConfiguration represents a declarative configuration of the UDPRouteSpec type for use diff --git a/apis/applyconfiguration/apis/v1alpha2/udproutestatus.go b/applyconfiguration/apis/v1alpha2/udproutestatus.go similarity index 96% rename from apis/applyconfiguration/apis/v1alpha2/udproutestatus.go rename to applyconfiguration/apis/v1alpha2/udproutestatus.go index 57abcf15a2..ae17a28bb2 100644 --- a/apis/applyconfiguration/apis/v1alpha2/udproutestatus.go +++ b/applyconfiguration/apis/v1alpha2/udproutestatus.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha2 import ( - v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" + v1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" ) // UDPRouteStatusApplyConfiguration represents a declarative configuration of the UDPRouteStatus type for use diff --git a/apis/applyconfiguration/apis/v1alpha3/backendtlspolicy.go b/applyconfiguration/apis/v1alpha3/backendtlspolicy.go similarity index 98% rename from apis/applyconfiguration/apis/v1alpha3/backendtlspolicy.go rename to applyconfiguration/apis/v1alpha3/backendtlspolicy.go index 5cbf6a8d9e..ba89d4f2f3 100644 --- a/apis/applyconfiguration/apis/v1alpha3/backendtlspolicy.go +++ b/applyconfiguration/apis/v1alpha3/backendtlspolicy.go @@ -23,9 +23,9 @@ import ( types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" v1 "k8s.io/client-go/applyconfigurations/meta/v1" - v1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" - internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" apisv1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" + v1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha2" + internal "sigs.k8s.io/gateway-api/applyconfiguration/internal" ) // BackendTLSPolicyApplyConfiguration represents a declarative configuration of the BackendTLSPolicy type for use diff --git a/apis/applyconfiguration/apis/v1alpha3/backendtlspolicyspec.go b/applyconfiguration/apis/v1alpha3/backendtlspolicyspec.go similarity index 97% rename from apis/applyconfiguration/apis/v1alpha3/backendtlspolicyspec.go rename to applyconfiguration/apis/v1alpha3/backendtlspolicyspec.go index 5290a35fa0..97efdbcdee 100644 --- a/apis/applyconfiguration/apis/v1alpha3/backendtlspolicyspec.go +++ b/applyconfiguration/apis/v1alpha3/backendtlspolicyspec.go @@ -19,8 +19,8 @@ limitations under the License. package v1alpha3 import ( - v1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" v1 "sigs.k8s.io/gateway-api/apis/v1" + v1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha2" ) // BackendTLSPolicySpecApplyConfiguration represents a declarative configuration of the BackendTLSPolicySpec type for use diff --git a/apis/applyconfiguration/apis/v1alpha3/backendtlspolicyvalidation.go b/applyconfiguration/apis/v1alpha3/backendtlspolicyvalidation.go similarity index 98% rename from apis/applyconfiguration/apis/v1alpha3/backendtlspolicyvalidation.go rename to applyconfiguration/apis/v1alpha3/backendtlspolicyvalidation.go index 1245e2853c..4f0f5d922b 100644 --- a/apis/applyconfiguration/apis/v1alpha3/backendtlspolicyvalidation.go +++ b/applyconfiguration/apis/v1alpha3/backendtlspolicyvalidation.go @@ -19,9 +19,9 @@ limitations under the License. package v1alpha3 import ( - v1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" apisv1 "sigs.k8s.io/gateway-api/apis/v1" v1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" + v1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" ) // BackendTLSPolicyValidationApplyConfiguration represents a declarative configuration of the BackendTLSPolicyValidation type for use diff --git a/apis/applyconfiguration/apis/v1alpha3/subjectaltname.go b/applyconfiguration/apis/v1alpha3/subjectaltname.go similarity index 100% rename from apis/applyconfiguration/apis/v1alpha3/subjectaltname.go rename to applyconfiguration/apis/v1alpha3/subjectaltname.go diff --git a/apis/applyconfiguration/apis/v1beta1/gateway.go b/applyconfiguration/apis/v1beta1/gateway.go similarity index 98% rename from apis/applyconfiguration/apis/v1beta1/gateway.go rename to applyconfiguration/apis/v1beta1/gateway.go index 8046345c75..49ec4b21ce 100644 --- a/apis/applyconfiguration/apis/v1beta1/gateway.go +++ b/applyconfiguration/apis/v1beta1/gateway.go @@ -23,9 +23,9 @@ import ( types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" v1 "k8s.io/client-go/applyconfigurations/meta/v1" - apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" - internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" + apisv1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" + internal "sigs.k8s.io/gateway-api/applyconfiguration/internal" ) // GatewayApplyConfiguration represents a declarative configuration of the Gateway type for use diff --git a/apis/applyconfiguration/apis/v1beta1/gatewayclass.go b/applyconfiguration/apis/v1beta1/gatewayclass.go similarity index 98% rename from apis/applyconfiguration/apis/v1beta1/gatewayclass.go rename to applyconfiguration/apis/v1beta1/gatewayclass.go index 938c6ba0a4..4ca42d5bd9 100644 --- a/apis/applyconfiguration/apis/v1beta1/gatewayclass.go +++ b/applyconfiguration/apis/v1beta1/gatewayclass.go @@ -23,9 +23,9 @@ import ( types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" v1 "k8s.io/client-go/applyconfigurations/meta/v1" - apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" - internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" + apisv1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" + internal "sigs.k8s.io/gateway-api/applyconfiguration/internal" ) // GatewayClassApplyConfiguration represents a declarative configuration of the GatewayClass type for use diff --git a/apis/applyconfiguration/apis/v1beta1/httproute.go b/applyconfiguration/apis/v1beta1/httproute.go similarity index 98% rename from apis/applyconfiguration/apis/v1beta1/httproute.go rename to applyconfiguration/apis/v1beta1/httproute.go index 84a40d9a32..aa85c30772 100644 --- a/apis/applyconfiguration/apis/v1beta1/httproute.go +++ b/applyconfiguration/apis/v1beta1/httproute.go @@ -23,9 +23,9 @@ import ( types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" v1 "k8s.io/client-go/applyconfigurations/meta/v1" - apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" - internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" + apisv1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" + internal "sigs.k8s.io/gateway-api/applyconfiguration/internal" ) // HTTPRouteApplyConfiguration represents a declarative configuration of the HTTPRoute type for use diff --git a/apis/applyconfiguration/apis/v1beta1/referencegrant.go b/applyconfiguration/apis/v1beta1/referencegrant.go similarity index 99% rename from apis/applyconfiguration/apis/v1beta1/referencegrant.go rename to applyconfiguration/apis/v1beta1/referencegrant.go index b6b8c2e507..79c19df83e 100644 --- a/apis/applyconfiguration/apis/v1beta1/referencegrant.go +++ b/applyconfiguration/apis/v1beta1/referencegrant.go @@ -23,8 +23,8 @@ import ( 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" apisv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" + internal "sigs.k8s.io/gateway-api/applyconfiguration/internal" ) // ReferenceGrantApplyConfiguration represents a declarative configuration of the ReferenceGrant type for use diff --git a/apis/applyconfiguration/apis/v1beta1/referencegrantfrom.go b/applyconfiguration/apis/v1beta1/referencegrantfrom.go similarity index 100% rename from apis/applyconfiguration/apis/v1beta1/referencegrantfrom.go rename to applyconfiguration/apis/v1beta1/referencegrantfrom.go diff --git a/apis/applyconfiguration/apis/v1beta1/referencegrantspec.go b/applyconfiguration/apis/v1beta1/referencegrantspec.go similarity index 100% rename from apis/applyconfiguration/apis/v1beta1/referencegrantspec.go rename to applyconfiguration/apis/v1beta1/referencegrantspec.go diff --git a/apis/applyconfiguration/apis/v1beta1/referencegrantto.go b/applyconfiguration/apis/v1beta1/referencegrantto.go similarity index 100% rename from apis/applyconfiguration/apis/v1beta1/referencegrantto.go rename to applyconfiguration/apis/v1beta1/referencegrantto.go diff --git a/applyconfiguration/apisx/v1alpha1/listenerentry.go b/applyconfiguration/apisx/v1alpha1/listenerentry.go new file mode 100644 index 0000000000..e6396bf199 --- /dev/null +++ b/applyconfiguration/apisx/v1alpha1/listenerentry.go @@ -0,0 +1,89 @@ +/* +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" + apisv1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" +) + +// ListenerEntryApplyConfiguration represents a declarative configuration of the ListenerEntry type for use +// with apply. +type ListenerEntryApplyConfiguration struct { + Name *v1.SectionName `json:"name,omitempty"` + Hostname *v1.Hostname `json:"hostname,omitempty"` + Port *v1.PortNumber `json:"port,omitempty"` + Protocol *v1.ProtocolType `json:"protocol,omitempty"` + TLS *apisv1.GatewayTLSConfigApplyConfiguration `json:"tls,omitempty"` + AllowedRoutes *apisv1.AllowedRoutesApplyConfiguration `json:"allowedRoutes,omitempty"` +} + +// ListenerEntryApplyConfiguration constructs a declarative configuration of the ListenerEntry type for use with +// apply. +func ListenerEntry() *ListenerEntryApplyConfiguration { + return &ListenerEntryApplyConfiguration{} +} + +// 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 *ListenerEntryApplyConfiguration) WithName(value v1.SectionName) *ListenerEntryApplyConfiguration { + b.Name = &value + return b +} + +// WithHostname sets the Hostname 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 Hostname field is set to the value of the last call. +func (b *ListenerEntryApplyConfiguration) WithHostname(value v1.Hostname) *ListenerEntryApplyConfiguration { + b.Hostname = &value + return b +} + +// WithPort sets the Port 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 Port field is set to the value of the last call. +func (b *ListenerEntryApplyConfiguration) WithPort(value v1.PortNumber) *ListenerEntryApplyConfiguration { + b.Port = &value + return b +} + +// WithProtocol sets the Protocol 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 Protocol field is set to the value of the last call. +func (b *ListenerEntryApplyConfiguration) WithProtocol(value v1.ProtocolType) *ListenerEntryApplyConfiguration { + b.Protocol = &value + return b +} + +// WithTLS sets the TLS 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 TLS field is set to the value of the last call. +func (b *ListenerEntryApplyConfiguration) WithTLS(value *apisv1.GatewayTLSConfigApplyConfiguration) *ListenerEntryApplyConfiguration { + b.TLS = value + return b +} + +// WithAllowedRoutes sets the AllowedRoutes 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 AllowedRoutes field is set to the value of the last call. +func (b *ListenerEntryApplyConfiguration) WithAllowedRoutes(value *apisv1.AllowedRoutesApplyConfiguration) *ListenerEntryApplyConfiguration { + b.AllowedRoutes = value + return b +} diff --git a/applyconfiguration/apisx/v1alpha1/listenerentrystatus.go b/applyconfiguration/apisx/v1alpha1/listenerentrystatus.go new file mode 100644 index 0000000000..64d652a426 --- /dev/null +++ b/applyconfiguration/apisx/v1alpha1/listenerentrystatus.go @@ -0,0 +1,91 @@ +/* +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/client-go/applyconfigurations/meta/v1" + v1 "sigs.k8s.io/gateway-api/apis/v1" + apisv1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" +) + +// ListenerEntryStatusApplyConfiguration represents a declarative configuration of the ListenerEntryStatus type for use +// with apply. +type ListenerEntryStatusApplyConfiguration struct { + Name *v1.SectionName `json:"name,omitempty"` + Port *v1.PortNumber `json:"port,omitempty"` + SupportedKinds []apisv1.RouteGroupKindApplyConfiguration `json:"supportedKinds,omitempty"` + AttachedRoutes *int32 `json:"attachedRoutes,omitempty"` + Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` +} + +// ListenerEntryStatusApplyConfiguration constructs a declarative configuration of the ListenerEntryStatus type for use with +// apply. +func ListenerEntryStatus() *ListenerEntryStatusApplyConfiguration { + return &ListenerEntryStatusApplyConfiguration{} +} + +// 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 *ListenerEntryStatusApplyConfiguration) WithName(value v1.SectionName) *ListenerEntryStatusApplyConfiguration { + b.Name = &value + return b +} + +// WithPort sets the Port 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 Port field is set to the value of the last call. +func (b *ListenerEntryStatusApplyConfiguration) WithPort(value v1.PortNumber) *ListenerEntryStatusApplyConfiguration { + b.Port = &value + return b +} + +// WithSupportedKinds adds the given value to the SupportedKinds 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 SupportedKinds field. +func (b *ListenerEntryStatusApplyConfiguration) WithSupportedKinds(values ...*apisv1.RouteGroupKindApplyConfiguration) *ListenerEntryStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSupportedKinds") + } + b.SupportedKinds = append(b.SupportedKinds, *values[i]) + } + return b +} + +// WithAttachedRoutes sets the AttachedRoutes 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 AttachedRoutes field is set to the value of the last call. +func (b *ListenerEntryStatusApplyConfiguration) WithAttachedRoutes(value int32) *ListenerEntryStatusApplyConfiguration { + b.AttachedRoutes = &value + return b +} + +// WithConditions adds the given value to the Conditions 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 Conditions field. +func (b *ListenerEntryStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *ListenerEntryStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} diff --git a/applyconfiguration/apisx/v1alpha1/listenerset.go b/applyconfiguration/apisx/v1alpha1/listenerset.go new file mode 100644 index 0000000000..0eac767554 --- /dev/null +++ b/applyconfiguration/apisx/v1alpha1/listenerset.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 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" + internal "sigs.k8s.io/gateway-api/applyconfiguration/internal" +) + +// ListenerSetApplyConfiguration represents a declarative configuration of the ListenerSet type for use +// with apply. +type ListenerSetApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ListenerSetSpecApplyConfiguration `json:"spec,omitempty"` + Status *ListenerSetStatusApplyConfiguration `json:"status,omitempty"` +} + +// ListenerSet constructs a declarative configuration of the ListenerSet type for use with +// apply. +func ListenerSet(name, namespace string) *ListenerSetApplyConfiguration { + b := &ListenerSetApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("ListenerSet") + b.WithAPIVersion("gateway.networking.k8s-x.io/v1alpha1") + return b +} + +// ExtractListenerSet extracts the applied configuration owned by fieldManager from +// listenerSet. If no managedFields are found in listenerSet for fieldManager, a +// ListenerSetApplyConfiguration 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. +// listenerSet must be a unmodified ListenerSet API object that was retrieved from the Kubernetes API. +// ExtractListenerSet 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 ExtractListenerSet(listenerSet *apisxv1alpha1.ListenerSet, fieldManager string) (*ListenerSetApplyConfiguration, error) { + return extractListenerSet(listenerSet, fieldManager, "") +} + +// ExtractListenerSetStatus is the same as ExtractListenerSet except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractListenerSetStatus(listenerSet *apisxv1alpha1.ListenerSet, fieldManager string) (*ListenerSetApplyConfiguration, error) { + return extractListenerSet(listenerSet, fieldManager, "status") +} + +func extractListenerSet(listenerSet *apisxv1alpha1.ListenerSet, fieldManager string, subresource string) (*ListenerSetApplyConfiguration, error) { + b := &ListenerSetApplyConfiguration{} + err := managedfields.ExtractInto(listenerSet, internal.Parser().Type("io.k8s.sigs.gateway-api.apisx.v1alpha1.ListenerSet"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(listenerSet.Name) + b.WithNamespace(listenerSet.Namespace) + + b.WithKind("ListenerSet") + b.WithAPIVersion("gateway.networking.k8s-x.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 *ListenerSetApplyConfiguration) WithKind(value string) *ListenerSetApplyConfiguration { + 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 *ListenerSetApplyConfiguration) WithAPIVersion(value string) *ListenerSetApplyConfiguration { + 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 *ListenerSetApplyConfiguration) WithName(value string) *ListenerSetApplyConfiguration { + 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 *ListenerSetApplyConfiguration) WithGenerateName(value string) *ListenerSetApplyConfiguration { + 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 *ListenerSetApplyConfiguration) WithNamespace(value string) *ListenerSetApplyConfiguration { + 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 *ListenerSetApplyConfiguration) WithUID(value types.UID) *ListenerSetApplyConfiguration { + 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 *ListenerSetApplyConfiguration) WithResourceVersion(value string) *ListenerSetApplyConfiguration { + 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 *ListenerSetApplyConfiguration) WithGeneration(value int64) *ListenerSetApplyConfiguration { + 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 *ListenerSetApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ListenerSetApplyConfiguration { + 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 *ListenerSetApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ListenerSetApplyConfiguration { + 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 *ListenerSetApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ListenerSetApplyConfiguration { + 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 *ListenerSetApplyConfiguration) WithLabels(entries map[string]string) *ListenerSetApplyConfiguration { + 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 *ListenerSetApplyConfiguration) WithAnnotations(entries map[string]string) *ListenerSetApplyConfiguration { + 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 *ListenerSetApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ListenerSetApplyConfiguration { + 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 *ListenerSetApplyConfiguration) WithFinalizers(values ...string) *ListenerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *ListenerSetApplyConfiguration) 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 *ListenerSetApplyConfiguration) WithSpec(value *ListenerSetSpecApplyConfiguration) *ListenerSetApplyConfiguration { + 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 *ListenerSetApplyConfiguration) WithStatus(value *ListenerSetStatusApplyConfiguration) *ListenerSetApplyConfiguration { + b.Status = value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ListenerSetApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfiguration/apisx/v1alpha1/listenersetspec.go b/applyconfiguration/apisx/v1alpha1/listenersetspec.go new file mode 100644 index 0000000000..66fb3c3368 --- /dev/null +++ b/applyconfiguration/apisx/v1alpha1/listenersetspec.go @@ -0,0 +1,53 @@ +/* +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 + +// ListenerSetSpecApplyConfiguration represents a declarative configuration of the ListenerSetSpec type for use +// with apply. +type ListenerSetSpecApplyConfiguration struct { + ParentRef *ParentGatewayReferenceApplyConfiguration `json:"parentRef,omitempty"` + Listeners []ListenerEntryApplyConfiguration `json:"listeners,omitempty"` +} + +// ListenerSetSpecApplyConfiguration constructs a declarative configuration of the ListenerSetSpec type for use with +// apply. +func ListenerSetSpec() *ListenerSetSpecApplyConfiguration { + return &ListenerSetSpecApplyConfiguration{} +} + +// WithParentRef sets the ParentRef 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 ParentRef field is set to the value of the last call. +func (b *ListenerSetSpecApplyConfiguration) WithParentRef(value *ParentGatewayReferenceApplyConfiguration) *ListenerSetSpecApplyConfiguration { + b.ParentRef = value + return b +} + +// WithListeners adds the given value to the Listeners 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 Listeners field. +func (b *ListenerSetSpecApplyConfiguration) WithListeners(values ...*ListenerEntryApplyConfiguration) *ListenerSetSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithListeners") + } + b.Listeners = append(b.Listeners, *values[i]) + } + return b +} diff --git a/applyconfiguration/apisx/v1alpha1/listenersetstatus.go b/applyconfiguration/apisx/v1alpha1/listenersetstatus.go new file mode 100644 index 0000000000..a55c96b9cf --- /dev/null +++ b/applyconfiguration/apisx/v1alpha1/listenersetstatus.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 applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ListenerSetStatusApplyConfiguration represents a declarative configuration of the ListenerSetStatus type for use +// with apply. +type ListenerSetStatusApplyConfiguration struct { + Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` + Listeners []ListenerEntryStatusApplyConfiguration `json:"listeners,omitempty"` +} + +// ListenerSetStatusApplyConfiguration constructs a declarative configuration of the ListenerSetStatus type for use with +// apply. +func ListenerSetStatus() *ListenerSetStatusApplyConfiguration { + return &ListenerSetStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions 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 Conditions field. +func (b *ListenerSetStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *ListenerSetStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithListeners adds the given value to the Listeners 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 Listeners field. +func (b *ListenerSetStatusApplyConfiguration) WithListeners(values ...*ListenerEntryStatusApplyConfiguration) *ListenerSetStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithListeners") + } + b.Listeners = append(b.Listeners, *values[i]) + } + return b +} diff --git a/applyconfiguration/apisx/v1alpha1/parentgatewayreference.go b/applyconfiguration/apisx/v1alpha1/parentgatewayreference.go new file mode 100644 index 0000000000..0571c27934 --- /dev/null +++ b/applyconfiguration/apisx/v1alpha1/parentgatewayreference.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" +) + +// ParentGatewayReferenceApplyConfiguration represents a declarative configuration of the ParentGatewayReference type for use +// with apply. +type ParentGatewayReferenceApplyConfiguration struct { + Group *v1.Group `json:"group,omitempty"` + Kind *v1.Kind `json:"kind,omitempty"` + Name *v1.ObjectName `json:"name,omitempty"` +} + +// ParentGatewayReferenceApplyConfiguration constructs a declarative configuration of the ParentGatewayReference type for use with +// apply. +func ParentGatewayReference() *ParentGatewayReferenceApplyConfiguration { + return &ParentGatewayReferenceApplyConfiguration{} +} + +// WithGroup sets the Group 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 Group field is set to the value of the last call. +func (b *ParentGatewayReferenceApplyConfiguration) WithGroup(value v1.Group) *ParentGatewayReferenceApplyConfiguration { + b.Group = &value + return b +} + +// 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 *ParentGatewayReferenceApplyConfiguration) WithKind(value v1.Kind) *ParentGatewayReferenceApplyConfiguration { + b.Kind = &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 *ParentGatewayReferenceApplyConfiguration) WithName(value v1.ObjectName) *ParentGatewayReferenceApplyConfiguration { + b.Name = &value + return b +} diff --git a/apis/applyconfiguration/internal/internal.go b/applyconfiguration/internal/internal.go similarity index 92% rename from apis/applyconfiguration/internal/internal.go rename to applyconfiguration/internal/internal.go index 07a0df71dd..bcbe787ab3 100644 --- a/apis/applyconfiguration/internal/internal.go +++ b/applyconfiguration/internal/internal.go @@ -223,6 +223,12 @@ var schemaYAML = typed.YAMLObject(`types: elementRelationship: atomic - name: io.k8s.apimachinery.pkg.apis.meta.v1.Time scalar: untyped +- name: io.k8s.sigs.gateway-api.apis.v1.AllowedListeners + map: + fields: + - name: namespaces + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.ListenerNamespaces - name: io.k8s.sigs.gateway-api.apis.v1.AllowedRoutes map: fields: @@ -581,6 +587,12 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.sigs.gateway-api.apis.v1.GatewayAddress elementRelationship: atomic + - name: allowedListeners + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.AllowedListeners + elementRelationship: atomic - name: backendTLS type: namedType: io.k8s.sigs.gateway-api.apis.v1.GatewayBackendTLS @@ -990,6 +1002,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: tls type: namedType: io.k8s.sigs.gateway-api.apis.v1.GatewayTLSConfig +- name: io.k8s.sigs.gateway-api.apis.v1.ListenerNamespaces + map: + fields: + - name: from + type: + scalar: string - name: io.k8s.sigs.gateway-api.apis.v1.ListenerStatus map: fields: @@ -1693,6 +1711,126 @@ var schemaYAML = typed.YAMLObject(`types: - name: name type: scalar: string +- name: io.k8s.sigs.gateway-api.apisx.v1alpha1.ListenerEntry + map: + fields: + - name: allowedRoutes + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.AllowedRoutes + - name: hostname + type: + scalar: string + - name: name + type: + scalar: string + default: "" + - name: port + type: + scalar: numeric + - name: protocol + type: + scalar: string + default: "" + - name: tls + type: + namedType: io.k8s.sigs.gateway-api.apis.v1.GatewayTLSConfig +- name: io.k8s.sigs.gateway-api.apisx.v1alpha1.ListenerEntryStatus + map: + fields: + - name: attachedRoutes + type: + scalar: numeric + default: 0 + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type + - name: name + type: + scalar: string + default: "" + - name: port + type: + scalar: numeric + default: 0 + - name: supportedKinds + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apis.v1.RouteGroupKind + elementRelationship: atomic +- name: io.k8s.sigs.gateway-api.apisx.v1alpha1.ListenerSet + 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.ListenerSetSpec + default: {} + - name: status + type: + namedType: io.k8s.sigs.gateway-api.apisx.v1alpha1.ListenerSetStatus + default: {} +- name: io.k8s.sigs.gateway-api.apisx.v1alpha1.ListenerSetSpec + map: + fields: + - name: listeners + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apisx.v1alpha1.ListenerEntry + elementRelationship: associative + keys: + - name + - name: parentRef + type: + namedType: io.k8s.sigs.gateway-api.apisx.v1alpha1.ParentGatewayReference + default: {} +- name: io.k8s.sigs.gateway-api.apisx.v1alpha1.ListenerSetStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type + - name: listeners + type: + list: + elementType: + namedType: io.k8s.sigs.gateway-api.apisx.v1alpha1.ListenerEntryStatus + elementRelationship: associative + keys: + - name +- name: io.k8s.sigs.gateway-api.apisx.v1alpha1.ParentGatewayReference + map: + fields: + - name: group + type: + scalar: string + - name: kind + type: + scalar: string + - name: name + type: + scalar: string + default: "" - name: __untyped_atomic_ scalar: untyped list: diff --git a/apis/applyconfiguration/utils.go b/applyconfiguration/utils.go similarity index 88% rename from apis/applyconfiguration/utils.go rename to applyconfiguration/utils.go index debd0d9f68..51224de4d7 100644 --- a/apis/applyconfiguration/utils.go +++ b/applyconfiguration/utils.go @@ -22,22 +22,40 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" testing "k8s.io/client-go/testing" - apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" - apisv1alpha2 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha2" - apisv1alpha3 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3" - apisv1beta1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1" - internal "sigs.k8s.io/gateway-api/apis/applyconfiguration/internal" v1 "sigs.k8s.io/gateway-api/apis/v1" 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" + 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" + internal "sigs.k8s.io/gateway-api/applyconfiguration/internal" ) // 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.io, Version=v1 + // Group=gateway.networking.k8s-x.io, Version=v1alpha1 + case v1alpha1.SchemeGroupVersion.WithKind("ListenerEntry"): + return &apisxv1alpha1.ListenerEntryApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("ListenerEntryStatus"): + return &apisxv1alpha1.ListenerEntryStatusApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("ListenerSet"): + return &apisxv1alpha1.ListenerSetApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("ListenerSetSpec"): + return &apisxv1alpha1.ListenerSetSpecApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("ListenerSetStatus"): + return &apisxv1alpha1.ListenerSetStatusApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("ParentGatewayReference"): + return &apisxv1alpha1.ParentGatewayReferenceApplyConfiguration{} + + // Group=gateway.networking.k8s.io, Version=v1 + case v1.SchemeGroupVersion.WithKind("AllowedListeners"): + return &apisv1.AllowedListenersApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("AllowedRoutes"): return &apisv1.AllowedRoutesApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("BackendObjectReference"): @@ -130,6 +148,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &apisv1.HTTPURLRewriteFilterApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("Listener"): return &apisv1.ListenerApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ListenerNamespaces"): + return &apisv1.ListenerNamespacesApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("ListenerStatus"): return &apisv1.ListenerStatusApplyConfiguration{} case v1.SchemeGroupVersion.WithKind("LocalObjectReference"): diff --git a/cmd/modelschema/main.go b/cmd/modelschema/main.go index a04294ace5..ebfbb7c1a2 100644 --- a/cmd/modelschema/main.go +++ b/cmd/modelschema/main.go @@ -24,7 +24,7 @@ import ( "os" "strings" - stable "sigs.k8s.io/gateway-api/apis/openapi" + "sigs.k8s.io/gateway-api/pkg/generated/openapi" "k8s.io/kube-openapi/pkg/common" "k8s.io/kube-openapi/pkg/validation/spec" @@ -43,7 +43,8 @@ func output() error { refFunc := func(name string) spec.Ref { return spec.MustCreateRef(fmt.Sprintf("#/definitions/%s", friendlyName(name))) } - defs := stable.GetOpenAPIDefinitions(refFunc) + defs := openapi.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/config/crd/experimental/gateway.networking.k8s-x.io_listenersets.yaml b/config/crd/experimental/gateway.networking.k8s-x.io_listenersets.yaml new file mode 100644 index 0000000000..2c6f6ecb5c --- /dev/null +++ b/config/crd/experimental/gateway.networking.k8s-x.io_listenersets.yaml @@ -0,0 +1,825 @@ +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: listenersets.gateway.networking.k8s-x.io +spec: + group: gateway.networking.k8s-x.io + names: + categories: + - gateway-api + kind: ListenerSet + listKind: ListenerSetList + plural: listenersets + shortNames: + - lset + singular: listenerset + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=="Accepted")].status + name: Accepted + type: string + - jsonPath: .status.conditions[?(@.type=="Programmed")].status + name: Programmed + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + ListenerSet defines a set of additional listeners + to attach to an existing Gateway. + 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 ListenerSet. + properties: + listeners: + description: |- + Listeners associated with this ListenerSet. Listeners define + logical endpoints that are bound on this referenced parent Gateway's addresses. + + Listeners in a `Gateway` and their attached `ListenerSets` are concatenated + as a list when programming the underlying infrastructure. + + Listeners should be merged using the following precedence: + + 1. "parent" Gateway + 2. ListenerSet ordered by creation time (oldest first) + 3. ListenerSet ordered alphabetically by “{namespace}/{name}”. + items: + properties: + allowedRoutes: + default: + namespaces: + from: Same + 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. + + Although 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: + + * The most specific match as defined by the Route type. + * The oldest Route based on creation timestamp. For example, a Route with + a creation timestamp of "2020-09-08 01:02:03" is given precedence over + a Route with a creation timestamp of "2020-09-08 01:02:04". + * If everything else is equivalent, the Route appearing first in + alphabetical order (namespace/name) should be given precedence. For + example, foo/bar is given precedence over foo/baz. + + All 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. + + Support: Core + properties: + kinds: + 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. + + A 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. + + Support: Core + items: + description: RouteGroupKind indicates the group and kind + of a Route resource. + properties: + group: + default: gateway.networking.k8s.io + description: Group is the group of the Route. + 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 the kind of the Route. + maxLength: 63 + minLength: 1 + pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$ + type: string + required: + - kind + type: object + maxItems: 8 + type: array + namespaces: + default: + from: Same + description: |- + Namespaces indicates namespaces from which Routes may be attached to this + Listener. This is restricted to the namespace of this Gateway by default. + + Support: Core + properties: + from: + default: Same + description: |- + From indicates where Routes will be selected for this Gateway. Possible + values are: + + * All: Routes in all namespaces may be used by this Gateway. + * Selector: Routes in namespaces selected by the selector may be used by + this Gateway. + * Same: Only Routes in the same namespace may be used by this Gateway. + + Support: Core + enum: + - All + - Selector + - Same + - None + type: string + selector: + 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". + + Support: Core + properties: + matchExpressions: + description: matchExpressions is a list of label + selector requirements. The requirements are ANDed. + items: + description: |- + A label selector requirement is a selector that contains values, a key, and an operator that + relates the key and values. + properties: + key: + description: key is the label key that the + selector applies to. + type: string + operator: + description: |- + operator represents a key's relationship to a set of values. + Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + 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. + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + 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: object + type: object + x-kubernetes-map-type: atomic + type: object + type: object + hostname: + 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. + + Implementations MUST apply Hostname matching appropriately for each of + the following protocols: + + * 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 + protocol layers as described above. If an implementation does not + ensure that both the SNI and Host header match the Listener hostname, + it MUST clearly document that. + + For 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. + + Hostnames 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`. + + 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 + name: + description: |- + Name is the name of the Listener. This name MUST be unique within a + 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 + port: + description: |- + Port is the network port. Multiple listeners may use the + same port, subject to the Listener compatibility rules. + + Support: Core + format: int32 + maximum: 65535 + minimum: 1 + type: integer + protocol: + description: |- + Protocol specifies the network protocol this listener expects to receive. + + Support: Core + maxLength: 255 + minLength: 1 + pattern: ^[a-zA-Z0-9]([-a-zA-Z0-9]*[a-zA-Z0-9])?$|[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9]+$ + type: string + tls: + 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". + + The association of SNIs to Certificate defined in GatewayTLSConfig is + defined based on the Hostname field for this listener. + + The GatewayClass MUST use the longest matching SNI out of all + available certificates for any TLS handshake. + + Support: Core + properties: + certificateRefs: + 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. + + A 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. + + References 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. + + This field is required to have at least one element when the mode is set + to "Terminate" (default) and is optional otherwise. + + CertificateRefs can reference to standard Kubernetes resources, i.e. + Secret, or implementation-specific custom resources. + + Support: Core - A single reference to a Kubernetes Secret of type kubernetes.io/tls + + Support: Implementation-specific (More than one reference or other resource types) + items: + description: |- + SecretObjectReference identifies an API object including its namespace, + defaulting to Secret. + + 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. + + References 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. + properties: + group: + default: "" + description: |- + Group is the group of the referent. For example, "gateway.networking.k8s.io". + When unspecified or empty string, core API group is inferred. + 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: Secret + description: Kind is kind of the referent. For example + "Secret". + 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. + maxLength: 253 + minLength: 1 + type: string + namespace: + description: |- + Namespace is the namespace of the referenced object. When unspecified, the local + namespace is inferred. + + Note 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. + + Support: Core + maxLength: 63 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + required: + - name + type: object + maxItems: 64 + type: array + frontendValidation: + 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. + + Support: Extended + properties: + caCertificateRefs: + 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. + + A 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. + + Support: Core - A single reference to a Kubernetes ConfigMap + with the CA certificate in a key named `ca.crt`. + + Support: Implementation-specific (More than one reference, or other kinds + of resources). + + References 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. + items: + description: |- + ObjectReference identifies an API object including its namespace. + + 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. + + References 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. + properties: + group: + 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. + 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 referent. For + example "ConfigMap" or "Service". + 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. + maxLength: 253 + minLength: 1 + type: string + namespace: + description: |- + Namespace is the namespace of the referenced object. When unspecified, the local + namespace is inferred. + + Note 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. + + Support: Core + maxLength: 63 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + required: + - group + - kind + - name + type: object + maxItems: 8 + minItems: 1 + type: array + type: object + mode: + default: Terminate + description: |- + Mode defines the TLS behavior for the TLS session initiated by the client. + There are two possible modes: + + - Terminate: The TLS session between the downstream client and the + Gateway is terminated at the Gateway. This mode requires certificates + to be specified in some way, such as populating the certificateRefs + field. + - Passthrough: The TLS session is NOT terminated by the Gateway. This + implies that the Gateway can't decipher the TLS stream except for + the ClientHello message of the TLS protocol. The certificateRefs field + is ignored in this mode. + + Support: Core + enum: + - Terminate + - Passthrough + type: string + options: + additionalProperties: + description: |- + AnnotationValue is the value of an annotation in Gateway API. This is used + for validation of maps such as TLS options. This roughly matches Kubernetes + annotation validation, although the length validation in that case is based + on the entire size of the annotations struct. + maxLength: 4096 + minLength: 0 + type: string + 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. + + A 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. + + Support: Implementation-specific + maxProperties: 16 + type: object + type: object + x-kubernetes-validations: + - message: certificateRefs or options must be specified when + mode is Terminate + rule: 'self.mode == ''Terminate'' ? size(self.certificateRefs) + > 0 || size(self.options) > 0 : true' + required: + - name + - protocol + type: object + maxItems: 64 + minItems: 1 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + x-kubernetes-validations: + - message: tls must not be specified for protocols ['HTTP', 'TCP', + 'UDP'] + rule: 'self.all(l, l.protocol in [''HTTP'', ''TCP'', ''UDP''] ? + !has(l.tls) : true)' + - message: tls mode must be Terminate for protocol HTTPS + rule: 'self.all(l, (l.protocol == ''HTTPS'' && has(l.tls)) ? (l.tls.mode + == '''' || l.tls.mode == ''Terminate'') : true)' + - message: hostname must not be specified for protocols ['TCP', 'UDP'] + rule: 'self.all(l, l.protocol in [''TCP'', ''UDP''] ? (!has(l.hostname) + || l.hostname == '''') : true)' + - message: Listener name must be unique within the Gateway + rule: self.all(l1, self.exists_one(l2, l1.name == l2.name)) + - message: Combination of port, protocol and hostname must be unique + for each listener + rule: 'self.all(l1, !has(l1.port) || self.exists_one(l2, has(l2.port) + && l1.port == l2.port && l1.protocol == l2.protocol && (has(l1.hostname) + && has(l2.hostname) ? l1.hostname == l2.hostname : !has(l1.hostname) + && !has(l2.hostname))))' + parentRef: + description: ParentRef references the Gateway that the listeners are + attached to. + properties: + group: + default: gateway.networking.k8s.io + description: Group is the group of the referent. + 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. For example "Gateway". + 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. + maxLength: 253 + minLength: 1 + type: string + required: + - name + type: object + required: + - listeners + type: object + status: + default: + conditions: + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: Waiting for controller + reason: Pending + status: Unknown + type: Accepted + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: Waiting for controller + reason: Pending + status: Unknown + type: Programmed + description: Status defines the current state of ListenerSet. + properties: + conditions: + default: + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: Waiting for controller + reason: Pending + status: Unknown + type: Accepted + - lastTransitionTime: "1970-01-01T00:00:00Z" + message: Waiting for controller + reason: Pending + status: Unknown + type: Programmed + description: |- + Conditions describe the current conditions of the ListenerSet. + + Implementations should prefer to express ListenerSet conditions + using the `ListenerSetConditionType` and `ListenerSetConditionReason` + constants so that operators and tools can converge on a common + vocabulary to describe ListenerSet state. + + Known condition types are: + + * "Accepted" + * "Programmed" + 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 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + listeners: + description: Listeners provide status for each unique listener port + defined in the Spec. + items: + description: ListenerStatus is the status associated with a Listener. + properties: + attachedRoutes: + description: |- + AttachedRoutes represents the total number of Routes that have been + successfully attached to this Listener. + + Successful 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. + + Uses for this field include troubleshooting Route attachment and + measuring blast radius/impact of changes to a Listener. + format: int32 + type: integer + conditions: + description: Conditions describe the current condition of this + listener. + 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 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + name: + description: Name is the name of the Listener that this status + corresponds to. + 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 + port: + description: Port is the network port the listener is configured + to listen on. + format: int32 + maximum: 65535 + minimum: 1 + type: integer + supportedKinds: + description: |- + SupportedKinds is the list indicating the Kinds supported by this + listener. This MUST represent the kinds an implementation supports for + that Listener configuration. + + If 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. + items: + description: RouteGroupKind indicates the group and kind of + a Route resource. + properties: + group: + default: gateway.networking.k8s.io + description: Group is the group of the Route. + 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 the kind of the Route. + maxLength: 63 + minLength: 1 + pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$ + type: string + required: + - kind + type: object + maxItems: 8 + type: array + required: + - attachedRoutes + - conditions + - name + - port + - supportedKinds + type: object + maxItems: 64 + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: null + storedVersions: null diff --git a/config/crd/experimental/gateway.networking.k8s.io_gateways.yaml b/config/crd/experimental/gateway.networking.k8s.io_gateways.yaml index 4e4b07f9b0..11b0b94a70 100644 --- a/config/crd/experimental/gateway.networking.k8s.io_gateways.yaml +++ b/config/crd/experimental/gateway.networking.k8s.io_gateways.yaml @@ -133,6 +133,44 @@ spec: - message: Hostname values must be unique rule: 'self.all(a1, a1.type == ''Hostname'' ? self.exists_one(a2, a2.type == a1.type && a2.value == a1.value) : true )' + allowedListeners: + description: |- + AllowedListeners defines which ListenerSets can be attached to this Gateway. + While this feature is experimental, the default value is to allow no ListenerSets. + items: + description: AllowedListeners defines which ListenerSets can be + attached to this Gateway. + properties: + namespaces: + default: + from: None + 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. + properties: + from: + allOf: + - enum: + - All + - Selector + - Same + - None + - enum: + - Same + - None + default: None + description: |- + From indicates where ListenerSets can attach to this Gateway. Possible + values are: + + * Same: Only ListenerSets in the same namespace may be attached to this Gateway. + * None: Only listeners defined in the Gateway's spec are allowed + + While this feature is experimental, the default value None + type: string + type: object + type: object + type: array backendTLS: description: |- BackendTLS configures TLS settings for when this Gateway is connecting to @@ -575,6 +613,7 @@ spec: - All - Selector - Same + - None type: string selector: description: |- @@ -1367,6 +1406,44 @@ spec: - message: Hostname values must be unique rule: 'self.all(a1, a1.type == ''Hostname'' ? self.exists_one(a2, a2.type == a1.type && a2.value == a1.value) : true )' + allowedListeners: + description: |- + AllowedListeners defines which ListenerSets can be attached to this Gateway. + While this feature is experimental, the default value is to allow no ListenerSets. + items: + description: AllowedListeners defines which ListenerSets can be + attached to this Gateway. + properties: + namespaces: + default: + from: None + 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. + properties: + from: + allOf: + - enum: + - All + - Selector + - Same + - None + - enum: + - Same + - None + default: None + description: |- + From indicates where ListenerSets can attach to this Gateway. Possible + values are: + + * Same: Only ListenerSets in the same namespace may be attached to this Gateway. + * None: Only listeners defined in the Gateway's spec are allowed + + While this feature is experimental, the default value None + type: string + type: object + type: object + type: array backendTLS: description: |- BackendTLS configures TLS settings for when this Gateway is connecting to @@ -1809,6 +1886,7 @@ spec: - All - Selector - Same + - None type: string selector: description: |- diff --git a/config/crd/standard/gateway.networking.k8s.io_gateways.yaml b/config/crd/standard/gateway.networking.k8s.io_gateways.yaml index 36a4504c0f..a659acabb7 100644 --- a/config/crd/standard/gateway.networking.k8s.io_gateways.yaml +++ b/config/crd/standard/gateway.networking.k8s.io_gateways.yaml @@ -511,6 +511,7 @@ spec: - All - Selector - Same + - None type: string selector: description: |- @@ -1594,6 +1595,7 @@ spec: - All - Selector - Same + - None type: string selector: description: |- diff --git a/geps/gep-1713/index.md b/geps/gep-1713/index.md index 2d3f91aba0..31fa38e4ca 100644 --- a/geps/gep-1713/index.md +++ b/geps/gep-1713/index.md @@ -74,7 +74,7 @@ type ListenerNamespaces struct { // * None: Only listeners defined in the Gateway's spec are allowed // // +optional - // +kubebuilder:default=Same + // +kubebuilder:default=None // +kubebuilder:validation:Enum=Same;None From *FromNamespaces `json:"from,omitempty"` } @@ -527,14 +527,14 @@ Valid reasons for `Accepted` being `False` are: - `NotAllowed` - the `parentRef` doesn't allow attachment - `ParentNotAccepted` - the `parentRef` isn't accepted (eg. invalid address) -- `UnsupportedValue` - a listener in the set is using an unsupported feature/value +- `ListenersNotValid` - one or more listeners in the set are invalid (or using an unsupported feature) The `Programmed` condition MUST be set on every `ListenerSet` and have a similar meaning to the Gateway `Programmed` condition but only reflect the listeners in this `ListenerSet`. -`Accepted` and `Programmed` conditions when surfacing details about listeners, MUST only summarize the `status.parents.listeners` conditions that are exclusive to the `ListenerSet`. +`Accepted` and `Programmed` conditions when surfacing details about listeners, MUST only summarize the `status.listeners` conditions that are exclusive to the `ListenerSet`. An exception to this is when the parent `Gateway`'s `Accepted` or `Programmed` conditions transition to `False` -`ListenerSets` MUST NOT have their parent `Gateway`'s' listeners in the associated `status.parents.listeners` conditions list. +`ListenerSets` MUST NOT have their parent `Gateway`'s' listeners in the associated `status.listeners` conditions list. ### ListenerConditions within a ListenerSet diff --git a/hack/update-clientset.sh b/hack/update-clientset.sh index ec3ecceefc..34f97082f0 100755 --- a/hack/update-clientset.sh +++ b/hack/update-clientset.sh @@ -24,12 +24,6 @@ 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 @@ -42,22 +36,19 @@ readonly COMMON_FLAGS="${VERIFY_FLAG:-} --go-header-file ${SCRIPT_ROOT}/hack/boi 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 +readonly OUTPUT_DIR=pkg/client +readonly OUTPUT_PKG=sigs.k8s.io/gateway-api/pkg/client +readonly API_PATHS=(apis apisx) 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}," + +for API_PATH in "${API_PATHS[@]}"; do + VERSIONS=($(find ./${API_PATH} -maxdepth 1 -name "v*" -exec bash -c 'basename {}' \; | xargs)) + for VERSION in "${VERSIONS[@]}"; do + GATEWAY_INPUT_DIRS_SPACE+="${APIS_PKG}/${API_PATH}/${VERSION} " + GATEWAY_INPUT_DIRS_COMMA+="${APIS_PKG}/${API_PATH}/${VERSION}," + done done GATEWAY_INPUT_DIRS_SPACE="${GATEWAY_INPUT_DIRS_SPACE%,}" # drop trailing space GATEWAY_INPUT_DIRS_COMMA="${GATEWAY_INPUT_DIRS_COMMA%,}" # drop trailing comma @@ -69,8 +60,8 @@ 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" \ + --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 \ @@ -81,8 +72,8 @@ go run k8s.io/kube-openapi/cmd/openapi-gen \ 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" \ + --output-dir "applyconfiguration" \ + --output-pkg "${APIS_PKG}/applyconfiguration" \ ${COMMON_FLAGS} \ ${GATEWAY_INPUT_DIRS_SPACE} @@ -93,7 +84,7 @@ go run k8s.io/code-generator/cmd/client-gen \ --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" \ + --apply-configuration-package "${APIS_PKG}/applyconfiguration" \ ${COMMON_FLAGS} echo "Generating listers at ${OUTPUT_PKG}/listers" @@ -103,7 +94,7 @@ go run k8s.io/code-generator/cmd/lister-gen \ ${COMMON_FLAGS} \ ${GATEWAY_INPUT_DIRS_SPACE} -echo "Generating informers at ${OUTPUT_PKG}/informers" +echo "Generating 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" \ @@ -112,16 +103,14 @@ go run k8s.io/code-generator/cmd/informer-gen \ ${COMMON_FLAGS} \ ${GATEWAY_INPUT_DIRS_SPACE} -echo "Generating ${VERSION} register at ${APIS_PKG}/${API_PATH}/${VERSION}" +echo "Generating register helpers" 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 +echo "Generating deepcopy" +go run sigs.k8s.io/controller-tools/cmd/controller-gen \ + object:headerFile=${SCRIPT_ROOT}/hack/boilerplate/boilerplate.generatego.txt \ + paths="./apis/..." \ + paths="./apisx/..." diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 921bc154f5..23862dbbfb 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -49,5 +49,5 @@ ln -s "${SCRIPT_ROOT}" "$GOPATH/src/sigs.k8s.io/gateway-api" echo "Generating CRDs" go run ./pkg/generator -./hack/update-clientset.sh +./hack/update-clientset.sh ./hack/update-protos.sh diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index ef9ef2376f..c65cf8f516 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -29,6 +29,7 @@ import ( gatewayv1alpha2 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha2" 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" ) type Interface interface { @@ -37,15 +38,17 @@ type Interface interface { GatewayV1alpha2() gatewayv1alpha2.GatewayV1alpha2Interface GatewayV1alpha3() gatewayv1alpha3.GatewayV1alpha3Interface GatewayV1beta1() gatewayv1beta1.GatewayV1beta1Interface + ExperimentalV1alpha1() experimentalv1alpha1.ExperimentalV1alpha1Interface } // 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 + gatewayV1alpha2 *gatewayv1alpha2.GatewayV1alpha2Client + gatewayV1alpha3 *gatewayv1alpha3.GatewayV1alpha3Client + gatewayV1beta1 *gatewayv1beta1.GatewayV1beta1Client + experimentalV1alpha1 *experimentalv1alpha1.ExperimentalV1alpha1Client } // GatewayV1 retrieves the GatewayV1Client @@ -68,6 +71,11 @@ func (c *Clientset) GatewayV1beta1() gatewayv1beta1.GatewayV1beta1Interface { return c.gatewayV1beta1 } +// ExperimentalV1alpha1 retrieves the ExperimentalV1alpha1Client +func (c *Clientset) ExperimentalV1alpha1() experimentalv1alpha1.ExperimentalV1alpha1Interface { + return c.experimentalV1alpha1 +} + // Discovery retrieves the DiscoveryClient func (c *Clientset) Discovery() discovery.DiscoveryInterface { if c == nil { @@ -128,6 +136,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } + cs.experimentalV1alpha1, err = experimentalv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) if err != nil { @@ -153,6 +165,7 @@ func New(c rest.Interface) *Clientset { cs.gatewayV1alpha2 = gatewayv1alpha2.New(c) cs.gatewayV1alpha3 = gatewayv1alpha3.New(c) cs.gatewayV1beta1 = gatewayv1beta1.New(c) + cs.experimentalV1alpha1 = experimentalv1alpha1.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 7cc8169913..ecf37e8b51 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -24,7 +24,7 @@ import ( "k8s.io/client-go/discovery" fakediscovery "k8s.io/client-go/discovery/fake" "k8s.io/client-go/testing" - applyconfiguration "sigs.k8s.io/gateway-api/apis/applyconfiguration" + applyconfiguration "sigs.k8s.io/gateway-api/applyconfiguration" clientset "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned" gatewayv1 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1" fakegatewayv1 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1/fake" @@ -34,6 +34,8 @@ import ( fakegatewayv1alpha3 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1alpha3/fake" gatewayv1beta1 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apis/v1beta1" 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" ) // NewSimpleClientset returns a clientset that will respond with the provided objects. @@ -141,3 +143,8 @@ func (c *Clientset) GatewayV1alpha3() gatewayv1alpha3.GatewayV1alpha3Interface { func (c *Clientset) GatewayV1beta1() gatewayv1beta1.GatewayV1beta1Interface { return &fakegatewayv1beta1.FakeGatewayV1beta1{Fake: &c.Fake} } + +// ExperimentalV1alpha1 retrieves the ExperimentalV1alpha1Client +func (c *Clientset) ExperimentalV1alpha1() experimentalv1alpha1.ExperimentalV1alpha1Interface { + return &fakeexperimentalv1alpha1.FakeExperimentalV1alpha1{Fake: &c.Fake} +} diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index 70e71314d6..4a4e3f846e 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -28,6 +28,7 @@ import ( gatewayv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" gatewayv1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" + experimentalv1alpha1 "sigs.k8s.io/gateway-api/apisx/v1alpha1" ) var scheme = runtime.NewScheme() @@ -38,6 +39,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ gatewayv1alpha2.AddToScheme, gatewayv1alpha3.AddToScheme, gatewayv1beta1.AddToScheme, + experimentalv1alpha1.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 715fcc4caa..673060f9d9 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -28,6 +28,7 @@ import ( gatewayv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" gatewayv1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" + experimentalv1alpha1 "sigs.k8s.io/gateway-api/apisx/v1alpha1" ) var Scheme = runtime.NewScheme() @@ -38,6 +39,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ gatewayv1alpha2.AddToScheme, gatewayv1alpha3.AddToScheme, gatewayv1beta1.AddToScheme, + experimentalv1alpha1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_gateway.go b/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_gateway.go index 38b4ec9ca9..7c85aa8ede 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_gateway.go +++ b/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_gateway.go @@ -28,8 +28,8 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" v1 "sigs.k8s.io/gateway-api/apis/v1" + apisv1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" ) // FakeGateways implements GatewayInterface diff --git a/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_gatewayclass.go b/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_gatewayclass.go index 4cec1cac6f..02e9b84773 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_gatewayclass.go +++ b/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_gatewayclass.go @@ -28,8 +28,8 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" v1 "sigs.k8s.io/gateway-api/apis/v1" + apisv1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" ) // FakeGatewayClasses implements GatewayClassInterface diff --git a/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_grpcroute.go b/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_grpcroute.go index e4992e422b..bda7bc36e4 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_grpcroute.go +++ b/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_grpcroute.go @@ -28,8 +28,8 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" v1 "sigs.k8s.io/gateway-api/apis/v1" + apisv1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" ) // FakeGRPCRoutes implements GRPCRouteInterface diff --git a/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_httproute.go b/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_httproute.go index 2673628ea3..468b1e2dc3 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_httproute.go +++ b/pkg/client/clientset/versioned/typed/apis/v1/fake/fake_httproute.go @@ -28,8 +28,8 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" v1 "sigs.k8s.io/gateway-api/apis/v1" + apisv1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" ) // FakeHTTPRoutes implements HTTPRouteInterface diff --git a/pkg/client/clientset/versioned/typed/apis/v1/gateway.go b/pkg/client/clientset/versioned/typed/apis/v1/gateway.go index 0e7d9372a5..44e612b65a 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1/gateway.go +++ b/pkg/client/clientset/versioned/typed/apis/v1/gateway.go @@ -25,8 +25,8 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" - apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" v1 "sigs.k8s.io/gateway-api/apis/v1" + apisv1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) diff --git a/pkg/client/clientset/versioned/typed/apis/v1/gatewayclass.go b/pkg/client/clientset/versioned/typed/apis/v1/gatewayclass.go index 2f764f147d..7f68e5f038 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1/gatewayclass.go +++ b/pkg/client/clientset/versioned/typed/apis/v1/gatewayclass.go @@ -25,8 +25,8 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" - apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" v1 "sigs.k8s.io/gateway-api/apis/v1" + apisv1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) diff --git a/pkg/client/clientset/versioned/typed/apis/v1/grpcroute.go b/pkg/client/clientset/versioned/typed/apis/v1/grpcroute.go index 55748a1d29..37d7406dc4 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1/grpcroute.go +++ b/pkg/client/clientset/versioned/typed/apis/v1/grpcroute.go @@ -25,8 +25,8 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" - apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" v1 "sigs.k8s.io/gateway-api/apis/v1" + apisv1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) diff --git a/pkg/client/clientset/versioned/typed/apis/v1/httproute.go b/pkg/client/clientset/versioned/typed/apis/v1/httproute.go index 29f4fe9c6b..d62867faba 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1/httproute.go +++ b/pkg/client/clientset/versioned/typed/apis/v1/httproute.go @@ -25,8 +25,8 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" - apisv1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1" v1 "sigs.k8s.io/gateway-api/apis/v1" + apisv1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha2/backendlbpolicy.go b/pkg/client/clientset/versioned/typed/apis/v1alpha2/backendlbpolicy.go index 0429945002..6fde1bb8f6 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha2/backendlbpolicy.go +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha2/backendlbpolicy.go @@ -25,8 +25,8 @@ import ( 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" + apisv1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha2" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_backendlbpolicy.go b/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_backendlbpolicy.go index 9053eac042..c95451a62e 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_backendlbpolicy.go +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_backendlbpolicy.go @@ -28,8 +28,8 @@ import ( 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" + apisv1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha2" ) // FakeBackendLBPolicies implements BackendLBPolicyInterface diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_grpcroute.go b/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_grpcroute.go index 82ea2b8db7..dbe6013e73 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_grpcroute.go +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_grpcroute.go @@ -28,8 +28,8 @@ import ( 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" + apisv1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha2" ) // FakeGRPCRoutes implements GRPCRouteInterface diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_referencegrant.go b/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_referencegrant.go index 31b65d3a5b..4268d0b074 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_referencegrant.go +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_referencegrant.go @@ -28,8 +28,8 @@ import ( 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" + apisv1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha2" ) // FakeReferenceGrants implements ReferenceGrantInterface diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_tcproute.go b/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_tcproute.go index 32b88e16c3..bb90b445ca 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_tcproute.go +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_tcproute.go @@ -28,8 +28,8 @@ import ( 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" + apisv1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha2" ) // FakeTCPRoutes implements TCPRouteInterface diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_tlsroute.go b/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_tlsroute.go index ba8255216f..360a9ae175 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_tlsroute.go +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_tlsroute.go @@ -28,8 +28,8 @@ import ( 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" + apisv1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha2" ) // FakeTLSRoutes implements TLSRouteInterface diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_udproute.go b/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_udproute.go index 54a5b4d725..2defe25c8a 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_udproute.go +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha2/fake/fake_udproute.go @@ -28,8 +28,8 @@ import ( 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" + apisv1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha2" ) // FakeUDPRoutes implements UDPRouteInterface diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha2/grpcroute.go b/pkg/client/clientset/versioned/typed/apis/v1alpha2/grpcroute.go index 75752337e9..aa10accc48 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha2/grpcroute.go +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha2/grpcroute.go @@ -25,8 +25,8 @@ import ( 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" + apisv1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha2" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha2/referencegrant.go b/pkg/client/clientset/versioned/typed/apis/v1alpha2/referencegrant.go index bbe6f8790e..d0154afd8f 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha2/referencegrant.go +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha2/referencegrant.go @@ -25,8 +25,8 @@ import ( 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" + apisv1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha2" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha2/tcproute.go b/pkg/client/clientset/versioned/typed/apis/v1alpha2/tcproute.go index 9a9959cf7c..b46cc0c5d2 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha2/tcproute.go +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha2/tcproute.go @@ -25,8 +25,8 @@ import ( 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" + apisv1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha2" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha2/tlsroute.go b/pkg/client/clientset/versioned/typed/apis/v1alpha2/tlsroute.go index d98da0fbab..e73625bbcb 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha2/tlsroute.go +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha2/tlsroute.go @@ -25,8 +25,8 @@ import ( 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" + apisv1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha2" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha2/udproute.go b/pkg/client/clientset/versioned/typed/apis/v1alpha2/udproute.go index 820bed9f31..128a861c29 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha2/udproute.go +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha2/udproute.go @@ -25,8 +25,8 @@ import ( 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" + apisv1alpha2 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha2" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha3/backendtlspolicy.go b/pkg/client/clientset/versioned/typed/apis/v1alpha3/backendtlspolicy.go index 3edd7e6279..3cb0b1285f 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha3/backendtlspolicy.go +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha3/backendtlspolicy.go @@ -25,8 +25,8 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" - apisv1alpha3 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3" v1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" + apisv1alpha3 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha3" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) diff --git a/pkg/client/clientset/versioned/typed/apis/v1alpha3/fake/fake_backendtlspolicy.go b/pkg/client/clientset/versioned/typed/apis/v1alpha3/fake/fake_backendtlspolicy.go index 042a931aea..fbddc3173f 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1alpha3/fake/fake_backendtlspolicy.go +++ b/pkg/client/clientset/versioned/typed/apis/v1alpha3/fake/fake_backendtlspolicy.go @@ -28,8 +28,8 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - apisv1alpha3 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1alpha3" v1alpha3 "sigs.k8s.io/gateway-api/apis/v1alpha3" + apisv1alpha3 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1alpha3" ) // FakeBackendTLSPolicies implements BackendTLSPolicyInterface diff --git a/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_gateway.go b/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_gateway.go index 757c95f11b..2f309e4d9a 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_gateway.go +++ b/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_gateway.go @@ -28,8 +28,8 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - apisv1beta1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" + apisv1beta1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1beta1" ) // FakeGateways implements GatewayInterface diff --git a/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_gatewayclass.go b/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_gatewayclass.go index 0260974731..d18395c20b 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_gatewayclass.go +++ b/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_gatewayclass.go @@ -28,8 +28,8 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - apisv1beta1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" + apisv1beta1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1beta1" ) // FakeGatewayClasses implements GatewayClassInterface diff --git a/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_httproute.go b/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_httproute.go index 75b4b7107b..6ec049f836 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_httproute.go +++ b/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_httproute.go @@ -28,8 +28,8 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - apisv1beta1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" + apisv1beta1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1beta1" ) // FakeHTTPRoutes implements HTTPRouteInterface diff --git a/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_referencegrant.go b/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_referencegrant.go index 2f5daecf86..610c6a968e 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_referencegrant.go +++ b/pkg/client/clientset/versioned/typed/apis/v1beta1/fake/fake_referencegrant.go @@ -28,8 +28,8 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - apisv1beta1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" + apisv1beta1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1beta1" ) // FakeReferenceGrants implements ReferenceGrantInterface diff --git a/pkg/client/clientset/versioned/typed/apis/v1beta1/gateway.go b/pkg/client/clientset/versioned/typed/apis/v1beta1/gateway.go index 6ed67c9955..5a78411627 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1beta1/gateway.go +++ b/pkg/client/clientset/versioned/typed/apis/v1beta1/gateway.go @@ -25,8 +25,8 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" - apisv1beta1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" + apisv1beta1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1beta1" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) diff --git a/pkg/client/clientset/versioned/typed/apis/v1beta1/gatewayclass.go b/pkg/client/clientset/versioned/typed/apis/v1beta1/gatewayclass.go index f54b1e49be..d9b14b0371 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1beta1/gatewayclass.go +++ b/pkg/client/clientset/versioned/typed/apis/v1beta1/gatewayclass.go @@ -25,8 +25,8 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" - apisv1beta1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" + apisv1beta1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1beta1" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) diff --git a/pkg/client/clientset/versioned/typed/apis/v1beta1/httproute.go b/pkg/client/clientset/versioned/typed/apis/v1beta1/httproute.go index 884a3d6108..9123a629e0 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1beta1/httproute.go +++ b/pkg/client/clientset/versioned/typed/apis/v1beta1/httproute.go @@ -25,8 +25,8 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" - apisv1beta1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" + apisv1beta1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1beta1" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) diff --git a/pkg/client/clientset/versioned/typed/apis/v1beta1/referencegrant.go b/pkg/client/clientset/versioned/typed/apis/v1beta1/referencegrant.go index 992727e305..8ea52fad06 100644 --- a/pkg/client/clientset/versioned/typed/apis/v1beta1/referencegrant.go +++ b/pkg/client/clientset/versioned/typed/apis/v1beta1/referencegrant.go @@ -25,8 +25,8 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" - apisv1beta1 "sigs.k8s.io/gateway-api/apis/applyconfiguration/apis/v1beta1" v1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1" + apisv1beta1 "sigs.k8s.io/gateway-api/applyconfiguration/apis/v1beta1" scheme "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" ) diff --git a/pkg/client/clientset/versioned/typed/apisx/v1alpha1/apisx_client.go b/pkg/client/clientset/versioned/typed/apisx/v1alpha1/apisx_client.go new file mode 100644 index 0000000000..10d44f80b9 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/apisx/v1alpha1/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 v1alpha1 + +import ( + "net/http" + + rest "k8s.io/client-go/rest" + v1alpha1 "sigs.k8s.io/gateway-api/apisx/v1alpha1" + "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/scheme" +) + +type ExperimentalV1alpha1Interface interface { + RESTClient() rest.Interface + ListenerSetsGetter +} + +// ExperimentalV1alpha1Client is used to interact with features provided by the gateway.networking.k8s-x.io group. +type ExperimentalV1alpha1Client struct { + restClient rest.Interface +} + +func (c *ExperimentalV1alpha1Client) ListenerSets(namespace string) ListenerSetInterface { + return newListenerSets(c, namespace) +} + +// NewForConfig creates a new ExperimentalV1alpha1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*ExperimentalV1alpha1Client, 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 ExperimentalV1alpha1Client 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) (*ExperimentalV1alpha1Client, 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 &ExperimentalV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new ExperimentalV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *ExperimentalV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new ExperimentalV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *ExperimentalV1alpha1Client { + return &ExperimentalV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha1.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 *ExperimentalV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/client/clientset/versioned/typed/apisx/v1alpha1/doc.go b/pkg/client/clientset/versioned/typed/apisx/v1alpha1/doc.go new file mode 100644 index 0000000000..df51baa4d4 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/apisx/v1alpha1/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 v1alpha1 diff --git a/pkg/client/clientset/versioned/typed/apisx/v1alpha1/fake/doc.go b/pkg/client/clientset/versioned/typed/apisx/v1alpha1/fake/doc.go new file mode 100644 index 0000000000..16f4439906 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/apisx/v1alpha1/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/client/clientset/versioned/typed/apisx/v1alpha1/fake/fake_apisx_client.go b/pkg/client/clientset/versioned/typed/apisx/v1alpha1/fake/fake_apisx_client.go new file mode 100644 index 0000000000..28f74e4041 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/apisx/v1alpha1/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" + v1alpha1 "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned/typed/apisx/v1alpha1" +) + +type FakeExperimentalV1alpha1 struct { + *testing.Fake +} + +func (c *FakeExperimentalV1alpha1) ListenerSets(namespace string) v1alpha1.ListenerSetInterface { + return &FakeListenerSets{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeExperimentalV1alpha1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/client/clientset/versioned/typed/apisx/v1alpha1/fake/fake_listenerset.go b/pkg/client/clientset/versioned/typed/apisx/v1alpha1/fake/fake_listenerset.go new file mode 100644 index 0000000000..6888d2cbd2 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/apisx/v1alpha1/fake/fake_listenerset.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" +) + +// FakeListenerSets implements ListenerSetInterface +type FakeListenerSets struct { + Fake *FakeExperimentalV1alpha1 + ns string +} + +var listenersetsResource = v1alpha1.SchemeGroupVersion.WithResource("listenersets") + +var listenersetsKind = v1alpha1.SchemeGroupVersion.WithKind("ListenerSet") + +// Get takes name of the listenerSet, and returns the corresponding listenerSet object, and an error if there is any. +func (c *FakeListenerSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ListenerSet, err error) { + emptyResult := &v1alpha1.ListenerSet{} + obj, err := c.Fake. + Invokes(testing.NewGetActionWithOptions(listenersetsResource, c.ns, name, options), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha1.ListenerSet), err +} + +// List takes label and field selectors, and returns the list of ListenerSets that match those selectors. +func (c *FakeListenerSets) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ListenerSetList, err error) { + emptyResult := &v1alpha1.ListenerSetList{} + obj, err := c.Fake. + Invokes(testing.NewListActionWithOptions(listenersetsResource, listenersetsKind, c.ns, opts), emptyResult) + + if obj == nil { + return emptyResult, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.ListenerSetList{ListMeta: obj.(*v1alpha1.ListenerSetList).ListMeta} + for _, item := range obj.(*v1alpha1.ListenerSetList).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 listenerSets. +func (c *FakeListenerSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchActionWithOptions(listenersetsResource, c.ns, opts)) + +} + +// Create takes the representation of a listenerSet and creates it. Returns the server's representation of the listenerSet, and an error, if there is any. +func (c *FakeListenerSets) Create(ctx context.Context, listenerSet *v1alpha1.ListenerSet, opts v1.CreateOptions) (result *v1alpha1.ListenerSet, err error) { + emptyResult := &v1alpha1.ListenerSet{} + obj, err := c.Fake. + Invokes(testing.NewCreateActionWithOptions(listenersetsResource, c.ns, listenerSet, opts), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha1.ListenerSet), err +} + +// Update takes the representation of a listenerSet and updates it. Returns the server's representation of the listenerSet, and an error, if there is any. +func (c *FakeListenerSets) Update(ctx context.Context, listenerSet *v1alpha1.ListenerSet, opts v1.UpdateOptions) (result *v1alpha1.ListenerSet, err error) { + emptyResult := &v1alpha1.ListenerSet{} + obj, err := c.Fake. + Invokes(testing.NewUpdateActionWithOptions(listenersetsResource, c.ns, listenerSet, opts), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha1.ListenerSet), 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 *FakeListenerSets) UpdateStatus(ctx context.Context, listenerSet *v1alpha1.ListenerSet, opts v1.UpdateOptions) (result *v1alpha1.ListenerSet, err error) { + emptyResult := &v1alpha1.ListenerSet{} + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceActionWithOptions(listenersetsResource, "status", c.ns, listenerSet, opts), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha1.ListenerSet), err +} + +// Delete takes name of the listenerSet and deletes it. Returns an error if one occurs. +func (c *FakeListenerSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(listenersetsResource, c.ns, name, opts), &v1alpha1.ListenerSet{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeListenerSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionActionWithOptions(listenersetsResource, c.ns, opts, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.ListenerSetList{}) + return err +} + +// Patch applies the patch and returns the patched listenerSet. +func (c *FakeListenerSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ListenerSet, err error) { + emptyResult := &v1alpha1.ListenerSet{} + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceActionWithOptions(listenersetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha1.ListenerSet), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied listenerSet. +func (c *FakeListenerSets) Apply(ctx context.Context, listenerSet *apisxv1alpha1.ListenerSetApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ListenerSet, err error) { + if listenerSet == nil { + return nil, fmt.Errorf("listenerSet provided to Apply must not be nil") + } + data, err := json.Marshal(listenerSet) + if err != nil { + return nil, err + } + name := listenerSet.Name + if name == nil { + return nil, fmt.Errorf("listenerSet.Name must be provided to Apply") + } + emptyResult := &v1alpha1.ListenerSet{} + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceActionWithOptions(listenersetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha1.ListenerSet), 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 *FakeListenerSets) ApplyStatus(ctx context.Context, listenerSet *apisxv1alpha1.ListenerSetApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ListenerSet, err error) { + if listenerSet == nil { + return nil, fmt.Errorf("listenerSet provided to Apply must not be nil") + } + data, err := json.Marshal(listenerSet) + if err != nil { + return nil, err + } + name := listenerSet.Name + if name == nil { + return nil, fmt.Errorf("listenerSet.Name must be provided to Apply") + } + emptyResult := &v1alpha1.ListenerSet{} + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceActionWithOptions(listenersetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha1.ListenerSet), 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 new file mode 100644 index 0000000000..f42f0ed53e --- /dev/null +++ b/pkg/client/clientset/versioned/typed/apisx/v1alpha1/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 v1alpha1 + +type ListenerSetExpansion interface{} diff --git a/pkg/client/clientset/versioned/typed/apisx/v1alpha1/listenerset.go b/pkg/client/clientset/versioned/typed/apisx/v1alpha1/listenerset.go new file mode 100644 index 0000000000..c383f147c4 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/apisx/v1alpha1/listenerset.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" +) + +// ListenerSetsGetter has a method to return a ListenerSetInterface. +// A group's client should implement this interface. +type ListenerSetsGetter interface { + ListenerSets(namespace string) ListenerSetInterface +} + +// ListenerSetInterface has methods to work with ListenerSet resources. +type ListenerSetInterface interface { + Create(ctx context.Context, listenerSet *v1alpha1.ListenerSet, opts v1.CreateOptions) (*v1alpha1.ListenerSet, error) + Update(ctx context.Context, listenerSet *v1alpha1.ListenerSet, opts v1.UpdateOptions) (*v1alpha1.ListenerSet, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, listenerSet *v1alpha1.ListenerSet, opts v1.UpdateOptions) (*v1alpha1.ListenerSet, 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.ListenerSet, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ListenerSetList, 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.ListenerSet, err error) + Apply(ctx context.Context, listenerSet *apisxv1alpha1.ListenerSetApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ListenerSet, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, listenerSet *apisxv1alpha1.ListenerSetApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ListenerSet, err error) + ListenerSetExpansion +} + +// listenerSets implements ListenerSetInterface +type listenerSets struct { + *gentype.ClientWithListAndApply[*v1alpha1.ListenerSet, *v1alpha1.ListenerSetList, *apisxv1alpha1.ListenerSetApplyConfiguration] +} + +// newListenerSets returns a ListenerSets +func newListenerSets(c *ExperimentalV1alpha1Client, namespace string) *listenerSets { + return &listenerSets{ + gentype.NewClientWithListAndApply[*v1alpha1.ListenerSet, *v1alpha1.ListenerSetList, *apisxv1alpha1.ListenerSetApplyConfiguration]( + "listenersets", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.ListenerSet { return &v1alpha1.ListenerSet{} }, + func() *v1alpha1.ListenerSetList { return &v1alpha1.ListenerSetList{} }), + } +} diff --git a/pkg/client/informers/externalversions/apisx/interface.go b/pkg/client/informers/externalversions/apisx/interface.go new file mode 100644 index 0000000000..458ec817b4 --- /dev/null +++ b/pkg/client/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 ( + v1alpha1 "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apisx/v1alpha1" + internalinterfaces "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1alpha1 provides access to shared informers for resources in V1alpha1. + V1alpha1() v1alpha1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1alpha1 returns a new v1alpha1.Interface. +func (g *group) V1alpha1() v1alpha1.Interface { + return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/pkg/client/informers/externalversions/apisx/v1alpha1/interface.go b/pkg/client/informers/externalversions/apisx/v1alpha1/interface.go new file mode 100644 index 0000000000..f5eaef9b76 --- /dev/null +++ b/pkg/client/informers/externalversions/apisx/v1alpha1/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 v1alpha1 + +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 { + // ListenerSets returns a ListenerSetInformer. + ListenerSets() ListenerSetInformer +} + +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} +} + +// 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/apisx/v1alpha1/listenerset.go b/pkg/client/informers/externalversions/apisx/v1alpha1/listenerset.go new file mode 100644 index 0000000000..38f8f0503b --- /dev/null +++ b/pkg/client/informers/externalversions/apisx/v1alpha1/listenerset.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" +) + +// ListenerSetInformer provides access to a shared informer and lister for +// ListenerSets. +type ListenerSetInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.ListenerSetLister +} + +type listenerSetInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewListenerSetInformer constructs a new informer for ListenerSet 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 NewListenerSetInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredListenerSetInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredListenerSetInformer constructs a new informer for ListenerSet 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 NewFilteredListenerSetInformer(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().ListenerSets(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExperimentalV1alpha1().ListenerSets(namespace).Watch(context.TODO(), options) + }, + }, + &apisxv1alpha1.ListenerSet{}, + resyncPeriod, + indexers, + ) +} + +func (f *listenerSetInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredListenerSetInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *listenerSetInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apisxv1alpha1.ListenerSet{}, f.defaultInformer) +} + +func (f *listenerSetInformer) Lister() v1alpha1.ListenerSetLister { + return v1alpha1.NewListenerSetLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index 0f5f0550c8..d42f4a9614 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -29,6 +29,7 @@ import ( cache "k8s.io/client-go/tools/cache" versioned "sigs.k8s.io/gateway-api/pkg/client/clientset/versioned" apis "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apis" + apisx "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/apisx" internalinterfaces "sigs.k8s.io/gateway-api/pkg/client/informers/externalversions/internalinterfaces" ) @@ -255,8 +256,13 @@ type SharedInformerFactory interface { InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer Gateway() apis.Interface + Experimental() apisx.Interface } func (f *sharedInformerFactory) Gateway() apis.Interface { return apis.New(f, f.namespace, f.tweakListOptions) } + +func (f *sharedInformerFactory) Experimental() apisx.Interface { + return apisx.New(f, f.namespace, f.tweakListOptions) +} diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index 283d2475b2..5108816e47 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -27,6 +27,7 @@ import ( 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" ) // GenericInformer is type of SharedIndexInformer which will locate and delegate to other @@ -55,7 +56,11 @@ func (f *genericInformer) Lister() cache.GenericLister { // 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.io, Version=v1 + // Group=gateway.networking.k8s-x.io, Version=v1alpha1 + case v1alpha1.SchemeGroupVersion.WithResource("listenersets"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Experimental().V1alpha1().ListenerSets().Informer()}, nil + + // Group=gateway.networking.k8s.io, Version=v1 case v1.SchemeGroupVersion.WithResource("grpcroutes"): return &genericInformer{resource: resource.GroupResource(), informer: f.Gateway().V1().GRPCRoutes().Informer()}, nil case v1.SchemeGroupVersion.WithResource("gateways"): diff --git a/pkg/client/listers/apisx/v1alpha1/expansion_generated.go b/pkg/client/listers/apisx/v1alpha1/expansion_generated.go new file mode 100644 index 0000000000..7c717d0c17 --- /dev/null +++ b/pkg/client/listers/apisx/v1alpha1/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 v1alpha1 + +// ListenerSetListerExpansion allows custom methods to be added to +// ListenerSetLister. +type ListenerSetListerExpansion interface{} + +// ListenerSetNamespaceListerExpansion allows custom methods to be added to +// ListenerSetNamespaceLister. +type ListenerSetNamespaceListerExpansion interface{} diff --git a/pkg/client/listers/apisx/v1alpha1/listenerset.go b/pkg/client/listers/apisx/v1alpha1/listenerset.go new file mode 100644 index 0000000000..ab0fdc1d1f --- /dev/null +++ b/pkg/client/listers/apisx/v1alpha1/listenerset.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" +) + +// ListenerSetLister helps list ListenerSets. +// All objects returned here must be treated as read-only. +type ListenerSetLister interface { + // List lists all ListenerSets in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.ListenerSet, err error) + // ListenerSets returns an object that can list and get ListenerSets. + ListenerSets(namespace string) ListenerSetNamespaceLister + ListenerSetListerExpansion +} + +// listenerSetLister implements the ListenerSetLister interface. +type listenerSetLister struct { + listers.ResourceIndexer[*v1alpha1.ListenerSet] +} + +// NewListenerSetLister returns a new ListenerSetLister. +func NewListenerSetLister(indexer cache.Indexer) ListenerSetLister { + return &listenerSetLister{listers.New[*v1alpha1.ListenerSet](indexer, v1alpha1.Resource("listenerset"))} +} + +// ListenerSets returns an object that can list and get ListenerSets. +func (s *listenerSetLister) ListenerSets(namespace string) ListenerSetNamespaceLister { + return listenerSetNamespaceLister{listers.NewNamespaced[*v1alpha1.ListenerSet](s.ResourceIndexer, namespace)} +} + +// ListenerSetNamespaceLister helps list and get ListenerSets. +// All objects returned here must be treated as read-only. +type ListenerSetNamespaceLister interface { + // List lists all ListenerSets in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.ListenerSet, err error) + // Get retrieves the ListenerSet from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.ListenerSet, error) + ListenerSetNamespaceListerExpansion +} + +// listenerSetNamespaceLister implements the ListenerSetNamespaceLister +// interface. +type listenerSetNamespaceLister struct { + listers.ResourceIndexer[*v1alpha1.ListenerSet] +} diff --git a/apis/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go similarity index 95% rename from apis/openapi/zz_generated.openapi.go rename to pkg/generated/openapi/zz_generated.openapi.go index 811e47ee48..88253c190e 100644 --- a/apis/openapi/zz_generated.openapi.go +++ b/pkg/generated/openapi/zz_generated.openapi.go @@ -82,6 +82,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "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), @@ -132,6 +133,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "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), @@ -189,6 +191,13 @@ 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.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), } } @@ -2781,12 +2790,32 @@ func schema_k8sio_apimachinery_pkg_version_Info(ref common.ReferenceCallback) co } } -func schema_sigsk8sio_gateway_api_apis_v1_AllowedRoutes(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_sigsk8sio_gateway_api_apis_v1_AllowedListeners(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "AllowedRoutes defines which Routes may be attached to this Listener.", + 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{ @@ -3977,12 +4006,26 @@ func schema_sigsk8sio_gateway_api_apis_v1_GatewaySpec(ref common.ReferenceCallba 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", + 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.AllowedListeners"), + }, + }, + }, + }, + }, }, Required: []string{"gatewayClassName", "listeners"}, }, }, Dependencies: []string{ - "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"}, + "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"}, } } @@ -4092,8 +4135,7 @@ func schema_sigsk8sio_gateway_api_apis_v1_GatewayTLSConfig(ref common.ReferenceC return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "GatewayTLSConfig describes a TLS configuration.", - Type: []string{"object"}, + Type: []string{"object"}, Properties: map[string]spec.Schema{ "mode": { SchemaProps: spec.SchemaProps{ @@ -5107,6 +5149,26 @@ func schema_sigsk8sio_gateway_api_apis_v1_Listener(ref common.ReferenceCallback) } } +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{ @@ -5402,8 +5464,7 @@ func schema_sigsk8sio_gateway_api_apis_v1_RouteGroupKind(ref common.ReferenceCal return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "RouteGroupKind indicates the group and kind of a Route resource.", - Type: []string{"object"}, + Type: []string{"object"}, Properties: map[string]spec.Schema{ "group": { SchemaProps: spec.SchemaProps{ @@ -7609,3 +7670,373 @@ func schema_sigsk8sio_gateway_api_apis_v1beta1_ReferenceGrantTo(ref common.Refer }, } } + +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 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 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.\n\nListeners should be merged using the following precedence:\n\n1. \"parent\" Gateway 2. ListenerSet ordered by creation time (oldest first) 3. ListenerSet ordered alphabetically by “{namespace}/{name}”.", + 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{"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 should prefer to 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/pkg/generator/main.go b/pkg/generator/main.go index d178f919d7..e73ee109ec 100644 --- a/pkg/generator/main.go +++ b/pkg/generator/main.go @@ -49,6 +49,7 @@ func main() { "sigs.k8s.io/gateway-api/apis/v1alpha2", "sigs.k8s.io/gateway-api/apis/v1beta1", "sigs.k8s.io/gateway-api/apis/v1", + "sigs.k8s.io/gateway-api/apisx/v1alpha1", ) if err != nil { log.Fatalf("failed to load package roots: %s", err)