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