Skip to content

Commit 51a9fc4

Browse files
committed
chore: run generators
Signed-off-by: Shane Utt <[email protected]>
1 parent 92c9171 commit 51a9fc4

File tree

15 files changed

+5161
-828
lines changed

15 files changed

+5161
-828
lines changed

gateway-api/src/apis/experimental/common.rs

Lines changed: 92 additions & 238 deletions
Large diffs are not rendered by default.

gateway-api/src/apis/experimental/gatewayclasses.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use super::common::*;
44
#[allow(unused_imports)]
55
mod prelude {
66
pub use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;
7-
pub use kube_derive::CustomResource;
7+
pub use kube::CustomResource;
88
pub use schemars::JsonSchema;
99
pub use serde::{Deserialize, Serialize};
1010
}
@@ -17,7 +17,6 @@ use self::prelude::*;
1717
kind = "GatewayClass",
1818
plural = "gatewayclasses"
1919
)]
20-
#[kube(crates(kube_core = "::kube_core"))]
2120
#[kube(status = "GatewayClassStatus")]
2221
#[kube(derive = "Default")]
2322
#[kube(derive = "PartialEq")]
@@ -75,7 +74,6 @@ pub struct GatewayClassStatus {
7574
pub conditions: Option<Vec<Condition>>,
7675
/// SupportedFeatures is the set of features the GatewayClass support.
7776
/// It MUST be sorted in ascending alphabetical order by the Name key.
78-
///
7977
#[serde(
8078
default,
8179
skip_serializing_if = "Option::is_none",

gateway-api/src/apis/experimental/gateways.rs

Lines changed: 435 additions & 141 deletions
Large diffs are not rendered by default.

gateway-api/src/apis/experimental/grpcroutes.rs

Lines changed: 725 additions & 33 deletions
Large diffs are not rendered by default.

gateway-api/src/apis/experimental/httproutes.rs

Lines changed: 1840 additions & 47 deletions
Large diffs are not rendered by default.

gateway-api/src/apis/experimental/referencegrants.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#[allow(unused_imports)]
44
mod prelude {
5-
pub use kube_derive::CustomResource;
5+
pub use kube::CustomResource;
66
pub use schemars::JsonSchema;
77
pub use serde::{Deserialize, Serialize};
88
}
@@ -15,7 +15,6 @@ use self::prelude::*;
1515
kind = "ReferenceGrant",
1616
plural = "referencegrants"
1717
)]
18-
#[kube(crates(kube_core = "::kube_core"))]
1918
#[kube(namespaced)]
2019
#[kube(derive = "Default")]
2120
#[kube(derive = "PartialEq")]

gateway-api/src/apis/experimental/tcproutes.rs

