Skip to content

Commit

Permalink
Merge pull request #1344 from etungsten/control-container-migrate-v0.4.1
Browse files Browse the repository at this point in the history
defaults, migrations: control container version bump to v0.4.2
  • Loading branch information
etungsten committed Feb 23, 2021
2 parents c7d03b2 + d55d224 commit a9e3782
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 1 deletion.
1 change: 1 addition & 0 deletions Release.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ version = "1.0.5"
"migrate_v1.0.6_add-static-pods.lz4",
"migrate_v1.0.6_kubelet-standalone-tls-settings.lz4",
"migrate_v1.0.6_kubelet-standalone-tls-services.lz4",
"migrate_v1.0.6_control-container-v0-4-2.lz4"
]

7 changes: 7 additions & 0 deletions sources/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions sources/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ members = [
"api/migration/migrations/v1.0.6/add-static-pods",
"api/migration/migrations/v1.0.6/kubelet-standalone-tls-settings",
"api/migration/migrations/v1.0.6/kubelet-standalone-tls-services",
"api/migration/migrations/v1.0.6/control-container-v0-4-2",

"bottlerocket-release",

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "control-container-v0-4-2"
version = "0.1.0"
authors = ["Erikson Tung <etung@amazon.com>"]
license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
migration-helpers = { path = "../../../migration-helpers" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#![deny(rust_2018_idioms)]

use migration_helpers::common_migrations::ReplaceTemplateMigration;
use migration_helpers::{migrate, Result};
use std::process;

const OLD_CONTROL_CTR_TEMPLATE: &str =
"{{ ecr-prefix settings.aws.region }}/bottlerocket-control:v0.4.1";
const NEW_CONTROL_CTR_TEMPLATE: &str =
"{{ ecr-prefix settings.aws.region }}/bottlerocket-control:v0.4.2";


/// We bumped the version of the default control container from v0.4.1 to v0.4.2
fn run() -> Result<()> {
migrate(ReplaceTemplateMigration {
setting: "settings.host-containers.control.source",
old_template: OLD_CONTROL_CTR_TEMPLATE,
new_template: NEW_CONTROL_CTR_TEMPLATE,
})
}

// Returning a Result from main makes it print a Debug representation of the error, but with Snafu
// we have nice Display representations of the error, so we wrap "main" (run) and print any error.
// https://github.com/shepmaster/snafu/issues/110
fn main() {
if let Err(e) = run() {
eprintln!("{}", e);
process::exit(1);
}
}
2 changes: 1 addition & 1 deletion sources/models/shared-defaults/aws-host-containers.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ superpowered = false

[metadata.settings.host-containers.control.source]
setting-generator = "schnauzer settings.host-containers.control.source"
template = "{{ ecr-prefix settings.aws.region }}/bottlerocket-control:v0.4.1"
template = "{{ ecr-prefix settings.aws.region }}/bottlerocket-control:v0.4.2"

0 comments on commit a9e3782

Please sign in to comment.