Skip to content

Commit

Permalink
Merge pull request #916 from gnufied/skip-node-expansion
Browse files Browse the repository at this point in the history
Skip volume expansion if block node
  • Loading branch information
wongma7 authored Jun 3, 2021
2 parents 2b61230 + a8bb32d commit 3df341a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/driver/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,16 @@ func (d *controllerService) ControllerExpandVolume(ctx context.Context, req *csi
return nil, status.Errorf(codes.Internal, "Could not resize volume %q: %v", volumeID, err)
}

nodeExpansionRequired := true
// if this is a raw block device, no expansion should be necessary on the node
cap := req.GetVolumeCapability()
if cap != nil && cap.GetBlock() != nil {
nodeExpansionRequired = false
}

return &csi.ControllerExpandVolumeResponse{
CapacityBytes: util.GiBToBytes(actualSizeGiB),
NodeExpansionRequired: true,
NodeExpansionRequired: nodeExpansionRequired,
}, nil
}

Expand Down

0 comments on commit 3df341a

Please sign in to comment.