ceph: add missing errors

The current code wasn't returning the full error properly.

Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
Sébastien Han
2019-11-08 16:00:54 +01:00
parent 386ec12032
commit de172b96e8
@@ -54,18 +54,18 @@ func (r *ReconcileClusterDisruption) getOsdDataList(request reconcile.Request, p
}
osdIDInt, err := strconv.Atoi(osdID)
if err != nil {
return nil, fmt.Errorf("osd id not an int: %s", osdID)
return nil, fmt.Errorf("failed to convert osd id %q in an int. %+v", osdID, err)
}
crushMeta, err := r.osdCrushLocationMap.Get(request.Namespace, osdIDInt)
if err != nil {
return nil, fmt.Errorf("could not fetch info from ceph for osd %s", osdID)
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
_, failureDomainKnown := crushMeta.Location[poolFailureDomain]
if !failureDomainKnown {
crushMeta, err = r.osdCrushLocationMap.get(request.Namespace, osdIDInt)
if err != nil {
return nil, fmt.Errorf("could not fetch info from ceph for osd %s", osdID)
return nil, fmt.Errorf("could not fetch info from ceph for osd %q. %+v", osdID, err)
}
}