Skip to content

Commit

Permalink
migrations: add migration for kubelet setting pod-pids-limit
Browse files Browse the repository at this point in the history
Adds a migration for a new setting `kubelet-pod-pids-limit`.
  • Loading branch information
gthao313 committed May 17, 2022
1 parent c17682d commit fbc6585
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions Release.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
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 @@ -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",

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "kubelet-pod-pids-limit"
version = "0.1.0"
authors = ["Tianhao Geng <tianhg@amazon.com>"]
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"}
Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit fbc6585

Please sign in to comment.