mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 10:53:34 +00:00
util: add helper for group controller
Added helper function to add the group controller capabilities which needs to be included by csi driver that wants to implement group controller. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
dd235d88e0
commit
aa39b3dc1f
@ -31,9 +31,10 @@ type CSIDriver struct {
|
||||
nodeID string
|
||||
version string
|
||||
// topology constraints that this nodeserver will advertise
|
||||
topology map[string]string
|
||||
capabilities []*csi.ControllerServiceCapability
|
||||
vc []*csi.VolumeCapability_AccessMode
|
||||
topology map[string]string
|
||||
capabilities []*csi.ControllerServiceCapability
|
||||
groupCapabilities []*csi.GroupControllerServiceCapability
|
||||
vc []*csi.VolumeCapability_AccessMode
|
||||
}
|
||||
|
||||
// NewCSIDriver Creates a NewCSIDriver object. Assumes vendor
|
||||
@ -116,3 +117,16 @@ func (d *CSIDriver) AddVolumeCapabilityAccessModes(
|
||||
func (d *CSIDriver) GetVolumeCapabilityAccessModes() []*csi.VolumeCapability_AccessMode {
|
||||
return d.vc
|
||||
}
|
||||
|
||||
// AddControllerServiceCapabilities stores the group controller capabilities
|
||||
// in driver object.
|
||||
func (d *CSIDriver) AddGroupControllerServiceCapabilities(cl []csi.GroupControllerServiceCapability_RPC_Type) {
|
||||
csc := make([]*csi.GroupControllerServiceCapability, 0, len(cl))
|
||||
|
||||
for _, c := range cl {
|
||||
log.DefaultLog("Enabling group controller service capability: %v", c.String())
|
||||
csc = append(csc, NewGroupControllerServiceCapability(c))
|
||||
}
|
||||
|
||||
d.groupCapabilities = csc
|
||||
}
|
||||
|
Reference in New Issue
Block a user