cluster_api_rs/api/
capi_clusterresourceset.rs

1// WARNING: generated by kopium - manual changes will be overwritten
2// kopium command: kopium --smart-derive-elision -D Default -D PartialEq -A -d -f -
3// kopium version: 0.21.2
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    pub use std::collections::BTreeMap;
12}
13use self::prelude::*;
14
15/// spec is the desired state of ClusterResourceSet.
16#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
17#[kube(
18    group = "addons.cluster.x-k8s.io",
19    version = "v1beta1",
20    kind = "ClusterResourceSet",
21    plural = "clusterresourcesets"
22)]
23#[kube(namespaced)]
24#[kube(status = "ClusterResourceSetStatus")]
25#[kube(derive = "Default")]
26#[kube(derive = "PartialEq")]
27pub struct ClusterResourceSetSpec {
28    /// clusterSelector is the label selector for Clusters. The Clusters that are
29    /// selected by this will be the ones affected by this ClusterResourceSet.
30    /// It must match the Cluster labels. This field is immutable.
31    /// Label selector cannot be empty.
32    #[serde(rename = "clusterSelector")]
33    pub cluster_selector: ClusterResourceSetClusterSelector,
34    /// resources is a list of Secrets/ConfigMaps where each contains 1 or more resources to be applied to remote clusters.
35    #[serde(default, skip_serializing_if = "Option::is_none")]
36    pub resources: Option<Vec<ClusterResourceSetResources>>,
37    /// strategy is the strategy to be used during applying resources. Defaults to ApplyOnce. This field is immutable.
38    #[serde(default, skip_serializing_if = "Option::is_none")]
39    pub strategy: Option<ClusterResourceSetStrategy>,
40}
41
42/// clusterSelector is the label selector for Clusters. The Clusters that are
43/// selected by this will be the ones affected by this ClusterResourceSet.
44/// It must match the Cluster labels. This field is immutable.
45/// Label selector cannot be empty.
46#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
47pub struct ClusterResourceSetClusterSelector {
48    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
49    #[serde(
50        default,
51        skip_serializing_if = "Option::is_none",
52        rename = "matchExpressions"
53    )]
54    pub match_expressions: Option<Vec<ClusterResourceSetClusterSelectorMatchExpressions>>,
55    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
56    /// map is equivalent to an element of matchExpressions, whose key field is "key", the
57    /// operator is "In", and the values array contains only "value". The requirements are ANDed.
58    #[serde(
59        default,
60        skip_serializing_if = "Option::is_none",
61        rename = "matchLabels"
62    )]
63    pub match_labels: Option<BTreeMap<String, String>>,
64}
65
66/// A label selector requirement is a selector that contains values, a key, and an operator that
67/// relates the key and values.
68#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
69pub struct ClusterResourceSetClusterSelectorMatchExpressions {
70    /// key is the label key that the selector applies to.
71    pub key: String,
72    /// operator represents a key's relationship to a set of values.
73    /// Valid operators are In, NotIn, Exists and DoesNotExist.
74    pub operator: String,
75    /// values is an array of string values. If the operator is In or NotIn,
76    /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
77    /// the values array must be empty. This array is replaced during a strategic
78    /// merge patch.
79    #[serde(default, skip_serializing_if = "Option::is_none")]
80    pub values: Option<Vec<String>>,
81}
82
83/// ResourceRef specifies a resource.
84#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
85pub struct ClusterResourceSetResources {
86    /// kind of the resource. Supported kinds are: Secrets and ConfigMaps.
87    pub kind: ClusterResourceSetResourcesKind,
88    /// name of the resource that is in the same namespace with ClusterResourceSet object.
89    pub name: String,
90}
91
92/// ResourceRef specifies a resource.
93#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
94pub enum ClusterResourceSetResourcesKind {
95    Secret,
96    ConfigMap,
97}
98
99/// spec is the desired state of ClusterResourceSet.
100#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
101pub enum ClusterResourceSetStrategy {
102    ApplyOnce,
103    Reconcile,
104}
105
106/// status is the observed state of ClusterResourceSet.
107#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
108pub struct ClusterResourceSetStatus {
109    /// conditions defines current state of the ClusterResourceSet.
110    #[serde(default, skip_serializing_if = "Option::is_none")]
111    pub conditions: Option<Vec<Condition>>,
112    /// observedGeneration reflects the generation of the most recently observed ClusterResourceSet.
113    #[serde(
114        default,
115        skip_serializing_if = "Option::is_none",
116        rename = "observedGeneration"
117    )]
118    pub observed_generation: Option<i64>,
119    /// v1beta2 groups all the fields that will be added or modified in ClusterResourceSet's status with the V1Beta2 version.
120    #[serde(default, skip_serializing_if = "Option::is_none")]
121    pub v1beta2: Option<ClusterResourceSetStatusV1beta2>,
122}
123
124/// v1beta2 groups all the fields that will be added or modified in ClusterResourceSet's status with the V1Beta2 version.
125#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
126pub struct ClusterResourceSetStatusV1beta2 {
127    /// conditions represents the observations of a ClusterResourceSet's current state.
128    /// Known condition types are ResourceSetApplied, Deleting.
129    #[serde(default, skip_serializing_if = "Option::is_none")]
130    pub conditions: Option<Vec<Condition>>,
131}