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:
parent
eb0c0210e4
commit
c8f27e537b
@ -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;
|
||||||
|
|||||||
@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user