Skip to content

Commit 23a27fb

Browse files
committed
migration: add command for host and bootstrap containers
Signed-off-by: Yutong Sun <[email protected]>
1 parent 90be524 commit 23a27fb

File tree

5 files changed

+57
-0
lines changed

5 files changed

+57
-0
lines changed

Release.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,4 +439,5 @@ version = "1.47.0"
439439
]
440440
"(1.46.0, 1.47.0)" = [
441441
"migrate_v1.47.0_container-runtime-concurrent-download-chunk-size.lz4",
442+
"migrate_v1.47.0_host-bootstrap-containers-command-setting.lz4"
442443
]

sources/Cargo.lock

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sources/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ members = [
4040
"settings-migrations/v1.44.0/container-runtime-snapshotter-setting",
4141
"settings-migrations/v1.46.0/kubernetes-static-pods-enabled-setting",
4242
"settings-migrations/v1.47.0/container-runtime-concurrent-download-chunk-size",
43+
"settings-migrations/v1.47.0/host-bootstrap-containers-command-setting",
4344

4445
"settings-plugins/aws-dev",
4546
"settings-plugins/aws-ecs-2",
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[package]
2+
name = "host-bootstrap-containers-command-setting"
3+
version = "0.1.0"
4+
authors = ["Yutong Sun <[email protected]>"]
5+
license = "Apache-2.0 OR MIT"
6+
edition = "2021"
7+
publish = false
8+
# Don't rebuild crate just because of changes to README.
9+
exclude = ["README.md"]
10+
11+
12+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
13+
14+
[dependencies]
15+
migration-helpers.workspace = true
16+
snafu.workspace = true
17+
18+
[dev-dependencies]
19+
maplit.workspace = true
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
use migration_helpers::common_migrations::{AddPrefixSuffixMigration, PrefixSuffix};
2+
use migration_helpers::{migrate, Result};
3+
use std::process;
4+
5+
// We added new settings container-runtime-plugins
6+
fn run() -> Result<()> {
7+
migrate(AddPrefixSuffixMigration(vec![
8+
PrefixSuffix {
9+
prefix: "settings.host-containers",
10+
suffix: "command",
11+
},
12+
PrefixSuffix {
13+
prefix: "settings.bootstrap-containers",
14+
suffix: "command",
15+
},
16+
]))
17+
}
18+
19+
// Returning a Result from main makes it print a Debug representation of the error, but with Snafu
20+
// we have nice Display representations of the error, so we wrap "main" (run) and print any error.
21+
// https://github.com/shepmaster/snafu/issues/110
22+
fn main() {
23+
if let Err(e) = run() {
24+
eprintln!("{e}");
25+
process::exit(1);
26+
}
27+
}

0 commit comments

Comments
 (0)