Skip to content

Commit

Permalink
preemptively set KUBECONFIG to ensure it is available to the rest of …
Browse files Browse the repository at this point in the history
…the .rc files
  • Loading branch information
EItanya authored and sbstp committed Apr 6, 2020
1 parent a3e7c5c commit c1d36a2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/shell/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ pub fn spawn_shell(settings: &Settings, config: KubeConfig, session: &Session) -
let next_depth = depth + 1;

let mut env_vars = EnvVars::new();
// pre-insert the KUBECONFIG variable into the shell.
// This will make sure any shell plugins/add-ons which require this env variable will have it available at the beginninng of the .rc file
env_vars.insert("KUBECONFIG", temp_config_file.path());
env_vars.insert("KUBIE_ACTIVE", "1");
env_vars.insert("KUBIE_DEPTH", next_depth.to_string());
env_vars.insert("KUBIE_KUBECONFIG", temp_config_file.path());
Expand Down

0 comments on commit c1d36a2

Please sign in to comment.