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

Admin container v0.5.0 migration #903

Merged
merged 1 commit into from
Apr 16, 2020
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -17,6 +17,7 @@ members = [
"api/migration/migration-helpers",

# "api/migration/migrations/vX.Y.Z/...
"api/migration/migrations/v0.3.2/migrate-admin-container-v0_5_0",

"bottlerocket-release",

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "migrate-admin-container-v0_5_0"
version = "0.1.0"
authors = ["Erikson Tung <[email protected]>"]
license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false

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

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

const OLD_ADMIN_CTR_TEMPLATE: &str =
"328549459982.dkr.ecr.{{ settings.aws.region }}.amazonaws.com/bottlerocket-admin:v0.4.0";
const NEW_ADMIN_CTR_TEMPLATE: &str =
"328549459982.dkr.ecr.{{ settings.aws.region }}.amazonaws.com/bottlerocket-admin:v0.5.0";

/// We bumped the version of the default admin container from v0.4.0 to v0.5.0
fn run() -> Result<()> {
migrate(ReplaceTemplateMigration {
setting: "settings.host-containers.admin.source",
old_template: OLD_ADMIN_CTR_TEMPLATE,
new_template: NEW_ADMIN_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/defaults.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ superpowered = true

[metadata.settings.host-containers.admin.source]
setting-generator = "schnauzer settings.host-containers.admin.source"
template = "328549459982.dkr.ecr.{{ settings.aws.region }}.amazonaws.com/bottlerocket-admin:v0.4.0"
template = "328549459982.dkr.ecr.{{ settings.aws.region }}.amazonaws.com/bottlerocket-admin:v0.5.0"

[settings.host-containers.control]
enabled = true
Expand Down