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

Remove host container migration #4324

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 3 additions & 1 deletion Release.toml
Original file line number Diff line number Diff line change
Expand Up @@ -395,4 +395,6 @@ version = "1.33.0"
"migrate_v1.31.0_public-control-container-v0-7-20.lz4",
]
"(1.31.0, 1.32.0)" = []
"(1.32.0, 1.33.0)" = []
"(1.32.0, 1.33.0)" = [
"migrate_v1.33.0_aws-remove-schnauzer-admin.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 @@ -83,6 +83,7 @@ members = [
"settings-migrations/v1.31.0/public-admin-container-v0-11-16",
"settings-migrations/v1.31.0/aws-control-container-v0-7-20",
"settings-migrations/v1.31.0/public-control-container-v0-7-20",
"settings-migrations/v1.33.0/aws-remove-schnauzer-admin",

"settings-plugins/aws-dev",
"settings-plugins/aws-ecs-1",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "aws-remove-schnauzer-admin"
version = "0.1.0"
authors = ["Shikha Vyaghra <[email protected]>"]
license = "Apache-2.0 OR MIT"
edition = "2021"
publish = false
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]


# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
migration-helpers.workspace = true
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
use migration_helpers::common_migrations::RemoveSchnauzerMigration;
use migration_helpers::{migrate, Result};
use std::process;

const OLD_ADMIN_CTR_CMDLINE: &str =
"schnauzer-v2 render --requires 'aws@v1(helpers=[ecr-prefix])' --template '{{ ecr-prefix settings.aws.region }}/bottlerocket-admin:v0.11.16'";

/// We bumped the version of the default admin container
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: inaccurate comment.

fn run() -> Result<()> {
migrate(RemoveSchnauzerMigration {
setting: "settings.host-containers.admin.source",
old_cmdline: OLD_ADMIN_CTR_CMDLINE,
})
}

// 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);
}
}