Skip to main content

gateway_api/apis/standard/
gatewayclasses.rs

1// WARNING: generated by kopium - manual changes will be overwritten
2// kopium command: kopium --schema=derived --derive=JsonSchema --derive=Default --derive=PartialEq --docs -f -
3// kopium version: 0.22.5
4
5#[allow(unused_imports)]
6mod prelude {
7    pub use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;
8    pub use kube::CustomResource;
9    pub use schemars::JsonSchema;
10    pub use serde::{Deserialize, Serialize};
11}
12use self::prelude::*;
13
14/// Spec defines the desired state of GatewayClass.
15#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
16#[kube(
17    group = "gateway.networking.k8s.io",
18    version = "v1",
19    kind = "GatewayClass",
20    plural = "gatewayclasses"
21)]
22#[kube(status = "GatewayClassStatus")]
23#[kube(derive = "Default")]
24#[kube(derive = "PartialEq")]
25pub struct GatewayClassSpec {
26    /// ControllerName is the name of the controller that is managing Gateways of
27    /// this class. The value of this field MUST be a domain prefixed path.
28    ///
29    /// Example: "example.net/gateway-controller".
30    ///
31    /// This field is not mutable and cannot be empty.
32    ///
33    /// Support: Core
34    #[serde(rename = "controllerName")]
35    pub controller_name: String,
36    /// Description helps describe a GatewayClass with more details.
37    #[serde(default, skip_serializing_if = "Option::is_none")]
38    pub description: Option<String>,
39    /// ParametersRef is a reference to a resource that contains the configuration
40    /// parameters corresponding to the GatewayClass. This is optional if the
41    /// controller does not require any additional configuration.
42    ///
43    /// ParametersRef can reference a standard Kubernetes resource, i.e. ConfigMap,
44    /// or an implementation-specific custom resource. The resource can be
45    /// cluster-scoped or namespace-scoped.
46    ///
47    /// If the referent cannot be found, refers to an unsupported kind, or when
48    /// the data within that resource is malformed, the GatewayClass SHOULD be
49    /// rejected with the "Accepted" status condition set to "False" and an
50    /// "InvalidParameters" reason.
51    ///
52    /// A Gateway for this GatewayClass may provide its own `parametersRef`. When both are specified,
53    /// the merging behavior is implementation specific.
54    /// It is generally recommended that GatewayClass provides defaults that can be overridden by a Gateway.
55    ///
56    /// Support: Implementation-specific
57    #[serde(default, skip_serializing_if = "Option::is_none", rename = "parametersRef")]
58    pub parameters_ref: Option<GatewayClassParametersRef>,
59}
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
94/// Status defines the current state of GatewayClass.
95///
96/// Implementations MUST populate status on all GatewayClass resources which
97/// specify their controller name.
98#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
99pub struct GatewayClassStatus {
100    /// Conditions is the current status from the controller for
101    /// this GatewayClass.
102    ///
103    /// Controllers should prefer to publish conditions using values
104    /// of GatewayClassConditionType for the type of each Condition.
105    #[serde(default, skip_serializing_if = "Option::is_none")]
106    pub conditions: Option<Vec<Condition>>,
107    /// SupportedFeatures is the set of features the GatewayClass support.
108    /// It MUST be sorted in ascending alphabetical order by the Name key.
109    #[serde(default, skip_serializing_if = "Option::is_none", rename = "supportedFeatures")]
110    pub supported_features: Option<Vec<GatewayClassStatusSupportedFeatures>>,
111}
112
113#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
114pub struct GatewayClassStatusSupportedFeatures {
115    /// FeatureName is used to describe distinct features that are covered by
116    /// conformance tests.
117    pub name: String,
118}