Lines changed: 111 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use super::common::*;
44
#[allow(unused_imports)]
55
mod prelude {
66
pub use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;
7-
pub use kube_derive::CustomResource;
7+
pub use kube::CustomResource;
88
pub use schemars::JsonSchema;
99
pub use serde::{Deserialize, Serialize};
1010
}
@@ -17,12 +17,11 @@ use self::prelude::*;
1717
kind = "TCPRoute",
1818
plural = "tcproutes"
1919
)]
20-
#[kube(crates(kube_core = "::kube_core"))]
2120
#[kube(namespaced)]
22-
#[kube(status = "RouteStatus")]
21+
#[kube(status = "TcpRouteStatus")]
2322
#[kube(derive = "Default")]
2423
#[kube(derive = "PartialEq")]
25-
pub struct TCPRouteSpec {
24+
pub struct TcpRouteSpec {
2625
/// ParentRefs references the resources (usually Gateways) that a Route wants
2726
/// to be attached to. Note that the referenced parent resource needs to
2827
/// allow this for the attachment to be complete. For Gateways, that means
@@ -84,20 +83,118 @@ pub struct TCPRouteSpec {
8483
/// connections originating from the same namespace as the Route, for which
8584
/// the intended destination of the connections are a Service targeted as a
8685
/// ParentRef of the Route.
87-
///
88-
///
89-
///
90-
///
91-
///
92-
///
9386
#[serde(
9487
default,
9588
skip_serializing_if = "Option::is_none",
9689
rename = "parentRefs"
9790
)]
98-
pub parent_refs: Option<Vec<ParentReference>>,
91+
pub parent_refs: Option<Vec<HttpRouteParentRefs>>,
9992
/// Rules are a list of TCP matchers and actions.
100-
///
101-
///
102-
pub rules: Vec<CommonRouteRule>,
93+
pub rules: Vec<TcpRouteRules>,
94+
/// UseDefaultGateways indicates the default Gateway scope to use for this
95+
/// Route. If unset (the default) or set to None, the Route will not be
96+
/// attached to any default Gateway; if set, it will be attached to any
97+
/// default Gateway supporting the named scope, subject to the usual rules
98+
/// about which Routes a Gateway is allowed to claim.
99+
///
100+
/// Think carefully before using this functionality! The set of default
101+
/// Gateways supporting the requested scope can change over time without
102+
/// any notice to the Route author, and in many situations it will not be
103+
/// appropriate to request a default Gateway for a given Route -- for
104+
/// example, a Route with specific security requirements should almost
105+
/// certainly not use a default Gateway.
106+
#[serde(
107+
default,
108+
skip_serializing_if = "Option::is_none",
109+
rename = "useDefaultGateways"
110+
)]
111+
pub use_default_gateways: Option<GatewayDefaultScope>,
112+
}
113+
/// TCPRouteRule is the configuration for a given rule.
114+
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
115+
pub struct TcpRouteRules {
116+
/// BackendRefs defines the backend(s) where matching requests should be
117+
/// sent. If unspecified or invalid (refers to a nonexistent resource or a
118+
/// Service with no endpoints), the underlying implementation MUST actively
119+
/// reject connection attempts to this backend. Connection rejections must
120+
/// respect weight; if an invalid backend is requested to have 80% of
121+
/// connections, then 80% of connections must be rejected instead.
122+
///
123+
/// Support: Core for Kubernetes Service
124+
///
125+
/// Support: Extended for Kubernetes ServiceImport
126+
///
127+
/// Support: Implementation-specific for any other resource
128+
///
129+
/// Support for weight: Extended
130+
#[serde(rename = "backendRefs")]
131+
pub backend_refs: Vec<TcpRouteRulesBackendRefs>,
132+
/// Name is the name of the route rule. This name MUST be unique within a Route if it is set.
133+
///
134+
/// Support: Extended
135+
#[serde(default, skip_serializing_if = "Option::is_none")]
136+
pub name: Option<String>,
137+
}
138+
/// Status defines the current state of TCPRoute.
139+
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
140+
pub struct TcpRouteStatus {
141+
/// Parents is a list of parent resources (usually Gateways) that are
142+
/// associated with the route, and the status of the route with respect to
143+
/// each parent. When this route attaches to a parent, the controller that
144+
/// manages the parent must add an entry to this list when the controller
145+
/// first sees the route and should update the entry as appropriate when the
146+
/// route or gateway is modified.
147+
///
148+
/// Note that parent references that cannot be resolved by an implementation
149+
/// of this API will not be added to this list. Implementations of this API
150+
/// can only populate Route status for the Gateways/parent resources they are
151+
/// responsible for.
152+
///
153+
/// A maximum of 32 Gateways will be represented in this list. An empty list
154+
/// means the route has not been attached to any Gateway.
155+
pub parents: Vec<TcpRouteStatusParents>,
156+
}
157+
/// RouteParentStatus describes the status of a route with respect to an
158+
/// associated Parent.
159+
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
160+
pub struct TcpRouteStatusParents {
161+
/// Conditions describes the status of the route with respect to the Gateway.
162+
/// Note that the route's availability is also subject to the Gateway's own
163+
/// status conditions and listener status.
164+
///
165+
/// If the Route's ParentRef specifies an existing Gateway that supports
166+
/// Routes of this kind AND that Gateway's controller has sufficient access,
167+
/// then that Gateway's controller MUST set the "Accepted" condition on the
168+
/// Route, to indicate whether the route has been accepted or rejected by the
169+
/// Gateway, and why.
170+
///
171+
/// A Route MUST be considered "Accepted" if at least one of the Route's
172+
/// rules is implemented by the Gateway.
173+
///
174+
/// There are a number of cases where the "Accepted" condition may not be set
175+
/// due to lack of controller visibility, that includes when:
176+
///
177+
/// * The Route refers to a nonexistent parent.
178+
/// * The Route is of a type that the controller does not support.
179+
/// * The Route is in a namespace the controller does not have access to.
180+
pub conditions: Vec<Condition>,
181+
/// ControllerName is a domain/path string that indicates the name of the
182+
/// controller that wrote this status. This corresponds with the
183+
/// controllerName field on GatewayClass.
184+
///
185+
/// Example: "example.net/gateway-controller".
186+
///
187+
/// The format of this field is DOMAIN "/" PATH, where DOMAIN and PATH are
188+
/// valid Kubernetes names
189+
/// (<https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).>
190+
///
191+
/// Controllers MUST populate this field when writing status. Controllers should ensure that
192+
/// entries to status populated with their ControllerName are cleaned up when they are no
193+
/// longer necessary.
194+
#[serde(rename = "controllerName")]
195+
pub controller_name: String,
196+
/// ParentRef corresponds with a ParentRef in the spec that this
197+
/// RouteParentStatus struct describes the status of.
198+
#[serde(rename = "parentRef")]
199+
pub parent_ref: HttpRouteParentRefs,
103200
}

