mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Only allow extensions to use non-lens specific cluster phases (#4036)
This commit is contained in:
1 parent
a01eecdc79
commit
9d5689ce69
5 files changed
+50
-16
No files matched your search
@@ -54,15 +54,24 @@ export interface KubernetesClusterSpec extends CatalogEntitySpec {
|
||||
accessibleNamespaces?: string[];
|
||||
}
|
||||
|
||||
export enum LensKubernetesClusterStatus {
|
||||
DELETING = "deleting",
|
||||
CONNECTING = "connecting",
|
||||
CONNECTED = "connected",
|
||||
DISCONNECTED = "disconnected"
|
||||
}
|
||||
|
||||
export interface KubernetesClusterMetadata extends CatalogEntityMetadata {
|
||||
distro?: string;
|
||||
kubeVersion?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated This is no longer used as it is incorrect. Other sources can add more values
|
||||
*/
|
||||
export type KubernetesClusterStatusPhase = "connected" | "connecting" | "disconnected" | "deleting";
|
||||
|
||||
export interface KubernetesClusterStatus extends CatalogEntityStatus {
|
||||
phase: KubernetesClusterStatusPhase;
|
||||
}
|
||||
|
||||
export class KubernetesCluster extends CatalogEntity<KubernetesClusterMetadata, KubernetesClusterStatus, KubernetesClusterSpec> {
|
||||
@@ -110,15 +119,15 @@ export class KubernetesCluster extends CatalogEntity<KubernetesClusterMetadata,
|
||||
}
|
||||
|
||||
switch (this.status.phase) {
|
||||
case "connected":
|
||||
case "connecting":
|
||||
case LensKubernetesClusterStatus.CONNECTED:
|
||||
case LensKubernetesClusterStatus.CONNECTING:
|
||||
context.menuItems.push({
|
||||
title: "Disconnect",
|
||||
icon: "link_off",
|
||||
onClick: () => requestMain(clusterDisconnectHandler, this.metadata.uid)
|
||||
});
|
||||
break;
|
||||
case "disconnected":
|
||||
case LensKubernetesClusterStatus.DISCONNECTED:
|
||||
context.menuItems.push({
|
||||
title: "Connect",
|
||||
icon: "link",
|
||||
|
||||
Reference in new issue
Block a user