From db91fd8bc3e9dbc2f8e348d2b507e87dd8d8c321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Mon, 24 May 2021 14:41:26 +0200 Subject: [PATCH] ceph: do not configure external metric endpoint is not present MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If no endpoint are configured let's simply return. Closes: https://github.com/rook/rook/issues/7963 Signed-off-by: Sébastien Han --- pkg/operator/ceph/controller/spec.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/operator/ceph/controller/spec.go b/pkg/operator/ceph/controller/spec.go index 93ae38c49..e5baa2f1c 100644 --- a/pkg/operator/ceph/controller/spec.go +++ b/pkg/operator/ceph/controller/spec.go @@ -668,6 +668,11 @@ func createExternalMetricsEndpoints(namespace string, monitoringSpec cephv1.Moni } func ConfigureExternalMetricsEndpoint(ctx *clusterd.Context, monitoringSpec cephv1.MonitoringSpec, clusterInfo *client.ClusterInfo, ownerInfo *k8sutil.OwnerInfo) error { + if len(monitoringSpec.ExternalMgrEndpoints) == 0 { + logger.Debug("no metric endpoint configured, doing nothing") + return nil + } + // Get active mgr var activeMgrAddr string // We use mgr dump and not stat because we want the IP address