Skip to content

Commit

Permalink
This commit changes the mode code for the 'configuration-files.kubele…
Browse files Browse the repository at this point in the history
…t-exec-start-conf'
  • Loading branch information
Sparksssj committed Oct 8, 2024
1 parent 40e1e65 commit 645f7f4
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Release.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "1.24.1"
version = "1.25.0"

[migrations]
"(0.3.1, 0.3.2)" = ["migrate_v0.3.2_admin-container-v0-5-0.lz4"]
Expand Down Expand Up @@ -357,3 +357,6 @@ version = "1.24.1"
"migrate_v1.24.1_aws-control-container-v0-7-16.lz4",
"migrate_v1.24.1_public-control-container-v0-7-16.lz4",
]
"(1.24.1, 1.25.0)" = [
"migrate_v1.25.0_kubernetes-service-config.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 @@ -59,6 +59,7 @@ members = [
"settings-migrations/v1.24.1/public-admin-container-v0-11-12",
"settings-migrations/v1.24.1/aws-control-container-v0-7-16",
"settings-migrations/v1.24.1/public-control-container-v0-7-16",
"settings-migrations/v1.25.0/kubernetes-service-config",

"settings-plugins/aws-dev",
"settings-plugins/aws-ecs-1",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "kubernetes-service-config"
version = "0.1.0"
authors = ["Sparks Song <[email protected]>"]
license = "Apache-2.0 OR MIT"
edition = "2021"
publish = false
# Don't rebuild crate just because of changes to README.
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,25 @@
use migration_helpers::common_migrations::ReplaceStringMigration;
use migration_helpers::{migrate, Result};
use std::process;

const OLD_MODE: &str = "0600";
const NEW_MODE: &str = "0644";

/// We changed the version of configuration mode
fn run() -> Result<()> {
migrate(ReplaceStringMigration {
setting: "configuration-files.kubelet-exec-start-conf.mode",
old_val: OLD_MODE,
new_val: NEW_MODE,
})
}

// 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);
}
}
2 changes: 1 addition & 1 deletion sources/shared-defaults/kubernetes-services.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ template-path = "/usr/share/templates/kubelet-server-key"
[configuration-files.kubelet-exec-start-conf]
path = "/etc/systemd/system/kubelet.service.d/exec-start.conf"
template-path = "/usr/share/templates/kubelet-exec-start-conf"
mode = "0600"
mode = "0644"

[configuration-files.credential-provider-config-yaml]
path = "/etc/kubernetes/kubelet/credential-provider-config.yaml"
Expand Down

0 comments on commit 645f7f4

Please sign in to comment.