Skip to content

Commit 0ba5714

Browse files
mayastor-borstiagolobocastroniladrih
committed
chore(bors): merge pull request #746
746: fix: move bitnami images to openebs r=pchandra19 a=tiagolobocastro The bitnami docker repo was migrated on the 28Nov, so let's just move these to our dockerhub since that one is not going anywhere. We should consider doing this for other dependencies. Co-authored-by: Tiago Castro <[email protected]> Co-authored-by: Niladri Halder <[email protected]>
2 parents 33571a6 + b687f47 commit 0ba5714

File tree

4 files changed

+72
-6
lines changed

4 files changed

+72
-6
lines changed

chart/values.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,11 @@ etcd:
559559
repository: openebs/alpine-bash
560560
tag: 4.1.0
561561
pullSecrets: []
562-
# extra debug information on logs
563-
debug: false
564-
562+
image:
563+
registry: docker.io
564+
repository: openebs/etcd
565+
# extra debug information on logs
566+
debug: false
565567
# -- Pod anti-affinity preset
566568
# Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity
567569
podAntiAffinityPreset: "hard"

k8s/upgrade/src/common/constants.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,6 @@ pub(crate) const TWO_DOT_SEVEN_DOT_TWO: &str = "2.7.2";
6060

6161
/// Version value for 2.7.3.
6262
pub(crate) const TWO_DOT_SEVEN_DOT_THREE: &str = "2.7.3";
63+
64+
/// Version value for 2.7.8.
65+
pub(crate) const TWO_DOT_SEVEN_DOT_EIGHT: &str = "2.7.8";

k8s/upgrade/src/helm/chart.rs

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ pub(crate) struct CoreValues {
7171
agents: Agents,
7272
/// This contains values for all the base components.
7373
base: Base,
74+
/// This contains values for all of the Etcd components,
75+
etcd: Etcd,
7476
/// This is the yaml object which contains values for the container image registry, repository,
7577
/// tag, etc.
7678
image: Image,
@@ -325,6 +327,36 @@ impl CoreValues {
325327
pub(crate) fn jaeger_operator_image_tag(&self) -> &str {
326328
self.jaeger_operator.image_tag()
327329
}
330+
331+
/// Returns the value of .etcd.debug (as seen on etcd chart v8.6.0).
332+
pub(crate) fn etcd_deprecated_debug_logs(&self) -> Option<bool> {
333+
self.etcd.deprecated_debug_logs()
334+
}
335+
336+
/// Returns the image repository of the etcd container.
337+
pub(crate) fn etcd_image_repo(&self) -> &str {
338+
self.etcd.image_repository()
339+
}
340+
}
341+
342+
/// This is used to deserialize the yaml object etcd.
343+
#[derive(Deserialize)]
344+
#[serde(rename_all(deserialize = "camelCase"))]
345+
struct Etcd {
346+
image: GenericImage,
347+
#[serde(rename(deserialize = "debug"))]
348+
deprecated_debug: Option<bool>,
349+
}
350+
351+
impl Etcd {
352+
/// Returns the value of .etcd.autoCompactionRetention.
353+
fn deprecated_debug_logs(&self) -> Option<bool> {
354+
self.deprecated_debug
355+
}
356+
357+
fn image_repository(&self) -> &str {
358+
self.image.repository()
359+
}
328360
}
329361

330362
/// This is used to deserialize the yaml object agents.
@@ -1177,13 +1209,19 @@ impl LocalpvProvisionerLocalpv {
11771209
struct GenericImage {
11781210
#[serde(default)]
11791211
tag: String,
1212+
#[serde(default)]
1213+
repository: String,
11801214
}
11811215

11821216
impl GenericImage {
1183-
/// This is getter for the various container image tags in the localpv-provisioner helm chart.
1217+
/// This is getter for various container image tags.
11841218
fn tag(&self) -> &str {
11851219
self.tag.as_str()
11861220
}
1221+
/// This is a getter for the various container image repositories.
1222+
fn repository(&self) -> &str {
1223+
self.repository.as_str()
1224+
}
11871225
}
11881226

11891227
/// This is used to deserialize the 'helperPod' yaml object in the localpv-provisioner helm chart.

k8s/upgrade/src/helm/values.rs

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ use crate::{
22
common::{
33
constants::{
44
KUBE_API_PAGE_SIZE, TWO_DOT_FIVE, TWO_DOT_FOUR, TWO_DOT_ONE, TWO_DOT_O_RC_ONE,
5-
TWO_DOT_SEVEN_DOT_THREE, TWO_DOT_SEVEN_DOT_TWO, TWO_DOT_SIX, TWO_DOT_THREE,
5+
TWO_DOT_SEVEN_DOT_EIGHT, TWO_DOT_SEVEN_DOT_THREE, TWO_DOT_SEVEN_DOT_TWO, TWO_DOT_SIX,
6+
TWO_DOT_THREE,
67
},
78
error::{
89
DeserializePromtailExtraConfig, ListCrds, Result, SemverParse,
@@ -522,6 +523,24 @@ where
522523
)?;
523524
}
524525

526+
// Special-case values for 2.7.8
527+
let two_dot_seven_dot_eight = Version::parse(TWO_DOT_SEVEN_DOT_EIGHT).context(SemverParse {
528+
version_string: TWO_DOT_SEVEN_DOT_EIGHT.to_string(),
529+
})?;
530+
if source_version.ge(&two_dot_o_rc_zero) && source_version.lt(&two_dot_seven_dot_eight) {
531+
if let Some(debug_logs) = source_values.etcd_deprecated_debug_logs() {
532+
yq.delete_object(
533+
YamlKey::try_from(".etcd.debug")?,
534+
upgrade_values_file.path(),
535+
)?;
536+
yq.set_literal_value(
537+
YamlKey::try_from(".etcd.image.debug")?,
538+
debug_logs,
539+
upgrade_values_file.path(),
540+
)?;
541+
}
542+
}
543+
525544
// Default options.
526545
// Image tag is set because the high_priority file is the user's source options file.
527546
// The target's image tag needs to be set for PRODUCT upgrade.
@@ -572,7 +591,11 @@ where
572591
target_values.localpv_helper_image_tag(),
573592
upgrade_values_file.path(),
574593
)?;
575-
594+
yq.set_literal_value(
595+
YamlKey::try_from(".etcd.image.repository")?,
596+
target_values.etcd_image_repo(),
597+
upgrade_values_file.path(),
598+
)?;
576599
// Disable CRD installation in case they already exist using helm values.
577600
safe_crd_install(upgrade_values_file.path(), &yq).await?;
578601

0 commit comments

Comments
 (0)