Skip to content

Commit

Permalink
chore(bors): merge pull request #479
Browse files Browse the repository at this point in the history
479: fix(upgrade-job): use default value for missing values with helm 3.13 & 3.14 r=niladrih a=niladrih

The underlying logic would need to change going forward to get the exhaustive set of values, but so far we're not using any of the values facing the errors for comparison, so they may be set to their default value when deserialising the source helm chart values.


Ref: Helm issue 12936

Co-authored-by: Niladri Halder <niladri.halder26@gmail.com>
  • Loading branch information
mayastor-bors and niladrih committed Apr 11, 2024
2 parents b9c0d3c + 5f1cecb commit 18d9e94
Showing 1 changed file with 19 additions and 5 deletions.
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

0 comments on commit 18d9e94

Please sign in to comment.