Display warning notification if invalid kubeconfig detected

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
Lauri Nevala committed 2021-02-25 16:00:10 +02:00
1 parent 607ebb599b
commit 4a9d4610d5
8 files changed
+66 -6

No files matched your search

+7 -1
View File
@@ -11,7 +11,7 @@ import { appEventBus } from "./event-bus";
import { dumpConfigYaml } from "./kube-helpers";
import { saveToAppFiles } from "./utils/saveToAppFiles";
import { KubeConfig } from "@kubernetes/client-node";
import { handleRequest, requestMain, subscribeToBroadcast, unsubscribeAllFromBroadcast } from "./ipc";
import { broadcastMessage, handleRequest, requestMain, subscribeToBroadcast, unsubscribeAllFromBroadcast, InvalidKubeconfigChannel } from "./ipc";
import _ from "lodash";
import move from "array-move";
import type { WorkspaceId } from "./workspace-store";
@@ -372,3 +372,9 @@ export function getHostedClusterId() {
export function getHostedCluster(): Cluster {
return clusterStore.getById(getHostedClusterId());
}
export function reportDeadClusters() {
clusterStore.clustersList.filter(cluster => cluster.isDead).forEach(cluster => {
broadcastMessage(InvalidKubeconfigChannel, cluster.id);
});
}
+1
View File
@@ -1,3 +1,4 @@
export * from "./ipc";
export * from "./invalid-kubeconfig";
export * from "./update-available";
export * from "./type-enforced-ipc";
@@ -0,0 +1,3 @@
export const InvalidKubeconfigChannel = "invalid-kubeconfig";
export type InvalidKubeConfigArgs = [clusterId: string];