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 authored and GitHub committed 2021-09-15 12:19:15 -04:00
1 parent 07d8d567de
commit f68cbabbc9
2 files changed
+5 -1

No files matched your search

@@ -51,6 +51,7 @@ export interface KubernetesClusterSpec extends CatalogEntitySpec {
material?: string;
background?: string;
};
accessibleNamespaces?: string[];
}
export interface KubernetesClusterMetadata extends CatalogEntityMetadata {
+4 -1
View File
@@ -193,7 +193,10 @@ export class ClusterManager extends Singleton {
} else {
cluster.kubeConfigPath = entity.spec.kubeconfigPath;
cluster.contextName = entity.spec.kubeconfigContext;
cluster.accessibleNamespaces = entity.spec.accessibleNamespaces ?? [];
if (entity.spec.accessibleNamespace) {
cluster.accessibleNamespaces = entity.spec.accessibleNamespaces;
}
this.updateEntityFromCluster(cluster);
}