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

add accessibleNamespaces to KubernetesClusterModel

Fixes #3485

Signed-off-by: Jan Jansen <jan.jansen@gdata.de>
This commit is contained in:
Jan Jansen 2021-07-22 16:06:51 +02:00
parent c6a4d55d86
commit 84fdae16f7
2 changed files with 4 additions and 1 deletions

View File

@ -43,6 +43,7 @@ export interface KubernetesClusterPrometheusMetrics {
export interface KubernetesClusterSpec extends CatalogEntitySpec {
kubeconfigPath: string;
kubeconfigContext: string;
accessibleNamespaces?: string[];
metrics?: {
source: string;
prometheus?: KubernetesClusterPrometheusMetrics;

View File

@ -170,7 +170,8 @@ export class ClusterManager extends Singleton {
clusterName: entity.metadata.name
},
kubeConfigPath: entity.spec.kubeconfigPath,
contextName: entity.spec.kubeconfigContext
contextName: entity.spec.kubeconfigContext,
accessibleNamespaces: entity.spec.accessibleNamespaces
});
} catch (error) {
if (error.code === "ENOENT" && error.path === entity.spec.kubeconfigPath) {
@ -182,6 +183,7 @@ export class ClusterManager extends Singleton {
} else {
cluster.kubeConfigPath = entity.spec.kubeconfigPath;
cluster.contextName = entity.spec.kubeconfigContext;
cluster.accessibleNamespaces = entity.spec.accessibleNamespaces;
this.updateEntityFromCluster(cluster);
}