diff --git a/Release.toml b/Release.toml index f2f54fa1103..1b9782d30f1 100644 --- a/Release.toml +++ b/Release.toml @@ -38,3 +38,6 @@ version = "1.0.8" "migrate_v1.0.8_admin-container-v0-7-0.lz4", "migrate_v1.0.8_add-bootstrap-containers.lz4" ] +"(1.0.8, 1.1.0)" = [ + "migrate_v1.1.0_kubelet-server-tls-bootstrap.lz4", +] diff --git a/sources/Cargo.lock b/sources/Cargo.lock index 3f97530284f..2148ec4e3f0 100644 --- a/sources/Cargo.lock +++ b/sources/Cargo.lock @@ -1732,6 +1732,13 @@ dependencies = [ "migration-helpers", ] +[[package]] +name = "kubelet-server-tls-bootstrap" +version = "0.1.0" +dependencies = [ + "migration-helpers", +] + [[package]] name = "kubelet-standalone-tls-services" version = "0.1.0" diff --git a/sources/Cargo.toml b/sources/Cargo.toml index 4ce8adb3d96..cf298a97d33 100644 --- a/sources/Cargo.toml +++ b/sources/Cargo.toml @@ -53,6 +53,7 @@ members = [ "api/migration/migrations/v1.0.8/control-container-v0-5-0", "api/migration/migrations/v1.0.8/admin-container-v0-7-0", "api/migration/migrations/v1.0.8/add-bootstrap-containers", + "api/migration/migrations/v1.1.0/kubelet-server-tls-bootstrap", "bottlerocket-release", diff --git a/sources/api/migration/migrations/v1.1.0/kubelet-server-tls-bootstrap/Cargo.toml b/sources/api/migration/migrations/v1.1.0/kubelet-server-tls-bootstrap/Cargo.toml new file mode 100644 index 00000000000..e0601021139 --- /dev/null +++ b/sources/api/migration/migrations/v1.1.0/kubelet-server-tls-bootstrap/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "kubelet-server-tls-bootstrap" +version = "0.1.0" +authors = ["Erikson Tung "] +license = "Apache-2.0 OR MIT" +edition = "2018" +publish = false + +[dependencies] +migration-helpers = { path = "../../../migration-helpers" } diff --git a/sources/api/migration/migrations/v1.1.0/kubelet-server-tls-bootstrap/src/main.rs b/sources/api/migration/migrations/v1.1.0/kubelet-server-tls-bootstrap/src/main.rs new file mode 100644 index 00000000000..b5f947d34e6 --- /dev/null +++ b/sources/api/migration/migrations/v1.1.0/kubelet-server-tls-bootstrap/src/main.rs @@ -0,0 +1,22 @@ +#![deny(rust_2018_idioms)] + +use migration_helpers::common_migrations::AddSettingsMigration; +use migration_helpers::{migrate, Result}; +use std::process; + +/// We added a new setting for configuring kubelet, `kubernetes.server-tls-bootstrap` +fn run() -> Result<()> { + migrate(AddSettingsMigration(&[ + "settings.kubernetes.server-tls-bootstrap", + ])) +} + +// 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); + } +}