Skip to content

Commit

Permalink
K8s kubelet reserved-cpus migration
Browse files Browse the repository at this point in the history
  • Loading branch information
james-masson committed Jun 7, 2024
1 parent 1dbe2bb commit da86138
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions Release.toml
Original file line number Diff line number Diff line change
Expand Up @@ -318,4 +318,5 @@ version = "1.21.0"
"migrate_v1.21.0_pod-infra-container-image-remove-settings-generator.lz4",
"migrate_v1.21.0_pod-infra-container-image-affected-services.lz4",
"migrate_v1.21.0_pod-infra-container-image-services.lz4",
"migrate_v1.21.0_k8s-reserved-cpus-v0-1-0.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 @@ -27,6 +27,7 @@ members = [
"api/migration/migrations/v1.21.0/pod-infra-container-image-affected-services",
"api/migration/migrations/v1.21.0/pod-infra-container-image-remove-settings-generator",
"api/migration/migrations/v1.21.0/pod-infra-container-image-services",
"api/migration/migrations/v1.21.0/k8s-reserved-cpus-v0-1-0",

"bloodhound",

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "k8s-reserved-cpus-v0-1-0"
version = "0.1.0"
authors = ["James Masson <[email protected]>"]
license = "Apache-2.0 OR MIT"
edition = "2021"
publish = false

[dependencies]
migration-helpers = { path = "../../../migration-helpers", version = "0.1.0" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
use migration_helpers::common_migrations::AddSettingsMigration;
use migration_helpers::{migrate, Result};
use std::process;

/// Add the option to set Kubernetes reserved-cpus
fn run() -> Result<()> {
migrate(AddSettingsMigration(&["settings.kubernetes.reserved-cpus"]))
}

// 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 da86138

Please sign in to comment.