From d8b5d524383697dacba7d554abcf66aaace8d727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Fri, 8 Nov 2019 16:01:02 +0100 Subject: [PATCH] ceph: hide wrong error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WriteConnectionConfig() is called after the controller starts and thus the 'osd find' command fails to complete because there is no ceph.conf or key on the operator. Let's skip this error print if that's the case since it's misleading and polluting the logs. Signed-off-by: Sébastien Han --- .../ceph/disruption/clusterdisruption/location.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/operator/ceph/disruption/clusterdisruption/location.go b/pkg/operator/ceph/disruption/clusterdisruption/location.go index 548289e04..7e6534548 100644 --- a/pkg/operator/ceph/disruption/clusterdisruption/location.go +++ b/pkg/operator/ceph/disruption/clusterdisruption/location.go @@ -58,6 +58,15 @@ func (r *ReconcileClusterDisruption) getOsdDataList(request reconcile.Request, p } crushMeta, err := r.osdCrushLocationMap.Get(request.Namespace, osdIDInt) if err != nil { + // If the error contains that message, this means the cluster is not up and running + // No monitors are present and thus no ceph configuration has been created + // + // Or this means the ceph config hasn't been written on the operator yet + // The controller starts before we run WriteConnectionConfig() + if strings.Contains(err.Error(), "error calling conf_read_file") { + logger.Debugf("Ceph %q cluster is not ready, cannot check osd location yet.", request.Namespace) + return nil, nil + } return nil, fmt.Errorf("could not fetch info from ceph for osd %q. %+v", osdID, err) } // bypass the cache if the topology location is not populated in the cache