mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 02:50:30 +00:00
nfs: add support for create & delete snapshot
This commits adds support for creation and deletion of nfs snapshots based on cephfs. Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
parent
b7ec0b2d66
commit
24515b509f
@ -46,6 +46,7 @@ type Server struct {
|
|||||||
func NewControllerServer(d *csicommon.CSIDriver) *Server {
|
func NewControllerServer(d *csicommon.CSIDriver) *Server {
|
||||||
// global instance of the volume journal, yuck
|
// global instance of the volume journal, yuck
|
||||||
store.VolJournal = journal.NewCSIVolumeJournalWithNamespace(cephfs.CSIInstanceID, fsutil.RadosNamespace)
|
store.VolJournal = journal.NewCSIVolumeJournalWithNamespace(cephfs.CSIInstanceID, fsutil.RadosNamespace)
|
||||||
|
store.SnapJournal = journal.NewCSISnapshotJournalWithNamespace(cephfs.CSIInstanceID, fsutil.RadosNamespace)
|
||||||
|
|
||||||
return &Server{
|
return &Server{
|
||||||
backendServer: cephfs.NewControllerServer(d),
|
backendServer: cephfs.NewControllerServer(d),
|
||||||
@ -159,3 +160,19 @@ func (cs *Server) ControllerExpandVolume(
|
|||||||
req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error) {
|
req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error) {
|
||||||
return cs.backendServer.ControllerExpandVolume(ctx, req)
|
return cs.backendServer.ControllerExpandVolume(ctx, req)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CreateSnapshot calls the backend (CephFS) procedure to create snapshot.
|
||||||
|
// There is no interaction with the NFS-server needed for snapshot creation.
|
||||||
|
func (cs *Server) CreateSnapshot(
|
||||||
|
ctx context.Context,
|
||||||
|
req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error) {
|
||||||
|
return cs.backendServer.CreateSnapshot(ctx, req)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteSnapshot calls the backend (CephFS) procedure to delete snapshot.
|
||||||
|
// There is no interaction with the NFS-server needed for snapshot creation.
|
||||||
|
func (cs *Server) DeleteSnapshot(
|
||||||
|
ctx context.Context,
|
||||||
|
req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error) {
|
||||||
|
return cs.backendServer.DeleteSnapshot(ctx, req)
|
||||||
|
}
|
||||||
|
@ -47,6 +47,7 @@ func (fs *Driver) Run(conf *util.Config) {
|
|||||||
csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME,
|
csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME,
|
||||||
csi.ControllerServiceCapability_RPC_SINGLE_NODE_MULTI_WRITER,
|
csi.ControllerServiceCapability_RPC_SINGLE_NODE_MULTI_WRITER,
|
||||||
csi.ControllerServiceCapability_RPC_EXPAND_VOLUME,
|
csi.ControllerServiceCapability_RPC_EXPAND_VOLUME,
|
||||||
|
csi.ControllerServiceCapability_RPC_CREATE_DELETE_SNAPSHOT,
|
||||||
})
|
})
|
||||||
// VolumeCapabilities are validated by the CephFS Controller
|
// VolumeCapabilities are validated by the CephFS Controller
|
||||||
cd.AddVolumeCapabilityAccessModes([]csi.VolumeCapability_AccessMode_Mode{
|
cd.AddVolumeCapabilityAccessModes([]csi.VolumeCapability_AccessMode_Mode{
|
||||||
|
Loading…
Reference in New Issue
Block a user