Skip to content

Commit

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

"bottlerocket-release",

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "kubelet-server-tls-bootstrap"
version = "0.1.0"
authors = ["Erikson Tung <etung@amazon.com>"]
license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false

[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 setting for configuring kubelet, `kubernetes.server-tls-bootstrap`
fn run() -> Result<()> {
migrate(AddSettingsMigration(&[
"settings.kubernetes.server-tls-bootstrap",
]))
}

// 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 f44185b

Please sign in to comment.