cluster_api_rs/api/
capi_clusterresourcesetbinding.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 kube::CustomResource;
8    pub use schemars::JsonSchema;
9    pub use serde::{Deserialize, Serialize};
10}
11use self::prelude::*;
12
13/// spec is the desired state of ClusterResourceSetBinding.
14#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
15#[kube(
16    group = "addons.cluster.x-k8s.io",
17    version = "v1beta1",
18    kind = "ClusterResourceSetBinding",
19    plural = "clusterresourcesetbindings"
20)]
21#[kube(namespaced)]
22#[kube(derive = "Default")]
23#[kube(derive = "PartialEq")]
24pub struct ClusterResourceSetBindingSpec {
25    /// bindings is a list of ClusterResourceSets and their resources.
26    #[serde(default, skip_serializing_if = "Option::is_none")]
27    pub bindings: Option<Vec<ClusterResourceSetBindingBindings>>,
28    /// clusterName is the name of the Cluster this binding applies to.
29    /// Note: this field mandatory in v1beta2.
30    #[serde(
31        default,
32        skip_serializing_if = "Option::is_none",
33        rename = "clusterName"
34    )]
35    pub cluster_name: Option<String>,
36}
37
38/// ResourceSetBinding keeps info on all of the resources in a ClusterResourceSet.
39#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
40pub struct ClusterResourceSetBindingBindings {
41    /// clusterResourceSetName is the name of the ClusterResourceSet that is applied to the owner cluster of the binding.
42    #[serde(rename = "clusterResourceSetName")]
43    pub cluster_resource_set_name: String,
44    /// resources is a list of resources that the ClusterResourceSet has.
45    #[serde(default, skip_serializing_if = "Option::is_none")]
46    pub resources: Option<Vec<ClusterResourceSetBindingBindingsResources>>,
47}
48
49/// ResourceBinding shows the status of a resource that belongs to a ClusterResourceSet matched by the owner cluster of the ClusterResourceSetBinding object.
50#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
51pub struct ClusterResourceSetBindingBindingsResources {
52    /// applied is to track if a resource is applied to the cluster or not.
53    pub applied: bool,
54    /// hash is the hash of a resource's data. This can be used to decide if a resource is changed.
55    /// For "ApplyOnce" ClusterResourceSet.spec.strategy, this is no-op as that strategy does not act on change.
56    #[serde(default, skip_serializing_if = "Option::is_none")]
57    pub hash: Option<String>,
58    /// kind of the resource. Supported kinds are: Secrets and ConfigMaps.
59    pub kind: ClusterResourceSetBindingBindingsResourcesKind,
60    /// lastAppliedTime identifies when this resource was last applied to the cluster.
61    #[serde(
62        default,
63        skip_serializing_if = "Option::is_none",
64        rename = "lastAppliedTime"
65    )]
66    pub last_applied_time: Option<String>,
67    /// name of the resource that is in the same namespace with ClusterResourceSet object.
68    pub name: String,
69}
70
71/// ResourceBinding shows the status of a resource that belongs to a ClusterResourceSet matched by the owner cluster of the ClusterResourceSetBinding object.
72#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
73pub enum ClusterResourceSetBindingBindingsResourcesKind {
74    Secret,
75    ConfigMap,
76}