diff --git a/src/common/catalog-entities/kubernetes-cluster.ts b/src/common/catalog-entities/kubernetes-cluster.ts index 83a94547bb..2e8fdccf04 100644 --- a/src/common/catalog-entities/kubernetes-cluster.ts +++ b/src/common/catalog-entities/kubernetes-cluster.ts @@ -43,6 +43,7 @@ export interface KubernetesClusterPrometheusMetrics { export interface KubernetesClusterSpec extends CatalogEntitySpec { kubeconfigPath: string; kubeconfigContext: string; + accessibleNamespaces?: string[]; metrics?: { source: string; prometheus?: KubernetesClusterPrometheusMetrics; diff --git a/src/main/cluster-manager.ts b/src/main/cluster-manager.ts index 628bcb22f6..0a33fd8408 100644 --- a/src/main/cluster-manager.ts +++ b/src/main/cluster-manager.ts @@ -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); }