Skip to main content

k8s_crds_helm_controller/
helmchartconfigs.rs

1// WARNING: generated by kopium - manual changes will be overwritten
2// kopium command: kopium -f helmchartconfigs.yml --schema=derived --docs -b --derive=Default --derive=PartialEq --smart-derive-elision
3// kopium version: 0.23.0
4
5#[allow(unused_imports)]
6mod prelude {
7    pub use kube_derive::CustomResource;
8    #[cfg(feature = "schemars")]
9    pub use schemars::JsonSchema;
10    pub use serde::{Deserialize, Serialize};
11    #[cfg(feature = "builder")]
12    pub use typed_builder::TypedBuilder;
13}
14
15use self::prelude::*;
16
17/// HelmChartConfigSpec represents additional user-configurable details of an installed and configured Helm chart release.
18/// These fields are merged with or override the corresponding fields on the related HelmChart resource.
19#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
20#[cfg_attr(feature = "builder", derive(TypedBuilder))]
21#[cfg_attr(feature = "schemars", derive(JsonSchema))]
22#[cfg_attr(not(feature = "schemars"), kube(schema = "disabled"))]
23#[kube(
24    group = "helm.cattle.io",
25    version = "v1",
26    kind = "HelmChartConfig",
27    plural = "helmchartconfigs"
28)]
29#[kube(namespaced)]
30#[kube(derive = "Default")]
31#[kube(derive = "PartialEq")]
32pub struct HelmChartConfigSpec {
33    /// Configures handling of failed chart installation or upgrades.
34    /// - `abort` will take no action and leave the chart in a failed state so that the administrator can manually resolve the error.
35    /// - `reinstall` will perform a clean uninstall and reinstall of the chart; this is the default behavior.
36    /// - `retry` will attempt to retry the install or upgrade whenever chart configuration changes.
37    #[serde(
38        default,
39        skip_serializing_if = "Option::is_none",
40        rename = "failurePolicy"
41    )]
42    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
43    pub failure_policy: Option<HelmChartConfigFailurePolicy>,
44    /// Set to true if helm should configure server-side apply to force changes when conflicts arise in ownership of managed fields.
45    /// Helm CLI positional argument/flag: `--force-conflicts`
46    #[serde(
47        default,
48        skip_serializing_if = "Option::is_none",
49        rename = "forceConflicts"
50    )]
51    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
52    pub force_conflicts: Option<bool>,
53    /// Set to true if helm should enable server-side apply when updating objects. Defaults to `true` for install, and `auto` for upgrade.
54    /// - `true` enables server-side apply.
55    /// - `false` disables server-side apply.
56    /// - `auto` enables server-side apply if the chart was installed with server-side apply enabled.
57    /// Helm CLI positional argument/flag: `--server-side`
58    #[serde(
59        default,
60        skip_serializing_if = "Option::is_none",
61        rename = "serverSide"
62    )]
63    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
64    pub server_side: Option<HelmChartConfigServerSide>,
65    /// Override complex Chart values via structured YAML. Takes precedence over options set via valuesContent.
66    /// Helm CLI positional argument/flag: `--values`
67    #[serde(default, skip_serializing_if = "Option::is_none")]
68    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
69    pub values: Option<serde_json::Value>,
70    /// Override complex Chart values via inline YAML content.
71    /// Helm CLI positional argument/flag: `--values`
72    #[serde(
73        default,
74        skip_serializing_if = "Option::is_none",
75        rename = "valuesContent"
76    )]
77    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
78    pub values_content: Option<String>,
79    /// Override complex Chart values via references to external Secrets.
80    /// Helm CLI positional argument/flag: `--values`
81    #[serde(
82        default,
83        skip_serializing_if = "Option::is_none",
84        rename = "valuesSecrets"
85    )]
86    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
87    pub values_secrets: Option<Vec<HelmChartConfigValuesSecrets>>,
88}
89
90/// HelmChartConfigSpec represents additional user-configurable details of an installed and configured Helm chart release.
91/// These fields are merged with or override the corresponding fields on the related HelmChart resource.
92#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
93#[cfg_attr(feature = "schemars", derive(JsonSchema))]
94pub enum HelmChartConfigFailurePolicy {
95    #[serde(rename = "abort")]
96    Abort,
97    #[serde(rename = "reinstall")]
98    Reinstall,
99    #[serde(rename = "retry")]
100    Retry,
101}
102
103/// HelmChartConfigSpec represents additional user-configurable details of an installed and configured Helm chart release.
104/// These fields are merged with or override the corresponding fields on the related HelmChart resource.
105#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
106#[cfg_attr(feature = "schemars", derive(JsonSchema))]
107pub enum HelmChartConfigServerSide {
108    #[serde(rename = "true")]
109    True,
110    #[serde(rename = "false")]
111    False,
112    #[serde(rename = "auto")]
113    Auto,
114}
115
116/// SecretSpec describes a key in a secret to load chart values from.
117#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
118#[cfg_attr(feature = "builder", derive(TypedBuilder))]
119#[cfg_attr(feature = "schemars", derive(JsonSchema))]
120pub struct HelmChartConfigValuesSecrets {
121    /// Ignore changes to the secret, and mark the secret as optional.
122    /// By default, the secret must exist, and changes to the secret will trigger an upgrade of the chart to apply the updated values.
123    /// If `ignoreUpdates` is true, the secret is optional, and changes to the secret will not trigger an upgrade of the chart.
124    #[serde(
125        default,
126        skip_serializing_if = "Option::is_none",
127        rename = "ignoreUpdates"
128    )]
129    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
130    pub ignore_updates: Option<bool>,
131    /// Keys to read values content from. If no keys are specified, the secret is not used.
132    #[serde(default, skip_serializing_if = "Option::is_none")]
133    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
134    pub keys: Option<Vec<String>>,
135    /// Name of the secret. Must be in the same namespace as the HelmChart resource.
136    #[serde(default, skip_serializing_if = "Option::is_none")]
137    #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
138    pub name: Option<String>,
139}