Skip to content

Commit

Permalink
migrations: add migrations for bootstrap-commands
Browse files Browse the repository at this point in the history
  • Loading branch information
piyush-jena committed Sep 4, 2024
1 parent 1062795 commit 57683f4
Show file tree
Hide file tree
Showing 16 changed files with 154 additions and 35 deletions.
2 changes: 2 additions & 0 deletions Release.toml
Original file line number Diff line number Diff line change
Expand Up @@ -341,4 +341,6 @@ version = "1.22.0"
"migrate_v1.22.0_public-admin-container-v0-11-11.lz4",
"migrate_v1.22.0_aws-control-container-v0-7-15.lz4",
"migrate_v1.22.0_public-control-container-v0-7-15.lz4",
"migrate_v1.22.0_bootstrap-commands-settings.lz4",
"migrate_v1.22.0_bootstrap-commands-metadata.lz4",
]
89 changes: 59 additions & 30 deletions sources/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions sources/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ members = [
"settings-migrations/v1.22.0/public-admin-container-v0-11-11",
"settings-migrations/v1.22.0/aws-control-container-v0-7-15",
"settings-migrations/v1.22.0/public-control-container-v0-7-15",
"settings-migrations/v1.22.0/bootstrap-commands-settings",
"settings-migrations/v1.22.0/bootstrap-commands-metadata",

"settings-plugins/aws-dev",
"settings-plugins/aws-ecs-1",
Expand Down Expand Up @@ -122,13 +124,13 @@ version = "0.1.0"

[workspace.dependencies.bottlerocket-modeled-types]
git = "https://github.com/bottlerocket-os/bottlerocket-settings-sdk"
tag = "bottlerocket-settings-models-v0.3.0"
version = "0.3.0"
tag = "bottlerocket-settings-models-v0.4.0"
version = "0.4.0"

[workspace.dependencies.bottlerocket-settings-models]
git = "https://github.com/bottlerocket-os/bottlerocket-settings-sdk"
tag = "bottlerocket-settings-models-v0.3.0"
version = "0.3.0"
tag = "bottlerocket-settings-models-v0.4.0"
version = "0.4.0"

[workspace.dependencies.bottlerocket-settings-plugin]
git = "https://github.com/bottlerocket-os/bottlerocket-settings-sdk"
Expand All @@ -137,7 +139,7 @@ version = "0.1.0"

[workspace.dependencies.settings-extension-oci-defaults]
git = "https://github.com/bottlerocket-os/bottlerocket-settings-sdk"
tag = "bottlerocket-settings-models-v0.3.0"
tag = "bottlerocket-settings-models-v0.4.0"
version = "0.1.0"

[profile.release]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "bootstrap-commands-metadata"
version = "0.1.0"
edition = "2021"
authors = ["Piyush Jena <[email protected]>"]
license = "Apache-2.0 OR MIT"
publish = false
exclude = ["README.md"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
migration-helpers.workspace = true
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
use migration_helpers::common_migrations::{AddMetadataMigration, 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<()> {
migrate(AddMetadataMigration(&[SettingMetadata {
metadata: &["affected-services"],
setting: "settings.bootstrap-commands",
}]))
}

// 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);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "bootstrap-commands-settings"
version = "0.1.0"
edition = "2021"
authors = ["Piyush Jena <[email protected]>"]
license = "Apache-2.0 OR MIT"
publish = false
exclude = ["README.md"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
migration-helpers.workspace = true
Loading

0 comments on commit 57683f4

Please sign in to comment.