gateway-api/src/apis/experimental/tlsroutes.rs

Lines changed: 125 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use super::common::*;
44
#[allow(unused_imports)]
55
mod prelude {
66
pub use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;
7-
pub use kube_derive::CustomResource;
7+
pub use kube::CustomResource;
88
pub use schemars::JsonSchema;
99
pub use serde::{Deserialize, Serialize};
1010
}
@@ -13,21 +13,20 @@ use self::prelude::*;
1313
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
1414
#[kube(
1515
group = "gateway.networking.k8s.io",
16-
version = "v1alpha2",
16+
version = "v1alpha3",
1717
kind = "TLSRoute",
1818
plural = "tlsroutes"
1919
)]
20-
#[kube(crates(kube_core = "::kube_core"))]
2120
#[kube(namespaced)]
22-
#[kube(status = "RouteStatus")]
21+
#[kube(status = "TlsRouteStatus")]
2322
#[kube(derive = "Default")]
2423
#[kube(derive = "PartialEq")]
25-
pub struct TLSRouteSpec {
26-
/// Hostnames defines a set of SNI names that should match against the
24+
pub struct TlsRouteSpec {
25+
/// Hostnames defines a set of SNI hostnames that should match against the
2726
/// SNI attribute of TLS ClientHello message in TLS handshake. This matches
2827
/// the RFC 1123 definition of a hostname with 2 notable exceptions:
2928
///
30-
/// 1. IPs are not allowed in SNI names per RFC 6066.
29+
/// 1. IPs are not allowed in SNI hostnames per RFC 6066.
3130
/// 2. A hostname may be prefixed with a wildcard label (`*.`). The wildcard
3231
/// label must appear by itself as the first label.
3332
///
@@ -36,13 +35,13 @@ pub struct TLSRouteSpec {
3635
/// attached to the Listener. For example:
3736
///
3837
/// * A Listener with `test.example.com` as the hostname matches TLSRoutes
39-
/// that have either not specified any hostnames, or have specified at
40-
/// least one of `test.example.com` or `*.example.com`.
38+
/// that have specified at least one of `test.example.com` or
39+
/// `*.example.com`.
4140
/// * A Listener with `*.example.com` as the hostname matches TLSRoutes
42-
/// that have either not specified any hostnames or have specified at least
43-
/// one hostname that matches the Listener hostname. For example,
44-
/// `test.example.com` and `*.example.com` would both match. On the other
45-
/// hand, `example.com` and `test.example.net` would not match.
41+
/// that have specified at least one hostname that matches the Listener
42+
/// hostname. For example, `test.example.com` and `*.example.com` would both
43+
/// match. On the other hand, `example.com` and `test.example.net` would not
44+
/// match.
4645
///
4746
/// If both the Listener and TLSRoute have specified hostnames, any
4847
/// TLSRoute hostnames that do not match the Listener hostname MUST be
@@ -56,8 +55,7 @@ pub struct TLSRouteSpec {
5655
/// `False` in the corresponding RouteParentStatus.
5756
///
5857
/// Support: Core
59-
#[serde(default, skip_serializing_if = "Option::is_none")]
60-
pub hostnames: Option<Vec<String>>,
58+
pub hostnames: Vec<String>,
6159
/// ParentRefs references the resources (usually Gateways) that a Route wants
6260
/// to be attached to. Note that the referenced parent resource needs to
6361
/// allow this for the attachment to be complete. For Gateways, that means
@@ -119,20 +117,121 @@ pub struct TLSRouteSpec {
119117
/// connections originating from the same namespace as the Route, for which
120118
/// the intended destination of the connections are a Service targeted as a
121119
/// ParentRef of the Route.
122-
///
123-
///
124-
///
125-
///
126-
///
127-
///
128120
#[serde(
129121
default,
130122
skip_serializing_if = "Option::is_none",
131123
rename = "parentRefs"
132124
)]
133-
pub parent_refs: Option<Vec<ParentReference>>,
134-
/// Rules are a list of TLS matchers and actions.
135-
///
136-
///
137-
pub rules: Vec<CommonRouteRule>,
125+
pub parent_refs: Option<Vec<HttpRouteParentRefs>>,
126+
/// Rules are a list of actions.
127+
pub rules: Vec<TlsRouteRules>,
128+
/// UseDefaultGateways indicates the default Gateway scope to use for this
129+
/// Route. If unset (the default) or set to None, the Route will not be
130+
/// attached to any default Gateway; if set, it will be attached to any
131+
/// default Gateway supporting the named scope, subject to the usual rules
132+
/// about which Routes a Gateway is allowed to claim.
133+
///
134+
/// Think carefully before using this functionality! The set of default
135+
/// Gateways supporting the requested scope can change over time without
136+
/// any notice to the Route author, and in many situations it will not be
137+
/// appropriate to request a default Gateway for a given Route -- for
138+
/// example, a Route with specific security requirements should almost
139+
/// certainly not use a default Gateway.
140+
#[serde(
141+
default,
142+
skip_serializing_if = "Option::is_none",
143+
rename = "useDefaultGateways"
144+
)]
145+
pub use_default_gateways: Option<GatewayDefaultScope>,
146+
}
147+
/// TLSRouteRule is the configuration for a given rule.
148+
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
149+
pub struct TlsRouteRules {
150+
/// BackendRefs defines the backend(s) where matching requests should be
151+
/// sent. If unspecified or invalid (refers to a nonexistent resource or
152+
/// a Service with no endpoints), the rule performs no forwarding; if no
153+
/// filters are specified that would result in a response being sent, the
154+
/// underlying implementation must actively reject request attempts to this
155+
/// backend, by rejecting the connection or returning a 500 status code.
156+
/// Request rejections must respect weight; if an invalid backend is
157+
/// requested to have 80% of requests, then 80% of requests must be rejected
158+
/// instead.
159+
///
160+
/// Support: Core for Kubernetes Service
161+
///
162+
/// Support: Extended for Kubernetes ServiceImport
163+
///
164+
/// Support: Implementation-specific for any other resource
165+
///
166+
/// Support for weight: Extended
167+
#[serde(rename = "backendRefs")]
168+
pub backend_refs: Vec<TcpRouteRulesBackendRefs>,
169+
/// Name is the name of the route rule. This name MUST be unique within a Route if it is set.
170+
///
171+
/// Support: Extended
172+
#[serde(default, skip_serializing_if = "Option::is_none")]
173+
pub name: Option<String>,
174+
}
175+
/// Status defines the current state of TLSRoute.
176+
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
177+
pub struct TlsRouteStatus {
178+
/// Parents is a list of parent resources (usually Gateways) that are
179+
/// associated with the route, and the status of the route with respect to
180+
/// each parent. When this route attaches to a parent, the controller that
181+
/// manages the parent must add an entry to this list when the controller
182+
/// first sees the route and should update the entry as appropriate when the
183+
/// route or gateway is modified.
184+
///
185+
/// Note that parent references that cannot be resolved by an implementation
186+
/// of this API will not be added to this list. Implementations of this API
187+
/// can only populate Route status for the Gateways/parent resources they are
188+
/// responsible for.
189+
///
190+
/// A maximum of 32 Gateways will be represented in this list. An empty list
191+
/// means the route has not been attached to any Gateway.
192+
pub parents: Vec<TlsRouteStatusParents>,
193+
}
194+
/// RouteParentStatus describes the status of a route with respect to an
195+
/// associated Parent.
196+
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
197+
pub struct TlsRouteStatusParents {
198+
/// Conditions describes the status of the route with respect to the Gateway.
199+
/// Note that the route's availability is also subject to the Gateway's own
200+
/// status conditions and listener status.
201+
///
202+
/// If the Route's ParentRef specifies an existing Gateway that supports
203+
/// Routes of this kind AND that Gateway's controller has sufficient access,
204+
/// then that Gateway's controller MUST set the "Accepted" condition on the
205+
/// Route, to indicate whether the route has been accepted or rejected by the
206+
/// Gateway, and why.
207+
///
208+
/// A Route MUST be considered "Accepted" if at least one of the Route's
209+
/// rules is implemented by the Gateway.
210+
///
211+
/// There are a number of cases where the "Accepted" condition may not be set
212+
/// due to lack of controller visibility, that includes when:
213+
///
214+
/// * The Route refers to a nonexistent parent.
215+
/// * The Route is of a type that the controller does not support.
216+
/// * The Route is in a namespace the controller does not have access to.
217+
pub conditions: Vec<Condition>,
218+
/// ControllerName is a domain/path string that indicates the name of the
219+
/// controller that wrote this status. This corresponds with the
220+
/// controllerName field on GatewayClass.
221+
///
222+
/// Example: "example.net/gateway-controller".
223+
///
224+
/// The format of this field is DOMAIN "/" PATH, where DOMAIN and PATH are
225+
/// valid Kubernetes names
226+
/// (<https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).>
227+
///
228+
/// Controllers MUST populate this field when writing status. Controllers should ensure that
229+
/// entries to status populated with their ControllerName are cleaned up when they are no
230+
/// longer necessary.
231+
#[serde(rename = "controllerName")]
232+
pub controller_name: String,
233+
/// ParentRef corresponds with a ParentRef in the spec that this
234+
/// RouteParentStatus struct describes the status of.
235+
#[serde(rename = "parentRef")]
236+
pub parent_ref: HttpRouteParentRefs,
138237
}

0 commit comments

Comments
 (0)