[FIX] Infer Current Context
All checks were successful
Deploy USW-MC / deploy-edge (push) Successful in 2m7s

This commit is contained in:
Dunemask 2024-08-25 11:52:25 -06:00
parent 968aa1fc74
commit 27b11fcd50
2 changed files with 3 additions and 2 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
node_modules/
.env

View file

@ -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;