sig-storage-lib-external-provisioner
sig-storage-lib-external-provisioner copied to clipboard
test annDynamicallyProvisioned by ctrl.knownProvisioner
I see
https://github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/blob/a35bec6eb688ef7a0e31b340ed77bdb84010ace7/controller/controller.go#L1452
set annDynamicallyProvisioned from StorageClass.Provisioner, and test it using knownProvisioner with comments
https://github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/blob/a35bec6eb688ef7a0e31b340ed77bdb84010ace7/controller/controller.go#L1372-L1378
But in updatePersistentVolume and shouldDelete just use plain ann != ctrl.provisionerName to make comparison
https://github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/blob/a35bec6eb688ef7a0e31b340ed77bdb84010ace7/controller/controller.go#L1233
https://github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/blob/a35bec6eb688ef7a0e31b340ed77bdb84010ace7/controller/controller.go#L1288
Should these places also use knownProvisioner method?
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: ayanamist / name: ayanamist (ee677a33821e5a068fef90d99a575474c960d13d)
Welcome @ayanamist!
It looks like this is your first PR to kubernetes-sigs/sig-storage-lib-external-provisioner 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.
You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.
You can also check if kubernetes-sigs/sig-storage-lib-external-provisioner has its own contribution guidelines.
You may want to refer to our testing guide if you run into trouble with your tests not passing.
If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!
Thank you, and welcome to Kubernetes. :smiley:
Hi @ayanamist. 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.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: ayanamist
To complete the pull request process, please assign wongma7 after the PR has been reviewed.
You can assign the PR to them by writing /assign @wongma7 in a comment when ready.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
/ok-to-test
you are right. we have a test for the shouldProvision case but not the shouldDelete.
https://github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/blob/a35bec6eb688ef7a0e31b340ed77bdb84010ace7/controller/controller_test.go#L934-L941
please add an analogous shouldDelete test case to validate this fix , somewhere here https://github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/blob/a35bec6eb688ef7a0e31b340ed77bdb84010ace7/controller/controller_test.go#L1065
in practice this hasn't caused any actual issues for CSI migration use-cases because then the second part of the if statement evaluates false.. https://github.com/kubernetes/kubernetes/blob/df1a3ddc9811969ad464b98ec5ec8972e907f778/pkg/controller/volume/persistentvolume/pv_controller_base.go#L473
for non CSI migration use-cases the second part evaluates true so then there might be issues if for some reason additionalProvisionerNames is set. This is very unlikely though because additionalProvisionerNames was added specifically for CSI migration use-cases, i don't know why anybody would set it otherwise
table for my own comprehension...
| - | CSI migration | non-CSI migration use-case |
|---|---|---|
| additionalProvisionerNames set to e.g. kubernetes.io/aws-ebs | shoulddelete works as intended since migratedTo == ctrl.provisionerName e.g. ebs.csi.aws.com | shoulddelete does not work as intended, this PR fixes it |
| additionalProvisionerNames empty | N/A, unsupported scenario | shoulddelete works as intended since provisionedBy == ctrl.provisionerName |
We have a very large cluster with handreds thousands pods and PV claims, so we use one single csi-controller with sidecars (external-provisioner and external-attacher) to serve multiple StorageClass so that it will use less CPU+Mem resources than multiple csi-controllers, so we reuse additionalProvisionerNames and it works with this PR merged.
Will you take this scene into consideration and merge this one if tests are added?
BTW test above is failed for gofmt failed at files not modified by me and can't be reproduced in my machine.
ack, makes sense.
I'll fix the gofmt thing in a separate PR
@wongma7 Tests are now added and passed.
BTW, pull-sig-storage-lib-external-provisioner-unit is a duplicate of pull-sig-storage-lib-external-provisioner-build, because make already includes make test
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale - Mark this issue or PR as rotten with
/lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
@ayanamist: PR needs rebase.
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.
It seems this issue is resolved by commit ee0d78c4 already.