gateway_api/apis/experimental/
gatewayclasses.rs

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