diff options
| -rw-r--r-- | pkg/driver/controllerserver.go | 12 | ||||
| -rw-r--r-- | pkg/driver/driver.go | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/pkg/driver/controllerserver.go b/pkg/driver/controllerserver.go index 3a5abdc..57b43d0 100644 --- a/pkg/driver/controllerserver.go +++ b/pkg/driver/controllerserver.go @@ -180,6 +180,18 @@ func (cs *ControllerServer) ControllerGetCapabilities(ctx context.Context, req * }, nil } +func (cs *ControllerServer) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error) { + capacity := req.GetCapacityRange().GetRequiredBytes() + + glog.Infof("expand volume req: %v, capacity: %v", req.GetVolumeId(), capacity) + + // We need to propagate resize requests to node servers + return &csi.ControllerExpandVolumeResponse{ + CapacityBytes: capacity, + NodeExpansionRequired: true, + }, nil +} + func sanitizeVolumeId(volumeId string) string { volumeId = strings.ToLower(volumeId) if len(volumeId) > 63 { diff --git a/pkg/driver/driver.go b/pkg/driver/driver.go index 20a6fa5..23dbae3 100644 --- a/pkg/driver/driver.go +++ b/pkg/driver/driver.go @@ -77,6 +77,7 @@ func NewSeaweedFsDriver(filer, nodeID, endpoint string) *SeaweedFsDriver { csi.ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME, csi.ControllerServiceCapability_RPC_PUBLISH_UNPUBLISH_VOLUME, csi.ControllerServiceCapability_RPC_SINGLE_NODE_MULTI_WRITER, + csi.ControllerServiceCapability_RPC_EXPAND_VOLUME, }) return n |
