Skip to main content

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