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

Add accessibleNamespaces to KubernetesClusterModel (#3487)

Fixes #3485

Signed-off-by: Jan Jansen <jan.jansen@gdata.de>
This commit is contained in:
Jan Jansen 2021-07-23 17:40:13 +02:00 committed by GitHub
parent eb0c0210e4
commit c8f27e537b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

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

View File

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