Skip to content

Commit

Permalink
migrations: add migrations for cpu-manager-policy and cpu-manager-rec…
Browse files Browse the repository at this point in the history
…oncile-period

adds migration for two new settings `settings.kubernetes.cpu-manager-policy`
and `settings.kubernetes.cpu-manager-reconcile-period`
  • Loading branch information
gthao313 committed Jul 7, 2021
1 parent db6c8d4 commit 48638ed
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions Release.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ version = "1.1.2"
]
"(1.1.2, 1.1.3)" = [
"migrate_v1.1.3_kubelet-cpu-manager-state.lz4",
"migrate_v1.1.3_kubelet-cpu-manager.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 @@ -36,6 +36,7 @@ members = [
"api/migration/migrations/v1.1.2/admin-container-v0-7-1",
"api/migration/migrations/v1.1.2/control-container-v0-5-1",
"api/migration/migrations/v1.1.3/kubelet-cpu-manager-state",
"api/migration/migrations/v1.1.3/kubelet-cpu-manager",

"bottlerocket-release",

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "kubelet-cpu-manager"
version = "0.1.0"
authors = ["Tianhao Geng <[email protected]>"]
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" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#![deny(rust_2018_idioms)]

use migration_helpers::common_migrations::AddSettingsMigration;
use migration_helpers::{migrate, Result};
use std::process;

/// We added two new settings for configuring kubelet, `settings.kubernetes.cpu-manager-reconcile-period`
/// and `settings.kubernetes.cpu-manager-policy`
fn run() -> Result<()> {
migrate(AddSettingsMigration(&[
"settings.kubernetes.cpu-manager-policy",
"settings.kubernetes.cpu-manager-reconcile-period",
]))
}

// 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 48638ed

Please sign in to comment.