-
Notifications
You must be signed in to change notification settings - Fork 193
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
feat: Implement ListVolumes #618
feat: Implement ListVolumes #618
Conversation
Welcome @nearora-msft! |
Hi @nearora-msft. 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. |
/ok-to-test |
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.
could you also add list-volumes
in integration test:
https://github.com/kubernetes-sigs/azuredisk-csi-driver/blob/master/test/integration/run-test.sh
also is there any way to add e2e tests for this feature? thanks.
# csc controller list-volumes -h
NAME
list-volumes -- invokes the rpc "ListVolumes"
SYNOPSIS
csc controller list-volumes [flags]
ALIASES
list-volumes, ls, list, volumes
OPTIONS
--format
The Go template format used to emit the results
-h, --help
help for list-volumes
--max-entries
The maximum number of entries to return
--paging
Enables auto-paging
--starting-token
The starting token used to retrieve paged data
/test pull-azuredisk-csi-driver-e2e-windows |
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.
Could you also add integration tests and fix the sanity test failure?
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.
in the error logs, pls provide as much info as possible, that would help in troubleshooting
pkg/azuredisk/controllerserver.go
Outdated
} | ||
|
||
if start != 0 && start >= len(disks) { | ||
return nil, status.Errorf(codes.Aborted, "ListVolumes starting token(%d) is greater than total number of volumes", start) |
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.
ListVolumes on rg(%s) starting token(%d) is greater than total number of volumes(%d)
} | ||
} | ||
|
||
disks, derr := d.cloud.DisksClient.ListByResourceGroup(ctx, d.cloud.ResourceGroup) |
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.
actually there are other scenarios that disks are in created other resource group, so ListVolumes result is only accurate for default condition. On the other hand, agent nodes are all in d.cloud.ResourceGroup
, so ListVolumes of all agent nodes would be accurate. I think this could be right solution: list disks of all agent nodes under d.cloud.ResourceGroup
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 am thinking use d.cloud.KubeClient.CoreV1().PersistentVolumes()
to get all PV info and then get all diskURI from pv.csi.volumeid and then get disk.ManagedBy
, that would provide complete disk list, could refer to:
d.cloud.KubeClient.CoreV1()
interface
https://github.com/kubernetes-sigs/azurefile-csi-driver/blob/bb2550070c810ffe94c35eb38aad09c6a3136ade/pkg/azurefile/azurefile.go#L556
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 would require much more work, while it could list all disks this cluster is using, otherwise it could not cover all disks and may provide incomplete disk list, not sure what would happen if disk list is incomplete.
about sanity test failure, need to fix the 5 failures before upgrade to csi sanity test v4.0.2: #622 |
@andyzhangx I think then we can enable the LIST_VOLUMES_PUBLISHED_NODES only after issue #622 is resolved? |
another way is disable that failed test in sanity tests temporarily |
Disabled the failing sanity test temporarily |
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.
pls add csc integration test and squash all commits by git rebase -i HEAD~7
/test pull-azuredisk-csi-driver-sanity |
Added the integration test. Will squash commits once all the checks complete successfully. |
|
Disabled this test because of existing issue kubernetes-csi/csi-test#223 |
/retest |
would you squash all commits first? thanks. |
fix: Add ListVolumes capabilities to the driver fix: Handle case where maxEntries is greater than the number of disks Handle case when both starting_token and number of disks are zero fix: Rectify the attached node name and add more details in logs test: Disable the 'should return appropriate capabilities' sanity test temporarily test: Add unit tests and integration test for ListVolumes test: Fix the ListVolumes unit test test: Disable flaky pagination test test: Add the missing apostrophe at the end of skipped tests string test: Add UTs, integration tests for ListVolumes and disable some sanity tests feat: Implement ListVolumes
/retest |
1 similar comment
/retest |
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andyzhangx, nearora-msft 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 |
looks like it's a flacky test, could you fix it? thanks: /hold |
/retest |
The test that is failing performs these steps:
It expects that the List Volumes count in step 3 should be List Volumes count in step 1 + 1. But the actual case is that List Volumes count in step 3 = List Volumes count in step1 +2. This is why the test fails. I have observed that when a vm is created a disk is attached to it by default. While running the tests, we create an rg and a sanity-test-node in that rg . The creation of this node should create a disk and attach is to the newly created node. So when the ListVolumes call is made the 1st time, it usually lists the disk that was created with the creation of sanity-test-node. So, we get 1 entry in the 1st call and 2 entries in the 2nd call. But in this failed case, the 1st ListVolumes call doesn't give any results(Could be because the default disk attach has not happened yet ) And when the ListVolumes call is made the second time, it returns 2 disks(One that was created by the vm creation and the other that was created by the test) Not sure how we can fix it at our end(if that's possible) |
/hold cancel |
/retest |
/test pull-azuredisk-csi-driver-e2e-windows |
…ttacher feat: disable attacher by default
What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #378 #617
Requirements:
Special notes for your reviewer:
Release note: