diff --git a/internal/util/connection.go b/internal/util/connection.go index 172faffe8..713e1ab43 100644 --- a/internal/util/connection.go +++ b/internal/util/connection.go @@ -21,6 +21,7 @@ import ( "fmt" "time" + ca "github.com/ceph/go-ceph/cephfs/admin" "github.com/ceph/go-ceph/rados" ) @@ -83,3 +84,11 @@ func (cc *ClusterConnection) GetIoctx(pool string) (*rados.IOContext, error) { return ioctx, nil } + +func (cc *ClusterConnection) GetFSAdmin() (*ca.FSAdmin, error) { + if cc.conn == nil { + return nil, errors.New("cluster is not connected yet") + } + + return ca.NewFromConn(cc.conn), nil +}