Skip to content

Commit

Permalink
migrations: add migration for adding registry-qps and registry-burst
Browse files Browse the repository at this point in the history
Adds a migration for two new settings `settings.kubernetes.registry-qps`
and `settings.kubernetes.registry-burst`
  • Loading branch information
gthao313 committed Apr 28, 2021
1 parent 8d3cc53 commit 3b7c693
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions Release.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,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",
"migrate_v1.1.0_kubelet-registry-qps-registry-burst.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 @@ -55,6 +55,7 @@ members = [
"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",
"api/migration/migrations/v1.1.0/kubelet-registry-qps-registry-burst",

"bottlerocket-release",

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "kubelet-registry-qps-registry-burst"
version = "0.1.0"
authors = ["Tianhao Geng <tianhg@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,24 @@
#![deny(rust_2018_idioms)]

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

/// We added two new settings for configuring kubelet, `settings.kubernetes.registry-qps`
/// and `settings.kubernetes.registry-burst`
fn run() -> Result<()> {
migrate(AddSettingsMigration(&[
"settings.kubernetes.registry-qps",
"settings.kubernetes.registry-burst",
]))
}

// 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 3b7c693

Please sign in to comment.