Skip to content
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

fix: ListVolumes should be able to return volumes from external rgs as well #725

Merged
merged 2 commits into from
Feb 23, 2021

Conversation

sunpa93
Copy link
Contributor

@sunpa93 sunpa93 commented Feb 9, 2021

What type of PR is this?

/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #632

Requirements:

Special notes for your reviewer:

Release note:

none

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 9, 2021
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 9, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @sunpa93. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Feb 9, 2021
Copy link
Member

@andyzhangx andyzhangx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 9, 2021
pkg/azuredisk/controllerserver.go Outdated Show resolved Hide resolved
pkg/azuredisk/controllerserver.go Outdated Show resolved Hide resolved
@andyzhangx
Copy link
Member

/test pull-azuredisk-csi-driver-e2e-single-az

@andyzhangx
Copy link
Member

/ListVolumes still shows k8s-master-23068744-0-etcddisk disk which is actually not a disk PVC in current testing cluster, with this PR, I think it should filter out non disk PVC:

I0210 13:01:32.449448       1 utils.go:95] GRPC call: /csi.v1.Controller/ListVolumes
I0210 13:01:32.449477       1 utils.go:96] GRPC request: {}
I0210 13:01:32.478981       1 utils.go:102] GRPC response: {"entries":[{"status":{"published_node_ids":["k8s-master-23068744-0"]},"volume":{"volume_id":"/subscriptions/0e46bd28-a80f-4d3a-8200-d9eb8d80cb2e/resourceGroups/kubetest-b3c1e461-6b9e-11eb-ae9b-f6d3fab2f43c/providers/Microsoft.Compute/disks/k8s-master-23068744-0-etcddisk"}},{"status":{"published_node_ids":["k8s-agentpool1-23068744-0"]},"volume":{"volume_id":"/subscriptions/0e46bd28-a80f-4d3a-8200-d9eb8d80cb2e/resourceGroups/kubetest-b3c1e461-6b9e-11eb-ae9b-f6d3fab2f43c/providers/Microsoft.Compute/disks/shared-disk-multiple-pods"}}]}

https://storage.googleapis.com/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_azuredisk-csi-driver/725/pull-azuredisk-csi-driver-e2e-single-az/1359484751718649856/build-log.txt

pkg/azuredisk/controllerserver.go Outdated Show resolved Hide resolved
pkg/azuredisk/controllerserver.go Outdated Show resolved Hide resolved
pkg/azuredisk/controllerserver.go Outdated Show resolved Hide resolved
pkg/azuredisk/controllerserver.go Outdated Show resolved Hide resolved
pkg/azuredisk/controllerserver.go Outdated Show resolved Hide resolved
pkg/azuredisk/controllerserver.go Outdated Show resolved Hide resolved
pkg/azuredisk/controllerserver.go Outdated Show resolved Hide resolved
pkg/azuredisk/controllerserver.go Outdated Show resolved Hide resolved
@andyzhangx
Copy link
Member

at least List Volumes in Cluster works now, while etcd disk is still in the result, for every disk, it should exist in cluster disk PV
list, otherwise should filter out:

I0218 08:43:30.711123       1 utils.go:95] GRPC call: /csi.v1.Controller/ListVolumes
I0218 08:43:30.711155       1 utils.go:96] GRPC request: {}
I0218 08:43:30.711212       1 controllerserver.go:529] List Volumes in Cluster:
I0218 08:43:30.716771       1 round_trippers.go:445] GET https://10.0.0.1:443/api/v1/persistentvolumes 200 OK in 5 milliseconds
I0218 08:43:30.749000       1 utils.go:102] GRPC response: {"entries":[{"status":{"published_node_ids":["k8s-master-25577820-0"]},"volume":{"volume_id":"/subscriptions/0e46bd28-a80f-4d3a-8200-d9eb8d80cb2e/resourceGroups/kubetest-c8dc526e-71c3-11eb-9324-be3a24f54b97/providers/Microsoft.Compute/disks/k8s-master-25577820-0-etcddisk"}}]}

