[FIX] Infer Current Context
All checks were successful
Deploy USW-MC / deploy-edge (push) Successful in 2m7s
All checks were successful
Deploy USW-MC / deploy-edge (push) Successful in 2m7s
This commit is contained in:
parent
968aa1fc74
commit
27b11fcd50
2 changed files with 3 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
node_modules/
|
||||
.env
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ try {
|
|||
kc.loadFromString(Buffer.from(envConfig, "base64").toString("utf8"));
|
||||
else kc.loadFromDefault();
|
||||
} catch (e) {
|
||||
console.error("There was an issue loading the config from an envar! Using default permissions!");
|
||||
console.error(e);
|
||||
kc.loadFromDefault();
|
||||
}
|
||||
if(kc.contexts.length === 1) kc.setCurrentContext(kc.contexts[0].name);
|
||||
if(!kc.currentContext) throw new Error("Could not infer current context! Please set it manually in the Kubeconfig!");
|
||||
export default kc;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue