remove auto-select clusters, clean up

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman committed 2020-08-27 16:37:01 +03:00
1 parent 4b5a4d8d1d
commit 55bb573421
2 files changed
+2 -9

No files matched your search

+1 -2
View File
@@ -1,6 +1,5 @@
import { app, remote } from "electron";
import { KubeConfig, V1Node, V1Pod } from "@kubernetes/client-node" import { KubeConfig, V1Node, V1Pod } from "@kubernetes/client-node"
import fse, { ensureDirSync, writeFileSync } from "fs-extra"; import fse from "fs-extra";
import path from "path" import path from "path"
import os from "os" import os from "os"
import yaml from "js-yaml" import yaml from "js-yaml"
@@ -71,7 +71,7 @@ export class AddCluster extends React.Component {
} }
@action @action
refreshContexts(autoSelect = true) { refreshContexts() {
this.selectedContexts.clear(); this.selectedContexts.clear();
this.kubeContexts.clear(); this.kubeContexts.clear();
@@ -91,12 +91,6 @@ export class AddCluster extends React.Component {
} }
break; break;
} }
if (autoSelect) {
const allContexts = Array.from(this.kubeContexts.keys());
if (allContexts.length <= 10) {
this.selectedContexts.replace(allContexts);
}
}
} }
getContexts(config: KubeConfig): Map<string, KubeConfig> { getContexts(config: KubeConfig): Map<string, KubeConfig> {