-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing symlink and metadata migration
Signed-off-by: Yutong Sun <[email protected]>
- Loading branch information
Showing
9 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
*.patch.bz2 | ||
*.src.rpm | ||
*.zip | ||
*.rpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
sources/api/migration/migrations/v1.21.0/container-runtime-nvidia-k8s-metadata/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[package] | ||
name = "container-runtime-nvidia-k8s-metadata" | ||
version = "0.1.0" | ||
edition = "2021" | ||
authors = ["Yutong Sun <[email protected]>"] | ||
license = "Apache-2.0 OR MIT" | ||
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"} | ||
|
||
[build-dependencies] | ||
bottlerocket-variant = { version = "0.1", path = "../../../../../bottlerocket-variant" } |
6 changes: 6 additions & 0 deletions
6
sources/api/migration/migrations/v1.21.0/container-runtime-nvidia-k8s-metadata/build.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
use bottlerocket_variant::Variant; | ||
|
||
fn main() { | ||
let variant = Variant::from_env().unwrap(); | ||
variant.emit_cfgs(); | ||
} |
26 changes: 26 additions & 0 deletions
26
sources/api/migration/migrations/v1.21.0/container-runtime-nvidia-k8s-metadata/src/main.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use migration_helpers::common_migrations::{AddMetadataMigration, NoOpMigration, SettingMetadata}; | ||
use migration_helpers::migrate; | ||
use migration_helpers::Result; | ||
use std::process; | ||
|
||
/// We added a new setting for configuring container runtime (containerd) settings only for NVIDIA k8s variants. | ||
fn run() -> Result<()> { | ||
if cfg!(variant_family = "aws-k8s") && cfg!(variant_flavor = "nvidia") { | ||
migrate(AddMetadataMigration(&[SettingMetadata { | ||
metadata: &["affected-services"], | ||
setting: "settings.kubernetes.nvidia.container-runtime", | ||
}])) | ||
} else { | ||
migrate(NoOpMigration) | ||
} | ||
} | ||
|
||
// 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); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
sources/models/src/aws-k8s-1.24-nvidia/defaults.d/81-nvidia-k8s-container-toolkit.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../shared-defaults/nvidia-k8s-container-toolkit.toml |
1 change: 1 addition & 0 deletions
1
sources/models/src/aws-k8s-1.25-nvidia/defaults.d/81-nvidia-k8s-container-toolkit.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../shared-defaults/nvidia-k8s-container-toolkit.toml |
1 change: 1 addition & 0 deletions
1
sources/models/src/aws-k8s-1.26-nvidia/defaults.d/81-nvidia-k8s-container-toolkit.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../shared-defaults/nvidia-k8s-container-toolkit.toml |