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

Signed-off-by: Sebastian Malton <sebastian@malton.name>
Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
This commit is contained in:
Sebastian Malton authored and Jim Ehrismann committed 2021-09-15 18:49:42 -04:00
1 parent 6f545bfc42
commit f37548ce87
2 files changed
+5 -1

No files matched your search

@@ -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 {
+4 -1
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);
} }