From 24376647f863c422c28e776fd6ce17b6c61bd6bb Mon Sep 17 00:00:00 2001 From: Qu Xuan Date: Thu, 28 Oct 2021 20:04:04 +0800 Subject: [PATCH] fix(host): cephx closed --- pkg/util/cephutils/ceph.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/util/cephutils/ceph.go b/pkg/util/cephutils/ceph.go index 65eb69917d..f486a778d7 100644 --- a/pkg/util/cephutils/ceph.go +++ b/pkg/util/cephutils/ceph.go @@ -141,6 +141,9 @@ func (self *CephClient) GetCapacity() (*SCapacity, error) { result.UsedCapacitySizeKb = int64(pool.Stats.KbUsed) } } + if result.CapacitySizeKb == 0 { + log.Warningf("cluster size is zero, output is: %s", resp) + } return result, nil } @@ -175,6 +178,13 @@ rados mon op timeout = 5 rados osd_op timeout = 1200 client mount timeout = 120 `, strings.Join(monHosts, ",")) + if len(client.key) == 0 { + conf = fmt.Sprintf(`%s +auth_cluster_required = none +auth_service_required = none +auth_client_required = none +`, conf) + } client.cephConf, err = writeFile("ceph.*.conf", conf) if err != nil { return nil, errors.Wrapf(err, "write file")