diff --git a/internal/cephfs/driver.go b/internal/cephfs/driver.go index ae9616131..bb8120455 100644 --- a/internal/cephfs/driver.go +++ b/internal/cephfs/driver.go @@ -54,6 +54,10 @@ var ( // volJournal is used to maintain RADOS based journals for CO generated // VolumeName to backing CephFS subvolumes volJournal *journal.Config + + // snapJournal is used to maintain RADOS based journals for CO generated + // SnapshotName to backing CephFS subvolumes + snapJournal *journal.Config ) // NewDriver returns new ceph driver. @@ -73,6 +77,8 @@ func NewControllerServer(d *csicommon.CSIDriver) *ControllerServer { return &ControllerServer{ DefaultControllerServer: csicommon.NewDefaultControllerServer(d), VolumeLocks: util.NewVolumeLocks(), + SnapshotLocks: util.NewVolumeLocks(), + OperationLocks: util.NewOperationLock(), } } @@ -106,6 +112,7 @@ func (fs *Driver) Run(conf *util.Config) { // Create an instance of the volume journal volJournal = journal.NewCSIVolumeJournalWithNamespace(CSIInstanceID, radosNamespace) + snapJournal = journal.NewCSISnapshotJournalWithNamespace(CSIInstanceID, radosNamespace) // Initialize default library driver fs.cd = csicommon.NewCSIDriver(conf.DriverName, util.DriverVersion, conf.NodeID) @@ -116,7 +123,9 @@ func (fs *Driver) Run(conf *util.Config) { if conf.IsControllerServer || !conf.IsNodeServer { fs.cd.AddControllerServiceCapabilities([]csi.ControllerServiceCapability_RPC_Type{ csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME, + csi.ControllerServiceCapability_RPC_CREATE_DELETE_SNAPSHOT, csi.ControllerServiceCapability_RPC_EXPAND_VOLUME, + csi.ControllerServiceCapability_RPC_CLONE_VOLUME, }) fs.cd.AddVolumeCapabilityAccessModes([]csi.VolumeCapability_AccessMode_Mode{