From 770a1116a19397cf2055799e74073d6be55a1e48 Mon Sep 17 00:00:00 2001 From: mbecker20 Date: Wed, 8 Oct 2025 02:48:01 -0700 Subject: [PATCH] fix: RotateCoreKeys also needs to store the new keys in mem --- bin/core/src/api/execute/maintenance.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/core/src/api/execute/maintenance.rs b/bin/core/src/api/execute/maintenance.rs index aa8141867..cd15637ac 100644 --- a/bin/core/src/api/execute/maintenance.rs +++ b/bin/core/src/api/execute/maintenance.rs @@ -1,4 +1,7 @@ -use std::{fmt::Write as _, sync::OnceLock}; +use std::{ + fmt::Write as _, + sync::{Arc, OnceLock}, +}; use anyhow::{Context, anyhow}; use command::run_komodo_command; @@ -29,7 +32,7 @@ use crate::{ api::execute::{ ExecuteArgs, pull_deployment_inner, pull_stack_inner, }, - config::core_config, + config::{core_config, core_private_key, core_public_key}, helpers::{periphery_client, update::update_update}, resource::rotate_server_keys, state::{ @@ -507,6 +510,9 @@ impl Resolve for RotateCoreKeys { info!("New Public Key: {}", keys.public); + core_private_key().store(Arc::new(keys.private.into_inner())); + core_public_key().store(Arc::new(keys.public.clone())); + let mut log = format!("New Public Key: {}\n", keys.public); for (server, state) in servers { @@ -533,7 +539,7 @@ impl Resolve for RotateCoreKeys { let periphery = periphery_client(&server).await?; let res = periphery .request(api::keys::RotateCorePublicKey { - public_key: keys.public.as_str().to_string(), + public_key: keys.public.to_string(), }) .await; match res {