Fix getKubeConfigLocal() (#635)

This commit is contained in:
Lauri Nevala authored and GitHub committed 2020-08-04 10:24:11 +03:00
1 parent 756fc7b2b7
commit 0095c779b2
1 file changed
+1 -1
+1 -1
View File
@@ -160,7 +160,7 @@ export async function getKubeConfigLocal(): Promise<string> {
const file = await readFile(configFile, "utf8");
const obj = yaml.safeLoad(file);
if (obj.contexts) {
obj.contexts = obj.context.filter((ctx: any) => ctx?.context?.cluster && ctx?.name)
obj.contexts = obj.contexts.filter((ctx: any) => ctx?.context?.cluster && ctx?.name)
}
return yaml.safeDump(obj);
} catch (err) {