Skip to content

Commit

Permalink
hotfix defaulnt-namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramilito committed Sep 18, 2022
1 parent dbb2a74 commit 2220803
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ use std::{
extern crate skim;
use skim::prelude::*;

pub fn set_default_namespace(ns: &str) {
pub fn set_default_namespace(ns: &str, ctx: &str) {
Command::new("kubectl")
.arg("config")
.arg(format!(
"--kubeconfig={}/.kube/config",
dirs::home_dir().unwrap().display().to_string()
))
.arg("set-context")
.arg("--current")
.arg(ctx)
.arg(format!("--namespace={}", ns))
.stdout(Stdio::null())
.spawn()
Expand Down
2 changes: 1 addition & 1 deletion src/modes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ pub fn default_namespace(args: Cli) {
commands::selectable_list(namespaces)
});

commands::set_default_namespace(&ns);
commands::set_default_namespace(&ns, &ctx);
commands::set_namespace(&ctx, &ns, &DEST, &config);
}

Expand Down

0 comments on commit 2220803

Please sign in to comment.