From e99dd3dea4759887a051eda486ef1df5149ad689 Mon Sep 17 00:00:00 2001 From: Rakshith R Date: Tue, 7 Sep 2021 17:20:51 +0530 Subject: [PATCH] util: read ceph.conf by calling conn.ReadConfigFile(CephConfigPath) The configurations in cpeh.conf is not picked up by rados connection automatically, hence we need to call conn.ReadConfigFile before calling Connect(). Signed-off-by: Rakshith R --- internal/util/conn_pool.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/util/conn_pool.go b/internal/util/conn_pool.go index 3987101dd..aca2bb482 100644 --- a/internal/util/conn_pool.go +++ b/internal/util/conn_pool.go @@ -145,6 +145,10 @@ func (cp *ConnPool) Get(monitors, user, keyfile string) (*rados.Conn, error) { return nil, fmt.Errorf("parsing cmdline args (%v) failed: %w", args, err) } + if err = conn.ReadConfigFile(CephConfigPath); err != nil { + return nil, fmt.Errorf("failed to read config file %q: %w", CephConfigPath, err) + } + err = conn.Connect() if err != nil { return nil, fmt.Errorf("connecting failed: %w", err)