From ea9b951c44b2d5294e562aee6eb40583b2ca21e1 Mon Sep 17 00:00:00 2001 From: Kyle Sessions Date: Tue, 7 May 2024 01:11:22 +0000 Subject: [PATCH 1/4] host-containers: update admin container to v0.11.8 Signed-off-by: Kyle Sessions --- sources/models/shared-defaults/aws-host-containers.toml | 2 +- sources/models/shared-defaults/public-host-containers.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/models/shared-defaults/aws-host-containers.toml b/sources/models/shared-defaults/aws-host-containers.toml index fa1f1a500ce..4376a838dad 100644 --- a/sources/models/shared-defaults/aws-host-containers.toml +++ b/sources/models/shared-defaults/aws-host-containers.toml @@ -3,7 +3,7 @@ enabled = false superpowered = true [metadata.settings.host-containers.admin.source] -setting-generator = "schnauzer-v2 render --requires 'aws@v1(helpers=[ecr-prefix])' --template '{{ ecr-prefix settings.aws.region }}/bottlerocket-admin:v0.11.7'" +setting-generator = "schnauzer-v2 render --requires 'aws@v1(helpers=[ecr-prefix])' --template '{{ ecr-prefix settings.aws.region }}/bottlerocket-admin:v0.11.8'" [metadata.settings.host-containers.admin.user-data] setting-generator = "shibaken generate-admin-userdata" diff --git a/sources/models/shared-defaults/public-host-containers.toml b/sources/models/shared-defaults/public-host-containers.toml index abc0f48767f..3c8df08aa61 100644 --- a/sources/models/shared-defaults/public-host-containers.toml +++ b/sources/models/shared-defaults/public-host-containers.toml @@ -6,7 +6,7 @@ [settings.host-containers.admin] enabled = false superpowered = true -source = "public.ecr.aws/bottlerocket/bottlerocket-admin:v0.11.7" +source = "public.ecr.aws/bottlerocket/bottlerocket-admin:v0.11.8" [settings.host-containers.control] enabled = false From 463f6f761af373498c13c842b5f4001741494cb3 Mon Sep 17 00:00:00 2001 From: Kyle Sessions Date: Tue, 7 May 2024 01:12:15 +0000 Subject: [PATCH 2/4] host-containers: update control container to v0.7.12 Signed-off-by: Kyle Sessions --- sources/models/shared-defaults/aws-host-containers.toml | 2 +- sources/models/shared-defaults/public-host-containers.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/models/shared-defaults/aws-host-containers.toml b/sources/models/shared-defaults/aws-host-containers.toml index 4376a838dad..bbc175bbefe 100644 --- a/sources/models/shared-defaults/aws-host-containers.toml +++ b/sources/models/shared-defaults/aws-host-containers.toml @@ -13,4 +13,4 @@ enabled = true superpowered = false [metadata.settings.host-containers.control.source] -setting-generator = "schnauzer-v2 render --requires 'aws@v1(helpers=[ecr-prefix])' --template '{{ ecr-prefix settings.aws.region }}/bottlerocket-control:v0.7.11'" +setting-generator = "schnauzer-v2 render --requires 'aws@v1(helpers=[ecr-prefix])' --template '{{ ecr-prefix settings.aws.region }}/bottlerocket-control:v0.7.12'" diff --git a/sources/models/shared-defaults/public-host-containers.toml b/sources/models/shared-defaults/public-host-containers.toml index 3c8df08aa61..1205f388461 100644 --- a/sources/models/shared-defaults/public-host-containers.toml +++ b/sources/models/shared-defaults/public-host-containers.toml @@ -11,4 +11,4 @@ source = "public.ecr.aws/bottlerocket/bottlerocket-admin:v0.11.8" [settings.host-containers.control] enabled = false superpowered = false -source = "public.ecr.aws/bottlerocket/bottlerocket-control:v0.7.11" +source = "public.ecr.aws/bottlerocket/bottlerocket-control:v0.7.12" From bea97adab37e633acf2773424df2a13a0da0259b Mon Sep 17 00:00:00 2001 From: Kyle Sessions Date: Tue, 7 May 2024 01:19:20 +0000 Subject: [PATCH 3/4] migrations: migrate to admin container v0.11.8 Signed-off-by: Kyle Sessions --- Release.toml | 2 ++ sources/Cargo.lock | 14 ++++++++++ sources/Cargo.toml | 2 ++ .../aws-admin-container-v0-11-8/Cargo.toml | 16 +++++++++++ .../aws-admin-container-v0-11-8/src/main.rs | 27 +++++++++++++++++++ .../public-admin-container-v0-11-8/Cargo.toml | 16 +++++++++++ .../src/main.rs | 25 +++++++++++++++++ 7 files changed, 102 insertions(+) create mode 100644 sources/api/migration/migrations/v1.20.0/aws-admin-container-v0-11-8/Cargo.toml create mode 100644 sources/api/migration/migrations/v1.20.0/aws-admin-container-v0-11-8/src/main.rs create mode 100644 sources/api/migration/migrations/v1.20.0/public-admin-container-v0-11-8/Cargo.toml create mode 100644 sources/api/migration/migrations/v1.20.0/public-admin-container-v0-11-8/src/main.rs diff --git a/Release.toml b/Release.toml index e8121123fff..c3c68b61116 100644 --- a/Release.toml +++ b/Release.toml @@ -307,4 +307,6 @@ version = "1.20.0" "migrate_v1.20.0_static-pods-services-cfg-v0-1-0.lz4", "migrate_v1.20.0_container-runtime-nvidia.lz4", "migrate_v1.20.0_container-runtime-metadata-nvidia.lz4", + "migrate_v1.20.0_aws-admin-container-v0-11-8.lz4", + "migrate_v1.20.0_public-admin-container-v0-11-8.lz4", ] diff --git a/sources/Cargo.lock b/sources/Cargo.lock index 1d28cad9791..ad6b62cc086 100644 --- a/sources/Cargo.lock +++ b/sources/Cargo.lock @@ -582,6 +582,13 @@ dependencies = [ "migration-helpers", ] +[[package]] +name = "aws-admin-container-v0-11-8" +version = "0.1.0" +dependencies = [ + "migration-helpers", +] + [[package]] name = "aws-config" version = "1.1.8" @@ -3327,6 +3334,13 @@ dependencies = [ "migration-helpers", ] +[[package]] +name = "public-admin-container-v0-11-8" +version = "0.1.0" +dependencies = [ + "migration-helpers", +] + [[package]] name = "public-control-container-v0-7-10" version = "0.1.0" diff --git a/sources/Cargo.toml b/sources/Cargo.toml index 238e8340622..156dacf43a6 100644 --- a/sources/Cargo.toml +++ b/sources/Cargo.toml @@ -86,6 +86,8 @@ members = [ "api/migration/migrations/v1.19.5/public-admin-container-v0-11-7", "api/migration/migrations/v1.20.0/container-runtime-nvidia", "api/migration/migrations/v1.20.0/container-runtime-metadata-nvidia", + "api/migration/migrations/v1.20.0/aws-admin-container-v0-11-8", + "api/migration/migrations/v1.20.0/public-admin-container-v0-11-8", "bloodhound", diff --git a/sources/api/migration/migrations/v1.20.0/aws-admin-container-v0-11-8/Cargo.toml b/sources/api/migration/migrations/v1.20.0/aws-admin-container-v0-11-8/Cargo.toml new file mode 100644 index 00000000000..ddffbd3cc4a --- /dev/null +++ b/sources/api/migration/migrations/v1.20.0/aws-admin-container-v0-11-8/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "aws-admin-container-v0-11-8" +version = "0.1.0" +authors = ["Kyle Sessions "] +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 = { path = "../../../migration-helpers", version = "0.1.0"} + diff --git a/sources/api/migration/migrations/v1.20.0/aws-admin-container-v0-11-8/src/main.rs b/sources/api/migration/migrations/v1.20.0/aws-admin-container-v0-11-8/src/main.rs new file mode 100644 index 00000000000..8b1d7a31265 --- /dev/null +++ b/sources/api/migration/migrations/v1.20.0/aws-admin-container-v0-11-8/src/main.rs @@ -0,0 +1,27 @@ +use migration_helpers::common_migrations::ReplaceSchnauzerMigration; +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.7'"; +const NEW_ADMIN_CTR_CMDLINE: &str = + "schnauzer-v2 render --requires 'aws@v1(helpers=[ecr-prefix])' --template '{{ ecr-prefix settings.aws.region }}/bottlerocket-admin:v0.11.8'"; + +/// We bumped the version of the default admin container +fn run() -> Result<()> { + migrate(ReplaceSchnauzerMigration { + setting: "settings.host-containers.admin.source", + old_schnauzer_cmdline: OLD_ADMIN_CTR_CMDLINE, + new_schnauzer_cmdline: NEW_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); + } +} diff --git a/sources/api/migration/migrations/v1.20.0/public-admin-container-v0-11-8/Cargo.toml b/sources/api/migration/migrations/v1.20.0/public-admin-container-v0-11-8/Cargo.toml new file mode 100644 index 00000000000..e672d43dfd2 --- /dev/null +++ b/sources/api/migration/migrations/v1.20.0/public-admin-container-v0-11-8/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "public-admin-container-v0-11-8" +version = "0.1.0" +authors = ["Kyle Sessions "] +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 = { path = "../../../migration-helpers", version = "0.1.0"} + diff --git a/sources/api/migration/migrations/v1.20.0/public-admin-container-v0-11-8/src/main.rs b/sources/api/migration/migrations/v1.20.0/public-admin-container-v0-11-8/src/main.rs new file mode 100644 index 00000000000..3a07b4681f8 --- /dev/null +++ b/sources/api/migration/migrations/v1.20.0/public-admin-container-v0-11-8/src/main.rs @@ -0,0 +1,25 @@ +use migration_helpers::common_migrations::ReplaceStringMigration; +use migration_helpers::{migrate, Result}; +use std::process; + +const OLD_ADMIN_CTR_SOURCE_VAL: &str = "public.ecr.aws/bottlerocket/bottlerocket-admin:v0.11.7"; +const NEW_ADMIN_CTR_SOURCE_VAL: &str = "public.ecr.aws/bottlerocket/bottlerocket-admin:v0.11.8"; + +/// We bumped the version of the default admin container +fn run() -> Result<()> { + migrate(ReplaceStringMigration { + setting: "settings.host-containers.admin.source", + old_val: OLD_ADMIN_CTR_SOURCE_VAL, + new_val: NEW_ADMIN_CTR_SOURCE_VAL, + }) +} + +// 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); + } +} From b46c719afa4998e77fc6617d011f06fd30cc2251 Mon Sep 17 00:00:00 2001 From: Kyle Sessions Date: Tue, 7 May 2024 01:20:59 +0000 Subject: [PATCH 4/4] migrations: migrate to control container v0.7.12 Signed-off-by: Kyle Sessions --- Release.toml | 2 ++ sources/Cargo.lock | 14 ++++++++++ sources/Cargo.toml | 2 ++ .../aws-control-container-v0-7-12/Cargo.toml | 16 +++++++++++ .../aws-control-container-v0-7-12/src/main.rs | 27 +++++++++++++++++++ .../Cargo.toml | 16 +++++++++++ .../src/main.rs | 25 +++++++++++++++++ 7 files changed, 102 insertions(+) create mode 100644 sources/api/migration/migrations/v1.20.0/aws-control-container-v0-7-12/Cargo.toml create mode 100644 sources/api/migration/migrations/v1.20.0/aws-control-container-v0-7-12/src/main.rs create mode 100644 sources/api/migration/migrations/v1.20.0/public-control-container-v0-7-12/Cargo.toml create mode 100644 sources/api/migration/migrations/v1.20.0/public-control-container-v0-7-12/src/main.rs diff --git a/Release.toml b/Release.toml index c3c68b61116..cb202e8fca6 100644 --- a/Release.toml +++ b/Release.toml @@ -309,4 +309,6 @@ version = "1.20.0" "migrate_v1.20.0_container-runtime-metadata-nvidia.lz4", "migrate_v1.20.0_aws-admin-container-v0-11-8.lz4", "migrate_v1.20.0_public-admin-container-v0-11-8.lz4", + "migrate_v1.20.0_aws-control-container-v0-7-12.lz4", + "migrate_v1.20.0_public-control-container-v0-7-12.lz4", ] diff --git a/sources/Cargo.lock b/sources/Cargo.lock index ad6b62cc086..be369b36f2b 100644 --- a/sources/Cargo.lock +++ b/sources/Cargo.lock @@ -633,6 +633,13 @@ dependencies = [ "migration-helpers", ] +[[package]] +name = "aws-control-container-v0-7-12" +version = "0.1.0" +dependencies = [ + "migration-helpers", +] + [[package]] name = "aws-control-container-v0-7-4" version = "0.1.0" @@ -3355,6 +3362,13 @@ dependencies = [ "migration-helpers", ] +[[package]] +name = "public-control-container-v0-7-12" +version = "0.1.0" +dependencies = [ + "migration-helpers", +] + [[package]] name = "public-control-container-v0-7-4" version = "0.1.0" diff --git a/sources/Cargo.toml b/sources/Cargo.toml index 156dacf43a6..1509bc49aca 100644 --- a/sources/Cargo.toml +++ b/sources/Cargo.toml @@ -88,6 +88,8 @@ members = [ "api/migration/migrations/v1.20.0/container-runtime-metadata-nvidia", "api/migration/migrations/v1.20.0/aws-admin-container-v0-11-8", "api/migration/migrations/v1.20.0/public-admin-container-v0-11-8", + "api/migration/migrations/v1.20.0/aws-control-container-v0-7-12", + "api/migration/migrations/v1.20.0/public-control-container-v0-7-12", "bloodhound", diff --git a/sources/api/migration/migrations/v1.20.0/aws-control-container-v0-7-12/Cargo.toml b/sources/api/migration/migrations/v1.20.0/aws-control-container-v0-7-12/Cargo.toml new file mode 100644 index 00000000000..aa1bf3a3cf7 --- /dev/null +++ b/sources/api/migration/migrations/v1.20.0/aws-control-container-v0-7-12/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "aws-control-container-v0-7-12" +version = "0.1.0" +authors = ["Kyle Sessions "] +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 = { path = "../../../migration-helpers", version = "0.1.0"} + diff --git a/sources/api/migration/migrations/v1.20.0/aws-control-container-v0-7-12/src/main.rs b/sources/api/migration/migrations/v1.20.0/aws-control-container-v0-7-12/src/main.rs new file mode 100644 index 00000000000..0f904363b14 --- /dev/null +++ b/sources/api/migration/migrations/v1.20.0/aws-control-container-v0-7-12/src/main.rs @@ -0,0 +1,27 @@ +use migration_helpers::common_migrations::ReplaceSchnauzerMigration; +use migration_helpers::{migrate, Result}; +use std::process; + +const OLD_CONTROL_CTR_CMDLINE: &str = + "schnauzer-v2 render --requires 'aws@v1(helpers=[ecr-prefix])' --template '{{ ecr-prefix settings.aws.region }}/bottlerocket-control:v0.7.11'"; +const NEW_CONTROL_CTR_CMDLINE: &str = + "schnauzer-v2 render --requires 'aws@v1(helpers=[ecr-prefix])' --template '{{ ecr-prefix settings.aws.region }}/bottlerocket-control:v0.7.12'"; + +/// We bumped the version of the default control container +fn run() -> Result<()> { + migrate(ReplaceSchnauzerMigration { + setting: "settings.host-containers.control.source", + old_schnauzer_cmdline: OLD_CONTROL_CTR_CMDLINE, + new_schnauzer_cmdline: NEW_CONTROL_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); + } +} diff --git a/sources/api/migration/migrations/v1.20.0/public-control-container-v0-7-12/Cargo.toml b/sources/api/migration/migrations/v1.20.0/public-control-container-v0-7-12/Cargo.toml new file mode 100644 index 00000000000..71bde12e104 --- /dev/null +++ b/sources/api/migration/migrations/v1.20.0/public-control-container-v0-7-12/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "public-control-container-v0-7-12" +version = "0.1.0" +authors = ["Kyle Sessions "] +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 = { path = "../../../migration-helpers", version = "0.1.0"} + diff --git a/sources/api/migration/migrations/v1.20.0/public-control-container-v0-7-12/src/main.rs b/sources/api/migration/migrations/v1.20.0/public-control-container-v0-7-12/src/main.rs new file mode 100644 index 00000000000..e2b5ede4d89 --- /dev/null +++ b/sources/api/migration/migrations/v1.20.0/public-control-container-v0-7-12/src/main.rs @@ -0,0 +1,25 @@ +use migration_helpers::common_migrations::ReplaceStringMigration; +use migration_helpers::{migrate, Result}; +use std::process; + +const OLD_CONTROL_CTR_SOURCE_VAL: &str = "public.ecr.aws/bottlerocket/bottlerocket-control:v0.7.11"; +const NEW_CONTROL_CTR_SOURCE_VAL: &str = "public.ecr.aws/bottlerocket/bottlerocket-control:v0.7.12"; + +/// We bumped the version of the default control container +fn run() -> Result<()> { + migrate(ReplaceStringMigration { + setting: "settings.host-containers.control.source", + old_val: OLD_CONTROL_CTR_SOURCE_VAL, + new_val: NEW_CONTROL_CTR_SOURCE_VAL, + }) +} + +// 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); + } +}