mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-10 00:10:20 +00:00
cephfs: add snapshot create/delete capabilities in controllerserver
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
parent
5a71949dcd
commit
f9257ed1cb
@ -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{
|
||||
|
Loading…
Reference in New Issue
Block a user