fleet_api_rs/api/
fleet_clustergroup.rs

1// WARNING: generated by kopium - manual changes will be overwritten
2// kopium command: kopium -D Default -D PartialEq --no-condition -A -d -f -
3// kopium version: 0.22.5
4
5#[allow(unused_imports)]
6mod prelude {
7    pub use kube::CustomResource;
8    pub use schemars::JsonSchema;
9    pub use serde::{Deserialize, Serialize};
10    pub use std::collections::BTreeMap;
11}
12
13use self::prelude::*;
14
15#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
16#[kube(
17    group = "fleet.cattle.io",
18    version = "v1alpha1",
19    kind = "ClusterGroup",
20    plural = "clustergroups"
21)]
22#[kube(namespaced)]
23#[kube(status = "ClusterGroupStatus")]
24#[kube(derive = "Default")]
25#[kube(derive = "PartialEq")]
26pub struct ClusterGroupSpec {
27    /// Selector is a label selector, used to select clusters for this group.
28    #[serde(default, skip_serializing_if = "Option::is_none")]
29    pub selector: Option<ClusterGroupSelector>,
30}
31
32/// Selector is a label selector, used to select clusters for this group.
33#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
34pub struct ClusterGroupSelector {
35    /// matchExpressions is a list of label selector requirements. The requirements are ANDed.
36    #[serde(
37        default,
38        skip_serializing_if = "Option::is_none",
39        rename = "matchExpressions"
40    )]
41    pub match_expressions: Option<Vec<ClusterGroupSelectorMatchExpressions>>,
42    /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
43    /// map is equivalent to an element of matchExpressions, whose key field is "key", the
44    /// operator is "In", and the values array contains only "value". The requirements are ANDed.
45    #[serde(
46        default,
47        skip_serializing_if = "Option::is_none",
48        rename = "matchLabels"
49    )]
50    pub match_labels: Option<BTreeMap<String, String>>,
51}
52
53/// A label selector requirement is a selector that contains values, a key, and an operator that
54/// relates the key and values.
55#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
56pub struct ClusterGroupSelectorMatchExpressions {
57    /// key is the label key that the selector applies to.
58    pub key: String,
59    /// operator represents a key's relationship to a set of values.
60    /// Valid operators are In, NotIn, Exists and DoesNotExist.
61    pub operator: String,
62    /// values is an array of string values. If the operator is In or NotIn,
63    /// the values array must be non-empty. If the operator is Exists or DoesNotExist,
64    /// the values array must be empty. This array is replaced during a strategic
65    /// merge patch.
66    #[serde(default, skip_serializing_if = "Option::is_none")]
67    pub values: Option<Vec<String>>,
68}
69
70#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
71pub struct ClusterGroupStatus {
72    /// ClusterCount is the number of clusters in the cluster group.
73    #[serde(
74        default,
75        skip_serializing_if = "Option::is_none",
76        rename = "clusterCount"
77    )]
78    pub cluster_count: Option<i64>,
79    /// Conditions is a list of conditions and their statuses for the cluster group.
80    #[serde(default, skip_serializing_if = "Option::is_none")]
81    pub conditions: Option<Vec<ClusterGroupStatusConditions>>,
82    /// Display contains the number of ready, desiredready clusters and a
83    /// summary state for the bundle's resources.
84    #[serde(default, skip_serializing_if = "Option::is_none")]
85    pub display: Option<ClusterGroupStatusDisplay>,
86    /// NonReadyClusterCount is the number of clusters that are not ready.
87    #[serde(
88        default,
89        skip_serializing_if = "Option::is_none",
90        rename = "nonReadyClusterCount"
91    )]
92    pub non_ready_cluster_count: Option<i64>,
93    /// NonReadyClusters is a list of cluster names that are not ready.
94    #[serde(
95        default,
96        skip_serializing_if = "Option::is_none",
97        rename = "nonReadyClusters"
98    )]
99    pub non_ready_clusters: Option<Vec<String>>,
100    /// ResourceCounts contains the number of resources in each state over
101    /// all bundles in the cluster group.
102    #[serde(
103        default,
104        skip_serializing_if = "Option::is_none",
105        rename = "resourceCounts"
106    )]
107    pub resource_counts: Option<ClusterGroupStatusResourceCounts>,
108    /// Summary is a summary of the bundle deployments and their resources
109    /// in the cluster group.
110    #[serde(default, skip_serializing_if = "Option::is_none")]
111    pub summary: Option<ClusterGroupStatusSummary>,
112}
113
114#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
115pub struct ClusterGroupStatusConditions {
116    /// Last time the condition transitioned from one status to another.
117    #[serde(
118        default,
119        skip_serializing_if = "Option::is_none",
120        rename = "lastTransitionTime"
121    )]
122    pub last_transition_time: Option<String>,
123    /// The last time this condition was updated.
124    #[serde(
125        default,
126        skip_serializing_if = "Option::is_none",
127        rename = "lastUpdateTime"
128    )]
129    pub last_update_time: Option<String>,
130    /// Human-readable message indicating details about last transition
131    #[serde(default, skip_serializing_if = "Option::is_none")]
132    pub message: Option<String>,
133    /// The reason for the condition's last transition.
134    #[serde(default, skip_serializing_if = "Option::is_none")]
135    pub reason: Option<String>,
136    /// Status of the condition, one of True, False, Unknown.
137    pub status: String,
138    /// Type of cluster condition.
139    #[serde(rename = "type")]
140    pub r#type: String,
141}
142
143/// Display contains the number of ready, desiredready clusters and a
144/// summary state for the bundle's resources.
145#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
146pub struct ClusterGroupStatusDisplay {
147    /// ReadyBundles is a string in the form "%d/%d", that describes the
148    /// number of bundles that are ready vs. the number of bundles desired
149    /// to be ready.
150    #[serde(
151        default,
152        skip_serializing_if = "Option::is_none",
153        rename = "readyBundles"
154    )]
155    pub ready_bundles: Option<String>,
156    /// ReadyClusters is a string in the form "%d/%d", that describes the
157    /// number of clusters that are ready vs. the number of clusters desired
158    /// to be ready.
159    #[serde(
160        default,
161        skip_serializing_if = "Option::is_none",
162        rename = "readyClusters"
163    )]
164    pub ready_clusters: Option<String>,
165    /// State is a summary state for the cluster group, showing "NotReady" if
166    /// there are non-ready resources.
167    #[serde(default, skip_serializing_if = "Option::is_none")]
168    pub state: Option<String>,
169}
170
171/// ResourceCounts contains the number of resources in each state over
172/// all bundles in the cluster group.
173#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
174pub struct ClusterGroupStatusResourceCounts {
175    /// DesiredReady is the number of resources that should be ready.
176    #[serde(
177        default,
178        skip_serializing_if = "Option::is_none",
179        rename = "desiredReady"
180    )]
181    pub desired_ready: Option<i64>,
182    /// Missing is the number of missing resources.
183    #[serde(default, skip_serializing_if = "Option::is_none")]
184    pub missing: Option<i64>,
185    /// Modified is the number of resources that have been modified.
186    #[serde(default, skip_serializing_if = "Option::is_none")]
187    pub modified: Option<i64>,
188    /// NotReady is the number of not ready resources. Resources are not
189    /// ready if they do not match any other state.
190    #[serde(default, skip_serializing_if = "Option::is_none", rename = "notReady")]
191    pub not_ready: Option<i64>,
192    /// Orphaned is the number of orphaned resources.
193    #[serde(default, skip_serializing_if = "Option::is_none")]
194    pub orphaned: Option<i64>,
195    /// Ready is the number of ready resources.
196    #[serde(default, skip_serializing_if = "Option::is_none")]
197    pub ready: Option<i64>,
198    /// Unknown is the number of resources in an unknown state.
199    #[serde(default, skip_serializing_if = "Option::is_none")]
200    pub unknown: Option<i64>,
201    /// WaitApplied is the number of resources that are waiting to be applied.
202    #[serde(
203        default,
204        skip_serializing_if = "Option::is_none",
205        rename = "waitApplied"
206    )]
207    pub wait_applied: Option<i64>,
208}
209
210/// Summary is a summary of the bundle deployments and their resources
211/// in the cluster group.
212#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
213pub struct ClusterGroupStatusSummary {
214    /// DesiredReady is the number of bundle deployments that should be
215    /// ready.
216    #[serde(
217        default,
218        skip_serializing_if = "Option::is_none",
219        rename = "desiredReady"
220    )]
221    pub desired_ready: Option<i64>,
222    /// ErrApplied is the number of bundle deployments that have been synced
223    /// from the Fleet controller and the downstream cluster, but with some
224    /// errors when deploying the bundle.
225    #[serde(
226        default,
227        skip_serializing_if = "Option::is_none",
228        rename = "errApplied"
229    )]
230    pub err_applied: Option<i64>,
231    /// Modified is the number of bundle deployments that have been deployed
232    /// and for which all resources are ready, but where some changes from the
233    /// Git repository have not yet been synced.
234    #[serde(default, skip_serializing_if = "Option::is_none")]
235    pub modified: Option<i64>,
236    /// NonReadyClusters is a list of states, which is filled for a bundle
237    /// that is not ready.
238    #[serde(
239        default,
240        skip_serializing_if = "Option::is_none",
241        rename = "nonReadyResources"
242    )]
243    pub non_ready_resources: Option<Vec<ClusterGroupStatusSummaryNonReadyResources>>,
244    /// NotReady is the number of bundle deployments that have been deployed
245    /// where some resources are not ready.
246    #[serde(default, skip_serializing_if = "Option::is_none", rename = "notReady")]
247    pub not_ready: Option<i64>,
248    /// OutOfSync is the number of bundle deployments that have been synced
249    /// from Fleet controller, but not yet by the downstream agent.
250    #[serde(default, skip_serializing_if = "Option::is_none", rename = "outOfSync")]
251    pub out_of_sync: Option<i64>,
252    /// Pending is the number of bundle deployments that are being processed
253    /// by Fleet controller.
254    #[serde(default, skip_serializing_if = "Option::is_none")]
255    pub pending: Option<i64>,
256    /// Ready is the number of bundle deployments that have been deployed
257    /// where all resources are ready.
258    #[serde(default, skip_serializing_if = "Option::is_none")]
259    pub ready: Option<i64>,
260    /// WaitApplied is the number of bundle deployments that have been
261    /// synced from Fleet controller and downstream cluster, but are waiting
262    /// to be deployed.
263    #[serde(
264        default,
265        skip_serializing_if = "Option::is_none",
266        rename = "waitApplied"
267    )]
268    pub wait_applied: Option<i64>,
269}
270
271/// NonReadyResource contains information about a bundle that is not ready for a
272/// given state like "ErrApplied". It contains a list of non-ready or modified
273/// resources and their states.
274#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
275pub struct ClusterGroupStatusSummaryNonReadyResources {
276    /// State is the state of the resource, like e.g. "NotReady" or "ErrApplied".
277    #[serde(
278        default,
279        skip_serializing_if = "Option::is_none",
280        rename = "bundleState"
281    )]
282    pub bundle_state: Option<String>,
283    /// Message contains information why the bundle is not ready.
284    #[serde(default, skip_serializing_if = "Option::is_none")]
285    pub message: Option<String>,
286    /// ModifiedStatus lists the state for each modified resource.
287    #[serde(
288        default,
289        skip_serializing_if = "Option::is_none",
290        rename = "modifiedStatus"
291    )]
292    pub modified_status: Option<Vec<ClusterGroupStatusSummaryNonReadyResourcesModifiedStatus>>,
293    /// Name is the name of the resource.
294    #[serde(default, skip_serializing_if = "Option::is_none")]
295    pub name: Option<String>,
296    /// NonReadyStatus lists the state for each non-ready resource.
297    #[serde(
298        default,
299        skip_serializing_if = "Option::is_none",
300        rename = "nonReadyStatus"
301    )]
302    pub non_ready_status: Option<Vec<ClusterGroupStatusSummaryNonReadyResourcesNonReadyStatus>>,
303}
304
305/// ModifiedStatus is used to report the status of a resource that is modified.
306/// It indicates if the modification was a create, a delete or a patch.
307#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
308pub struct ClusterGroupStatusSummaryNonReadyResourcesModifiedStatus {
309    #[serde(
310        default,
311        skip_serializing_if = "Option::is_none",
312        rename = "apiVersion"
313    )]
314    pub api_version: Option<String>,
315    #[serde(default, skip_serializing_if = "Option::is_none")]
316    pub delete: Option<bool>,
317    /// Exist is true if the resource exists but is not owned by us. This can happen if a resource was adopted by another bundle whereas the first bundle still exists and due to that reports that it does not own it.
318    #[serde(default, skip_serializing_if = "Option::is_none")]
319    pub exist: Option<bool>,
320    #[serde(default, skip_serializing_if = "Option::is_none")]
321    pub kind: Option<String>,
322    #[serde(default, skip_serializing_if = "Option::is_none")]
323    pub missing: Option<bool>,
324    #[serde(default, skip_serializing_if = "Option::is_none")]
325    pub name: Option<String>,
326    #[serde(default, skip_serializing_if = "Option::is_none")]
327    pub namespace: Option<String>,
328    #[serde(default, skip_serializing_if = "Option::is_none")]
329    pub patch: Option<String>,
330}
331
332/// NonReadyStatus is used to report the status of a resource that is not ready. It includes a summary.
333#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
334pub struct ClusterGroupStatusSummaryNonReadyResourcesNonReadyStatus {
335    #[serde(
336        default,
337        skip_serializing_if = "Option::is_none",
338        rename = "apiVersion"
339    )]
340    pub api_version: Option<String>,
341    #[serde(default, skip_serializing_if = "Option::is_none")]
342    pub kind: Option<String>,
343    #[serde(default, skip_serializing_if = "Option::is_none")]
344    pub name: Option<String>,
345    #[serde(default, skip_serializing_if = "Option::is_none")]
346    pub namespace: Option<String>,
347    #[serde(default, skip_serializing_if = "Option::is_none")]
348    pub summary: Option<ClusterGroupStatusSummaryNonReadyResourcesNonReadyStatusSummary>,
349    /// UID is a type that holds unique ID values, including UUIDs.  Because we
350    /// don't ONLY use UUIDs, this is an alias to string.  Being a type captures
351    /// intent and helps make sure that UIDs and names do not get conflated.
352    #[serde(default, skip_serializing_if = "Option::is_none")]
353    pub uid: Option<String>,
354}
355
356#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
357pub struct ClusterGroupStatusSummaryNonReadyResourcesNonReadyStatusSummary {
358    #[serde(default, skip_serializing_if = "Option::is_none")]
359    pub error: Option<bool>,
360    #[serde(default, skip_serializing_if = "Option::is_none")]
361    pub message: Option<Vec<String>>,
362    #[serde(default, skip_serializing_if = "Option::is_none")]
363    pub state: Option<String>,
364    #[serde(default, skip_serializing_if = "Option::is_none")]
365    pub transitioning: Option<bool>,
366}