-
Notifications
You must be signed in to change notification settings - Fork 807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NodeExpandVolume no-op for raw block #695
NodeExpandVolume no-op for raw block #695
Conversation
Hi @AndyXiangLi. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Pull Request Test Coverage Report for Build 1479
💛 - Coveralls |
/ok-to-test |
@@ -254,14 +254,43 @@ func (d *nodeService) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandV | |||
if len(volumeID) == 0 { | |||
return nil, status.Error(codes.InvalidArgument, "Volume ID not provided") | |||
} | |||
volumePath := req.GetVolumePath() | |||
if len(volumePath) == 0 { | |||
return nil, status.Error(codes.InvalidArgument, "volume path must be provided") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So prior to this PR, we don't have this requirement (at least here). We have to make sure this is not a breaking change. Did we verify that behavior stays the same when volumePath is absent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
volume_path is required, so we should be fine I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, as per https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/master/vendor/github.com/container-storage-interface/spec/lib/go/csi/csi.pb.go#L4322
I think we should have this check
pkg/driver/node.go
Outdated
|
||
if blk := volumeCapability.GetBlock(); blk != nil { | ||
// Noop for Block NodeExpandVolume | ||
klog.V(4).Infof("NodeExpandVolume succeeded on %v to %s, capability is block so this is a no-op", volumeID, volumePath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I feel like we should reword this. Maybe something like "NodeExpandVolume called for %v at %s. Since %v is a block device, ignoring..."
What do you think?
pkg/driver/node.go
Outdated
if isBlock { | ||
// Skip resizing for Block NodeExpandVolume | ||
klog.V(4).Infof("NodeExpandVolume succeeded on %v to %s, given volumePath is a block device so will not resize volume", volumeID, volumePath) | ||
return &csi.NodeExpandVolumeResponse{}, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that kubernetes will use the returned size(at least right now), but is better to return the expanded size if possible. We may have fixes coming up which uses returned size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also if you do make the change to returned expanded size, we should return expanded block size not the fs size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ayberk What do you think here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a great suggestion. We should future-proof wherever we can.
Mode: csi.VolumeCapability_AccessMode_SINGLE_NODE_WRITER, | ||
}, | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use losetup
and dd
to check the other case of volume_path being a block device?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to use losetup and dd to create loop device when setup testing but with no luck. It failed to find an available loop device when I ran it in linux instance.. This should not be a blocker as I tested the functionality e2e on the cluster. Testing code is here, I will follow up on this later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to approve to unblock you, but yeah let's follow up.
/retitle NodeExpandVolume no-op for raw block |
5d8e368
to
137061c
Compare
137061c
to
71ff40d
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AndyXiangLi, ayberk The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Is this a bug fix or adding new feature?
Fixes #346
Fixes #339
What is this PR about? / Why do we need it?
NodeExpandVolume will check volume type (mount point or block device)and skip resize on block volume.
What testing is done?
Sanity test passed
Added unit tests