Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(upgrade-job): use default value for missing values with helm 3.13 & 3.14 #479

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions k8s/upgrade/src/bin/upgrade-job/helm/chart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ impl LokiStack {
#[derive(Deserialize)]
#[serde(rename_all(deserialize = "camelCase"))]
struct Filebeat {
#[serde(default)]
image_tag: String,
}

Expand All @@ -692,6 +693,7 @@ impl Filebeat {
#[derive(Deserialize)]
#[serde(rename_all(deserialize = "camelCase"))]
struct Grafana {
#[serde(default)]
download_dashboards_image: GrafanaDownloadDashboardsImage,
image: GenericImage,
sidecar: GrafanaSidecar,
Expand All @@ -715,8 +717,9 @@ impl Grafana {
}

/// This is used to deserialize the YAML object 'loki-stack.grafana.downloadDashboardsImage'.
#[derive(Deserialize)]
#[derive(Default, Deserialize)]
struct GrafanaDownloadDashboardsImage {
#[serde(default)]
tag: String,
}

Expand All @@ -730,6 +733,7 @@ impl GrafanaDownloadDashboardsImage {
/// This is used to deserialize the YAML object 'loki-stack.grafana.sidecar'.
#[derive(Deserialize)]
struct GrafanaSidecar {
#[serde(default)]
image: GenericImage,
}

Expand Down Expand Up @@ -770,9 +774,13 @@ impl Loki {
#[derive(Deserialize)]
#[serde(rename_all(deserialize = "camelCase"))]
struct Prometheus {
#[serde(default)]
alertmanager: PrometheusAlertmanager,
#[serde(default)]
node_exporter: PrometheusNodeExporter,
#[serde(default)]
pushgateway: PrometheusPushgateway,
#[serde(default)]
server: PrometheusServer,
}

Expand All @@ -799,8 +807,9 @@ impl Prometheus {
}

/// This is used to deserialize the prometheus chart's alertmanager YAML object.
#[derive(Deserialize)]
#[derive(Default, Deserialize)]
struct PrometheusAlertmanager {
#[serde(default)]
image: GenericImage,
}

Expand All @@ -811,8 +820,9 @@ impl PrometheusAlertmanager {
}

/// This is used to deserialize the prometheus chart's nodeExporter YAML object.
#[derive(Deserialize)]
#[derive(Default, Deserialize)]
struct PrometheusNodeExporter {
#[serde(default)]
image: GenericImage,
}

Expand All @@ -823,8 +833,9 @@ impl PrometheusNodeExporter {
}

/// This is used to deserialize the prometheus chart's pushgateway YAML object.
#[derive(Deserialize)]
#[derive(Default, Deserialize)]
struct PrometheusPushgateway {
#[serde(default)]
image: GenericImage,
}

Expand All @@ -835,8 +846,9 @@ impl PrometheusPushgateway {
}

/// This is used to deserialize the prometheus chart's server YAML object.
#[derive(Deserialize)]
#[derive(Default, Deserialize)]
struct PrometheusServer {
#[serde(default)]
image: GenericImage,
}

Expand Down Expand Up @@ -1028,6 +1040,7 @@ impl LocalpvProvisionerLocalpv {
/// chart.
#[derive(Default, Deserialize)]
struct GenericImage {
#[serde(default)]
tag: String,
}

Expand All @@ -1054,6 +1067,7 @@ impl LocalpvProvisionerHelperPod {
/// This is used to deserialize the '.jaeger-operator' yaml object.
#[derive(Deserialize)]
struct JaegerOperator {
#[serde(default)]
image: GenericImage,
}

Expand Down
Loading