|
| 1 | +// WARNING: generated by kopium - manual changes will be overwritten |
| 2 | +// kopium command: kopium --schema=derived --derive=JsonSchema --derive=Default --docs -f - |
| 3 | +// kopium version: 0.17.2 |
| 4 | + |
| 5 | +use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition; |
| 6 | +use kube::CustomResource; |
| 7 | +use schemars::JsonSchema; |
| 8 | +use serde::{Deserialize, Serialize}; |
| 9 | + |
| 10 | +/// Spec defines the desired state of GatewayClass. |
| 11 | +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, JsonSchema, Default)] |
| 12 | +#[kube( |
| 13 | + group = "gateway.networking.k8s.io", |
| 14 | + version = "v1", |
| 15 | + kind = "GatewayClass", |
| 16 | + plural = "gatewayclasses" |
| 17 | +)] |
| 18 | +#[kube(status = "GatewayClassStatus")] |
| 19 | +pub struct GatewayClassSpec { |
| 20 | + /// ControllerName is the name of the controller that is managing Gateways of this class. The value of this field MUST be a domain prefixed path. |
| 21 | + /// Example: "example.net/gateway-controller". |
| 22 | + /// This field is not mutable and cannot be empty. |
| 23 | + /// Support: Core |
| 24 | + #[serde(rename = "controllerName")] |
| 25 | + pub controller_name: String, |
| 26 | + /// Description helps describe a GatewayClass with more details. |
| 27 | + #[serde(default, skip_serializing_if = "Option::is_none")] |
| 28 | + pub description: Option<String>, |
| 29 | + /// ParametersRef is a reference to a resource that contains the configuration parameters corresponding to the GatewayClass. This is optional if the controller does not require any additional configuration. |
| 30 | + /// ParametersRef can reference a standard Kubernetes resource, i.e. ConfigMap, or an implementation-specific custom resource. The resource can be cluster-scoped or namespace-scoped. |
| 31 | + /// If the referent cannot be found, the GatewayClass's "InvalidParameters" status condition will be true. |
| 32 | + /// Support: Implementation-specific |
| 33 | + #[serde( |
| 34 | + default, |
| 35 | + skip_serializing_if = "Option::is_none", |
| 36 | + rename = "parametersRef" |
| 37 | + )] |
| 38 | + pub parameters_ref: Option<GatewayClassParametersRef>, |
| 39 | +} |
| 40 | + |
| 41 | +/// ParametersRef is a reference to a resource that contains the configuration parameters corresponding to the GatewayClass. This is optional if the controller does not require any additional configuration. |
| 42 | +/// ParametersRef can reference a standard Kubernetes resource, i.e. ConfigMap, or an implementation-specific custom resource. The resource can be cluster-scoped or namespace-scoped. |
| 43 | +/// If the referent cannot be found, the GatewayClass's "InvalidParameters" status condition will be true. |
| 44 | +/// Support: Implementation-specific |
| 45 | +#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)] |
| 46 | +pub struct GatewayClassParametersRef { |
| 47 | + /// Group is the group of the referent. |
| 48 | + pub group: String, |
| 49 | + /// Kind is kind of the referent. |
| 50 | + pub kind: String, |
| 51 | + /// Name is the name of the referent. |
| 52 | + pub name: String, |
| 53 | + /// Namespace is the namespace of the referent. This field is required when referring to a Namespace-scoped resource and MUST be unset when referring to a Cluster-scoped resource. |
| 54 | + #[serde(default, skip_serializing_if = "Option::is_none")] |
| 55 | + pub namespace: Option<String>, |
| 56 | +} |
| 57 | + |
| 58 | +/// Status defines the current state of GatewayClass. |
| 59 | +/// Implementations MUST populate status on all GatewayClass resources which specify their controller name. |
| 60 | +#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)] |
| 61 | +pub struct GatewayClassStatus { |
| 62 | + /// Conditions is the current status from the controller for this GatewayClass. |
| 63 | + /// Controllers should prefer to publish conditions using values of GatewayClassConditionType for the type of each Condition. |
| 64 | + #[serde(default, skip_serializing_if = "Option::is_none")] |
| 65 | + pub conditions: Option<Vec<Condition>>, |
| 66 | + /// SupportedFeatures is the set of features the GatewayClass support. It MUST be sorted in ascending alphabetical order. |
| 67 | + #[serde( |
| 68 | + default, |
| 69 | + skip_serializing_if = "Option::is_none", |
| 70 | + rename = "supportedFeatures" |
| 71 | + )] |
| 72 | + pub supported_features: Option<Vec<String>>, |
| 73 | +} |
0 commit comments