-
Notifications
You must be signed in to change notification settings - Fork 615
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
[cinder-csi-plugin] NodeGetVolumeStats() implementation #941
[cinder-csi-plugin] NodeGetVolumeStats() implementation #941
Conversation
Hi @zuzzas. Thanks for your PR. I'm waiting for a kubernetes 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. |
Build succeeded.
|
Build succeeded.
|
/ok-to-test |
Build succeeded.
|
Build succeeded.
|
Build succeeded.
|
Build succeeded.
|
Build succeeded.
|
bab8a36
to
c99011b
Compare
Build succeeded.
|
Build succeeded.
|
Build succeeded.
|
Build succeeded.
|
Build succeeded.
|
Build succeeded.
|
Build succeeded.
|
@ramineni please review this PR when you get time, thanks |
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.
@zuzzas Thanks for the PR. Some initial comments inline
pkg/csi/cinder/nodeserver.go
Outdated
func (ns *nodeServer) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error) { | ||
return nil, status.Error(codes.Unimplemented, fmt.Sprintf("NodeGetVolumeStats is not yet implemented")) | ||
func (ns *nodeServer) NodeGetVolumeStats(_ context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error) { | ||
klog.V(4).Infof("NodeExpandVolume: called with args %+v", *req) |
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.
s/NodeExpandVolume/NodeGetVolumeStats
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.
Renamed!
func (ns *nodeServer) NodeGetVolumeStats(_ context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error) { | ||
klog.V(4).Infof("NodeExpandVolume: called with args %+v", *req) | ||
|
||
volumePath := req.GetVolumePath() |
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.
This function should comply with csi spec on required fields etc.
please run make test-cinder-csi-sanity
and fix the issues respective to this function.
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.
All sanity test errors related to NodeGetVolumeStats
are fixed. Some tests fail on other methods, but it seems to be out of the scope of this PR.
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.
+1, Awesome!! Thanks.
pkg/csi/cinder/nodeserver.go
Outdated
} | ||
return &csi.NodeGetVolumeStatsResponse{ | ||
Usage: []*csi.VolumeUsage{ | ||
{Total: capacity, Available: available, Used: usage, Unit: 1}, |
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.
what does Unit:1 mean?
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.
Magic numbers are bad. Fixed!
Build failed.
|
0645db0
to
8e7fbde
Compare
Build succeeded.
|
Build failed.
|
Build succeeded.
|
Build failed.
|
Build failed.
|
Build succeeded.
|
@lingxiankong |
|
@lingxiankong |
Issue is related to theopenlab/openlab-zuul-jobs#837 |
UsedInodes int64 | ||
} | ||
|
||
func (m *Mount) PathExists(volumePath string) (bool, error) { |
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.
:nit: i think this func exists in k8s.io/util/
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 has an additional check for a "corrupted mount". I'm not sure that this is required and this may introduce a potential false-positive.
/test cloud-provider-openstack-e2e-test-csi-cinder |
Thanks for the work on this |
/test cloud-provider-openstack-e2e-test-csi-cinder |
Build succeeded.
|
Please wait for theopenlab/openlab-zuul-jobs#841 merged. |
/test cloud-provider-openstack-unittest |
Build succeeded.
|
/test cloud-provider-openstack-acceptance-test-csi-cinder |
Build succeeded.
|
Love these green checkmarks. |
/lgtm Given this PR got a +1 previously, merge now. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lingxiankong 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 |
* NodeGetVolumeStats() implementation Signed-off-by: Andrey Klimentyev <[email protected]> * Sanity checks and removal of magic numbers Signed-off-by: Andrey Klimentyev <[email protected]> * Rewrite Signed-off-by: Andrey Klimentyev <[email protected]> * + * + * Latest fixes Signed-off-by: Andrey Klimentyev <[email protected]>
The binaries affected:
What this PR does / why we need it:
Knowing Volume capabilities helps to sleep at night (also, capacity planning).
Which issue this PR fixes:
fixes #669
Special notes for reviewers:
The test is ugly right now. Should I mock a
resizefs
call?Release note:
This change is