gateway_api/apis/experimental/gatewayclasses.rs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium --schema=derived --derive=JsonSchema --derive=Default --derive=PartialEq --docs -f -
// kopium version: 0.21.1
#[allow(unused_imports)]
mod prelude {
pub use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;
pub use kube::CustomResource;
pub use schemars::JsonSchema;
pub use serde::{Deserialize, Serialize};
}
use self::prelude::*;
/// Spec defines the desired state of GatewayClass.
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
#[kube(
group = "gateway.networking.k8s.io",
version = "v1",
kind = "GatewayClass",
plural = "gatewayclasses"
)]
#[kube(status = "GatewayClassStatus")]
#[kube(derive = "Default")]
#[kube(derive = "PartialEq")]
pub struct GatewayClassSpec {
/// 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.
///
/// Example: "example.net/gateway-controller".
///
/// This field is not mutable and cannot be empty.
///
/// Support: Core
#[serde(rename = "controllerName")]
pub controller_name: String,
/// Description helps describe a GatewayClass with more details.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
/// 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.
///
/// 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.
///
/// If the referent cannot be found, refers to an unsupported kind, or when
/// the data within that resource is malformed, the GatewayClass SHOULD be
/// rejected with the "Accepted" status condition set to "False" and an
/// "InvalidParameters" reason.
///
/// A Gateway for this GatewayClass may provide its own `parametersRef`. When both are specified,
/// the merging behavior is implementation specific.
/// It is generally recommended that GatewayClass provides defaults that can be overridden by a Gateway.
///
/// Support: Implementation-specific
#[serde(
default,
skip_serializing_if = "Option::is_none",
rename = "parametersRef"
)]
pub parameters_ref: Option<GatewayClassParametersRef>,
}
/// 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.
///
/// 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.
///
/// If the referent cannot be found, refers to an unsupported kind, or when
/// the data within that resource is malformed, the GatewayClass SHOULD be
/// rejected with the "Accepted" status condition set to "False" and an
/// "InvalidParameters" reason.
///
/// A Gateway for this GatewayClass may provide its own `parametersRef`. When both are specified,
/// the merging behavior is implementation specific.
/// It is generally recommended that GatewayClass provides defaults that can be overridden by a Gateway.
///
/// Support: Implementation-specific
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
pub struct GatewayClassParametersRef {
/// Group is the group of the referent.
pub group: String,
/// Kind is kind of the referent.
pub kind: String,
/// Name is the name of the referent.
pub name: String,
/// 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.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub namespace: Option<String>,
}
/// Status defines the current state of GatewayClass.
///
/// Implementations MUST populate status on all GatewayClass resources which
/// specify their controller name.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
pub struct GatewayClassStatus {
/// Conditions is the current status from the controller for
/// this GatewayClass.
///
/// Controllers should prefer to publish conditions using values
/// of GatewayClassConditionType for the type of each Condition.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub conditions: Option<Vec<Condition>>,
/// SupportedFeatures is the set of features the GatewayClass support.
/// It MUST be sorted in ascending alphabetical order by the Name key.
///
#[serde(
default,
skip_serializing_if = "Option::is_none",
rename = "supportedFeatures"
)]
pub supported_features: Option<Vec<GatewayClassStatusSupportedFeatures>>,
}
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
pub struct GatewayClassStatusSupportedFeatures {
/// FeatureName is used to describe distinct features that are covered by
/// conformance tests.
pub name: String,
}