diff --git a/Release.toml b/Release.toml index d652efe9ea9..802c3b6a33d 100644 --- a/Release.toml +++ b/Release.toml @@ -477,4 +477,5 @@ version = "1.64.0" ] "(1.63.0, 1.64.0)" = [ "migrate_v1.64.0_kubernetes-container-runtime-endpoint.lz4", + "migrate_v1.64.0_hugepages-settings.lz4" ] diff --git a/sources/Cargo.lock b/sources/Cargo.lock index 3c211f03534..578573211e6 100644 --- a/sources/Cargo.lock +++ b/sources/Cargo.lock @@ -959,6 +959,13 @@ dependencies = [ "snafu", ] +[[package]] +name = "hugepages-settings" +version = "0.1.0" +dependencies = [ + "migration-helpers", +] + [[package]] name = "icu_collections" version = "2.1.1" diff --git a/sources/Cargo.toml b/sources/Cargo.toml index 3a80b85da24..f3318f335c0 100644 --- a/sources/Cargo.toml +++ b/sources/Cargo.toml @@ -66,6 +66,7 @@ members = [ "settings-migrations/v1.63.0/image-verifier-plugins-settings", "settings-migrations/v1.63.0/nvidia-k8s-device-plugin-enabled", "settings-migrations/v1.64.0/kubernetes-container-runtime-endpoint", + "settings-migrations/v1.64.0/hugepages-settings", "settings-plugins/aws-dev", "settings-plugins/aws-ecs-2", diff --git a/sources/settings-migrations/v1.64.0/hugepages-settings/Cargo.toml b/sources/settings-migrations/v1.64.0/hugepages-settings/Cargo.toml new file mode 100644 index 00000000000..84cc1cacb84 --- /dev/null +++ b/sources/settings-migrations/v1.64.0/hugepages-settings/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "hugepages-settings" +version = "0.1.0" +license = "Apache-2.0 OR MIT" +edition = "2021" +publish = false +exclude = ["README.md"] + +[dependencies] +migration-helpers.workspace = true diff --git a/sources/settings-migrations/v1.64.0/hugepages-settings/src/main.rs b/sources/settings-migrations/v1.64.0/hugepages-settings/src/main.rs new file mode 100644 index 00000000000..50011d67423 --- /dev/null +++ b/sources/settings-migrations/v1.64.0/hugepages-settings/src/main.rs @@ -0,0 +1,22 @@ +use migration_helpers::common_migrations::AddPrefixesMigration; +use migration_helpers::{migrate, Result}; +use std::process; + +/// We added new settings for hugepages related settings: +/// - settings.kernel.hugepages.* +fn run() -> Result<()> { + migrate(AddPrefixesMigration(vec![ + "settings.kernel.hugepages", + "services.hugepages", + ])) +} + +// 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); + } +} diff --git a/sources/shared-defaults/defaults.toml b/sources/shared-defaults/defaults.toml index 128db21c672..d9e3ec2dcec 100644 --- a/sources/shared-defaults/defaults.toml +++ b/sources/shared-defaults/defaults.toml @@ -137,6 +137,13 @@ restart-commands = ["/usr/bin/corndog lockdown"] [metadata.settings.kernel.lockdown] affected-services = ["lockdown"] +[services.hugepages] +configuration-files = ["corndog-toml"] +restart-commands = [] + +[metadata.settings.kernel.hugepages] +affected-services = ["hugepages"] + [configuration-files.corndog-toml] path = "/etc/corndog.toml" template-path = "/usr/share/templates/corndog-toml"