util: add GetAddrs method

added GetAddrs to get the client
Adress of the rados connection
which is helpful for NetworkFencing

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2024-11-04 15:05:29 +01:00 committed by mergify[bot]
parent 1246e2fac7
commit ba8c5a359c

View File

@ -151,3 +151,13 @@ func (cc *ClusterConnection) GetNFSAdmin() (*nfs.Admin, error) {
return nfs.NewFromConn(cc.conn), nil
}
// GetAddrs returns the addresses of the RADOS session,
// suitable for blocklisting.
func (cc *ClusterConnection) GetAddrs() (string, error) {
if cc.conn == nil {
return "", errors.New("cluster is not connected yet")
}
return cc.conn.GetAddrs()
}