From dc2d7a08d36eb8d15ccd8257e2e94b2922041f52 Mon Sep 17 00:00:00 2001 From: Lauri Nevala Date: Thu, 17 Jun 2021 07:45:46 +0300 Subject: [PATCH] Check cluster connected status from cluster.status.phase property (#3078) Signed-off-by: Lauri Nevala --- .../metrics-cluster-feature/src/metrics-settings.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/metrics-cluster-feature/src/metrics-settings.tsx b/extensions/metrics-cluster-feature/src/metrics-settings.tsx index b5a78eda1a..5399cd638a 100644 --- a/extensions/metrics-cluster-feature/src/metrics-settings.tsx +++ b/extensions/metrics-cluster-feature/src/metrics-settings.tsx @@ -81,7 +81,7 @@ export class MetricsSettings extends React.Component { @computed get isTogglable() { if (this.inProgress) return false; - if (!this.props.cluster.status.active) return false; + if (this.props.cluster.status.phase !== "connected") return false; if (this.canUpgrade) return false; if (!this.isActiveMetricsProvider) return false; @@ -205,7 +205,7 @@ export class MetricsSettings extends React.Component { render() { return ( <> - { !this.props.cluster.status.active && ( + { this.props.cluster.status.phase !== "connected" && (

Lens Metrics settings requires established connection to the cluster. @@ -225,7 +225,7 @@ export class MetricsSettings extends React.Component { control={ this.togglePrometheus(v.target.checked)} name="prometheus" /> @@ -243,7 +243,7 @@ export class MetricsSettings extends React.Component { control={ this.toggleKubeStateMetrics(v.target.checked)} name="node-exporter" /> @@ -262,7 +262,7 @@ export class MetricsSettings extends React.Component { control={ this.toggleNodeExporter(v.target.checked)} name="node-exporter" />