1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix cluster's accessibleNamespaces being reset on restarting Lens (#3817)

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2021-09-15 12:19:15 -04:00 committed by GitHub
parent 07d8d567de
commit f68cbabbc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -51,6 +51,7 @@ export interface KubernetesClusterSpec extends CatalogEntitySpec {
material?: string; material?: string;
background?: string; background?: string;
}; };
accessibleNamespaces?: string[];
} }
export interface KubernetesClusterMetadata extends CatalogEntityMetadata { export interface KubernetesClusterMetadata extends CatalogEntityMetadata {

View File

@ -193,7 +193,10 @@ export class ClusterManager extends Singleton {
} else { } else {
cluster.kubeConfigPath = entity.spec.kubeconfigPath; cluster.kubeConfigPath = entity.spec.kubeconfigPath;
cluster.contextName = entity.spec.kubeconfigContext; cluster.contextName = entity.spec.kubeconfigContext;
cluster.accessibleNamespaces = entity.spec.accessibleNamespaces ?? [];
if (entity.spec.accessibleNamespace) {
cluster.accessibleNamespaces = entity.spec.accessibleNamespaces;
}
this.updateEntityFromCluster(cluster); this.updateEntityFromCluster(cluster);
} }