Skip to content

Commit 2ade41c

Browse files
committed
nvmeof: add stub ControllerExpandVolume for csi-resizer compatibility
Add EXPAND_VOLUME capability and stub implementation to allow csi-resizer to start and handle VolumeAttributesClass modifications. Signed-off-by: gadi-didi <[email protected]>
1 parent ff2d5ca commit 2ade41c

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

internal/nvmeof/controller/controllerserver.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,18 @@ func (cs *Server) ControllerModifyVolume(
354354
}
355355
}
356356

357+
// ControllerExpandVolume handles volume expansion requests.
358+
// For now it only updates the capacity in the response as NVMe-oF
359+
// this must be added because ControllerModifyVolume requires the sidecar csi-resizer. and
360+
// csi-resizer searches for the capacity ControllerServiceCapability_RPC_EXPAND_VOLUME.
361+
// In the future, if NVMe-oF gateway supports volume expansion, the logic must be added here.
362+
func (cs *Server) ControllerExpandVolume(
363+
ctx context.Context,
364+
req *csi.ControllerExpandVolumeRequest,
365+
) (*csi.ControllerExpandVolumeResponse, error) {
366+
return nil, status.Errorf(codes.Unimplemented, "ControllerExpandVolume is not implemented for NVMe-oF volumes")
367+
}
368+
357369
// validateCreateVolumeRequest validates the incoming request for nvmeof.
358370
// the rest of the parameters are validated by RBD.
359371
func validateCreateVolumeRequest(req *csi.CreateVolumeRequest) error {

internal/nvmeof/driver/driver.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ func (d *nvmeofDriver) Run(conf *util.Config) {
6464
csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME,
6565
csi.ControllerServiceCapability_RPC_PUBLISH_UNPUBLISH_VOLUME,
6666
csi.ControllerServiceCapability_RPC_MODIFY_VOLUME,
67+
csi.ControllerServiceCapability_RPC_EXPAND_VOLUME,
6768
})
6869

6970
cd.AddVolumeCapabilityAccessModes([]csi.VolumeCapability_AccessMode_Mode{

0 commit comments

Comments
 (0)