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 ae7d317 commit 501cba8
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 @@ -315,4 +315,5 @@ version = "1.21.0"
"(1.20.0, 1.20.1)" = []
"(1.20.1, 1.21.0)" = [
"migrate_v1.21.0_pluto-remove-generators-v0-1-0.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 @@ -24,6 +24,7 @@ members = [
# "api/migration/migrations/vX.Y.Z/..."
# (all previous migrations archived; add new ones after this line)
"api/migration/migrations/v1.21.0/pluto-remove-generators-v0-1-0",
"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 501cba8

Please sign in to comment.