mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
nfs: use go-ceph API for creating/deleting exports
Recent versions of Ceph allow calling the NFS-export management functions over the go-ceph API. This seems incompatible with older versions that have been tested with the `ceph nfs` commands that this commit replaces. Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
d886ab0d66
commit
28369702d2
@ -22,6 +22,7 @@ import (
|
||||
"time"
|
||||
|
||||
ca "github.com/ceph/go-ceph/cephfs/admin"
|
||||
"github.com/ceph/go-ceph/common/admin/nfs"
|
||||
"github.com/ceph/go-ceph/rados"
|
||||
ra "github.com/ceph/go-ceph/rbd/admin"
|
||||
)
|
||||
@ -140,3 +141,13 @@ func (cc *ClusterConnection) GetTaskAdmin() (*ra.TaskAdmin, error) {
|
||||
|
||||
return rbdAdmin.Task(), nil
|
||||
}
|
||||
|
||||
// GetNFSAdmin returns an Admin type that can be used to interact with the
|
||||
// NFS-cluster that is managed by Ceph.
|
||||
func (cc *ClusterConnection) GetNFSAdmin() (*nfs.Admin, error) {
|
||||
if cc.conn == nil {
|
||||
return nil, errors.New("cluster is not connected yet")
|
||||
}
|
||||
|
||||
return nfs.NewFromConn(cc.conn), nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user