Skip to content

Commit

Permalink
propagate original config
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramilito committed Feb 10, 2024
1 parent ddd8ca5 commit 522af07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ pub fn selectable_list(input: Vec<String>) -> String {

pub fn set_namespace(ctx: &str, selection: &str, temp_dir: &str, config: &KubeConfig) {
let choice = config.contexts.iter().find(|x| x.name == ctx);
config::write(choice.unwrap(), Some(selection), temp_dir)
config::write(choice.unwrap(), config, Some(selection), temp_dir)
}

pub fn set_context(ctx: &str, temp_dir: &str, config: &KubeConfig) -> Result<(), SetContextError> {
if let Some(choice) = config.contexts.iter().find(|x| x.name == ctx) {
config::write(choice, None, temp_dir);
config::write(choice, config, None, temp_dir);
Ok(())
} else {
Err(SetContextError::ContextNotFound{ctx: ctx.to_owned()})
Expand Down

0 comments on commit 522af07

Please sign in to comment.