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

defaults, migrations: control container version bump to v0.4.2 #1344

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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"