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