gateway_api/apis/standard/gatewayclasses.rs
1// WARNING: generated file - manual changes will be overriden
2
3#[allow(unused_imports)]
4mod prelude {
5 pub use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;
6 pub use kube_derive::CustomResource;
7 pub use schemars::JsonSchema;
8 pub use serde::{Deserialize, Serialize};
9}
10use self::prelude::*;
11/// Spec defines the desired state of GatewayClass.
12#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
13#[kube(
14 group = "gateway.networking.k8s.io",
15 version = "v1",
16 kind = "GatewayClass",
17 plural = "gatewayclasses"
18)]
19#[kube(status = "GatewayClassStatus")]
20#[kube(derive = "Default")]
21#[kube(derive = "PartialEq")]
22pub struct GatewayClassSpec {
23 /// ControllerName is the name of the controller that is managing Gateways of
24 /// this class. The value of this field MUST be a domain prefixed path.
25 ///
26 /// Example: "example.net/gateway-controller".
27 ///
28 /// This field is not mutable and cannot be empty.
29 ///
30 /// Support: Core
31 #[serde(rename = "controllerName")]
32 pub controller_name: String,
33 /// Description helps describe a GatewayClass with more details.
34 #[serde(default, skip_serializing_if = "Option::is_none")]
35 pub description: Option<String>,
36 /// ParametersRef is a reference to a resource that contains the configuration
37 /// parameters corresponding to the GatewayClass. This is optional if the
38 /// controller does not require any additional configuration.
39 ///
40 /// ParametersRef can reference a standard Kubernetes resource, i.e. ConfigMap,
41 /// or an implementation-specific custom resource. The resource can be
42 /// cluster-scoped or namespace-scoped.
43 ///
44 /// If the referent cannot be found, refers to an unsupported kind, or when
45 /// the data within that resource is malformed, the GatewayClass SHOULD be
46 /// rejected with the "Accepted" status condition set to "False" and an
47 /// "InvalidParameters" reason.
48 ///
49 /// A Gateway for this GatewayClass may provide its own `parametersRef`. When both are specified,
50 /// the merging behavior is implementation specific.
51 /// It is generally recommended that GatewayClass provides defaults that can be overridden by a Gateway.
52 ///
53 /// Support: Implementation-specific
54 #[serde(
55 default,
56 skip_serializing_if = "Option::is_none",
57 rename = "parametersRef"
58 )]
59 pub parameters_ref: Option<GatewayClassParametersRef>,
60}
61/// ParametersRef is a reference to a resource that contains the configuration
62/// parameters corresponding to the GatewayClass. This is optional if the
63/// controller does not require any additional configuration.
64///
65/// ParametersRef can reference a standard Kubernetes resource, i.e. ConfigMap,
66/// or an implementation-specific custom resource. The resource can be
67/// cluster-scoped or namespace-scoped.
68///
69/// If the referent cannot be found, refers to an unsupported kind, or when
70/// the data within that resource is malformed, the GatewayClass SHOULD be
71/// rejected with the "Accepted" status condition set to "False" and an
72/// "InvalidParameters" reason.
73///
74/// A Gateway for this GatewayClass may provide its own `parametersRef`. When both are specified,
75/// the merging behavior is implementation specific.
76/// It is generally recommended that GatewayClass provides defaults that can be overridden by a Gateway.
77///
78/// Support: Implementation-specific
79#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
80pub struct GatewayClassParametersRef {
81 /// Group is the group of the referent.
82 pub group: String,
83 /// Kind is kind of the referent.
84 pub kind: String,
85 /// Name is the name of the referent.
86 pub name: String,
87 /// Namespace is the namespace of the referent.
88 /// This field is required when referring to a Namespace-scoped resource and
89 /// MUST be unset when referring to a Cluster-scoped resource.
90 #[serde(default, skip_serializing_if = "Option::is_none")]
91 pub namespace: Option<String>,
92}
93/// Status defines the current state of GatewayClass.
94///
95/// Implementations MUST populate status on all GatewayClass resources which
96/// specify their controller name.
97#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
98pub struct GatewayClassStatus {
99 /// Conditions is the current status from the controller for
100 /// this GatewayClass.
101 ///
102 /// Controllers should prefer to publish conditions using values
103 /// of GatewayClassConditionType for the type of each Condition.
104 #[serde(default, skip_serializing_if = "Option::is_none")]
105 pub conditions: Option<Vec<Condition>>,
106}