Skip to content

Commit

Permalink
migrations: add migration for adding kubernetes.cloud-provider
Browse files Browse the repository at this point in the history
Adds a migration for the new `kubernetes.cloud-provider` setting.
  • Loading branch information
jpculp committed Apr 19, 2021
1 parent 3a210f9 commit 104122a
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions Release.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ version = "1.0.8"
]
"(1.0.8, 1.1.0)" = [
"migrate_v1.1.0_kubelet-server-tls-bootstrap.lz4",
"migrate_v1.1.0_kubelet-cloud-provider.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 @@ -54,6 +54,7 @@ members = [
"api/migration/migrations/v1.0.8/admin-container-v0-7-0",
"api/migration/migrations/v1.0.8/add-bootstrap-containers",
"api/migration/migrations/v1.1.0/kubelet-server-tls-bootstrap",
"api/migration/migrations/v1.1.0/kubelet-cloud-provider",

"bottlerocket-release",

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "kubelet-cloud-provider"
version = "0.1.0"
authors = ["Patrick J.P. Culp <jpculp@amazon.com>"]
license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
migration-helpers = { path = "../../../migration-helpers" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#![deny(rust_2018_idioms)]

use migration_helpers::common_migrations::AddSettingsMigration;
use migration_helpers::{migrate, Result};
use std::process;

/// We added a new settings for configuring kubelet, `settings.kubernetes.cloud-provider`
fn run() -> Result<()> {
migrate(AddSettingsMigration(&[
"settings.kubernetes.cloud-provider",
]))
}

// 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 104122a

Please sign in to comment.