From d05fc1e8e5775d19d641d93b74b1779dcda62a6d Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Wed, 17 Nov 2021 18:01:28 +0530 Subject: [PATCH] util: add helper to get the cluster ID added helper function to get the cluster ID. Signed-off-by: Madhu Rajanna --- internal/util/connection.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/util/connection.go b/internal/util/connection.go index 9625d4e30..0aef6848b 100644 --- a/internal/util/connection.go +++ b/internal/util/connection.go @@ -114,6 +114,14 @@ func (cc *ClusterConnection) GetFSAdmin() (*ca.FSAdmin, error) { return ca.NewFromConn(cc.conn), nil } +func (cc *ClusterConnection) GetFSID() (string, error) { + if cc.conn == nil { + return "", errors.New("cluster is not connected yet") + } + + return cc.conn.GetFSID() +} + // GetRBDAdmin get RBDAdmin to administrate rbd volumes. func (cc *ClusterConnection) GetRBDAdmin() (*ra.RBDAdmin, error) { if cc.conn == nil {