diff --git a/Release.toml b/Release.toml index 5a0094264a3..dcab3d3e38e 100644 --- a/Release.toml +++ b/Release.toml @@ -117,4 +117,5 @@ version = "1.7.2" "(1.7.2, 1.8.0)" = [ "migrate_v1.8.0_boot-setting.lz4", "migrate_v1.8.0_boot-setting-metadata.lz4", + "migrate_v1.8.0_kubelet-pod-pids-limit.lz4", ] diff --git a/sources/Cargo.lock b/sources/Cargo.lock index 9ba9fa7c39c..8b6f352c4f3 100644 --- a/sources/Cargo.lock +++ b/sources/Cargo.lock @@ -1772,6 +1772,13 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "kubelet-pod-pids-limit" +version = "0.1.0" +dependencies = [ + "migration-helpers", +] + [[package]] name = "language-tags" version = "0.3.2" diff --git a/sources/Cargo.toml b/sources/Cargo.toml index 2169213041d..b57604ea539 100644 --- a/sources/Cargo.toml +++ b/sources/Cargo.toml @@ -50,6 +50,7 @@ members = [ "api/migration/migrations/v1.7.0/public-control-container-v0-6-0", "api/migration/migrations/v1.8.0/boot-setting", "api/migration/migrations/v1.8.0/boot-setting-metadata", + "api/migration/migrations/v1.8.0/kubelet-pod-pids-limit", "bottlerocket-release", diff --git a/sources/api/migration/migrations/v1.8.0/kubelet-pod-pids-limit/Cargo.toml b/sources/api/migration/migrations/v1.8.0/kubelet-pod-pids-limit/Cargo.toml new file mode 100644 index 00000000000..438ae02af1d --- /dev/null +++ b/sources/api/migration/migrations/v1.8.0/kubelet-pod-pids-limit/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "kubelet-pod-pids-limit" +version = "0.1.0" +authors = ["Tianhao Geng "] +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", version = "0.1.0"} diff --git a/sources/api/migration/migrations/v1.8.0/kubelet-pod-pids-limit/src/main.rs b/sources/api/migration/migrations/v1.8.0/kubelet-pod-pids-limit/src/main.rs new file mode 100644 index 00000000000..11e5a1215d1 --- /dev/null +++ b/sources/api/migration/migrations/v1.8.0/kubelet-pod-pids-limit/src/main.rs @@ -0,0 +1,22 @@ +#![deny(rust_2018_idioms)] + +use migration_helpers::common_migrations::AddPrefixesMigration; +use migration_helpers::{migrate, Result}; +use std::process; + +/// We added a new setting for configuring pod-pids-limit, `settings.kubernetes.pod-pids-limit` +fn run() -> Result<()> { + migrate(AddPrefixesMigration(vec![ + "settings.kubernetes.pod-pids-limit", + ])) +} + +// 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); + } +}