https://storage.googleapis.com/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_azuredisk-csi-driver/725/pull-azuredisk-csi-driver-e2e-windows/1362318569785790464/build-log.txt

@sunpa93
Copy link
Contributor Author

sunpa93 commented Feb 18, 2021

at least List Volumes in Cluster works now, while etcd disk is still in the result, for every disk, it should exist in cluster disk PV
list, otherwise should filter out:

I0218 08:43:30.711123       1 utils.go:95] GRPC call: /csi.v1.Controller/ListVolumes
I0218 08:43:30.711155       1 utils.go:96] GRPC request: {}
I0218 08:43:30.711212       1 controllerserver.go:529] List Volumes in Cluster:
I0218 08:43:30.716771       1 round_trippers.go:445] GET https://10.0.0.1:443/api/v1/persistentvolumes 200 OK in 5 milliseconds
I0218 08:43:30.749000       1 utils.go:102] GRPC response: {"entries":[{"status":{"published_node_ids":["k8s-master-25577820-0"]},"volume":{"volume_id":"/subscriptions/0e46bd28-a80f-4d3a-8200-d9eb8d80cb2e/resourceGroups/kubetest-c8dc526e-71c3-11eb-9324-be3a24f54b97/providers/Microsoft.Compute/disks/k8s-master-25577820-0-etcddisk"}}]}

https://storage.googleapis.com/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_azuredisk-csi-driver/725/pull-azuredisk-csi-driver-e2e-windows/1362318569785790464/build-log.txt

It already filters out any volume that was not found in the pv list (https://github.com/sunpa93/azuredisk-csi-driver/blob/listvolume-fix/pkg/azuredisk/controllerserver.go#L661-L664). Should we try to manually filter out etcd disks either by string comparison or checking disk properties?

I just found out that the filtering check was being done in opposite; it added to the entries only the volumes not in the pv list. I have fixed the filtering, so it should filter out etcd disks fine now :)

@sunpa93
Copy link
Contributor Author

sunpa93 commented Feb 18, 2021

/test pull-azuredisk-csi-driver-e2e-migration

@sunpa93
Copy link
Contributor Author

sunpa93 commented Feb 18, 2021

/test pull-azuredisk-csi-driver-e2e-single-az

pkg/azuredisk/controllerserver.go Outdated Show resolved Hide resolved
pkg/azuredisk/controllerserver.go Show resolved Hide resolved
pkg/azuredisk/controllerserver.go Show resolved Hide resolved
pkg/azuredisk/controllerserver.go Outdated Show resolved Hide resolved
pkg/azuredisk/controllerserver.go Show resolved Hide resolved
@sunpa93
Copy link
Contributor Author

sunpa93 commented Feb 20, 2021

/retest

1 similar comment
@andyzhangx
Copy link
Member

/retest

Copy link
Member

@andyzhangx andyzhangx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 23, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx, sunpa93

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 23, 2021
@andyzhangx
Copy link
Member

/retest

@k8s-ci-robot k8s-ci-robot merged commit 9fb5cb9 into kubernetes-sigs:master Feb 23, 2021
v2beta2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2"
v14 "k8s.io/client-go/kubernetes/typed/batch/v1"
v1beta13 "k8s.io/client-go/kubernetes/typed/batch/v1beta1"
v2alpha1 "k8s.io/client-go/kubernetes/typed/batch/v2alpha1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @sunpa93 where did you copy these code from? We have issue upgrading to k8s v0.21.0 lib

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm, it's fixed

sozercan pushed a commit to sozercan/azuredisk-csi-driver that referenced this pull request Aug 16, 2021
…xamples

chore: Wait for examples to complete and return error on failed rollout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ListVolumes API doesn't list the volumes that are created in an external resource group
4 participants