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

Attacher reacts for deleted PVs if finalizer is present #218

Merged
merged 1 commit into from
Mar 31, 2020

Conversation

rfranzke
Copy link
Contributor

What type of PR is this?
/kind bug

What this PR does / why we need it:
When a PersistentVolume gets deleted the external-attacher should consider it in case it has previously added its finalizer to it. Otherwise (for create/update operations), it can continue to only consider it if .spec.csi != nil.

Which issue(s) this PR fixes:
Fixes #217

Special notes for your reviewer:
NONE

Does this PR introduce a user-facing change?:

A bug that prevented the external-attacher from releasing its finalizer from a `PersistentVolume` object that was created using a legacy storage class provisioner has been fixed.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. 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 Mar 25, 2020
@k8s-ci-robot
Copy link
Contributor

Welcome @rfranzke!

It looks like this is your first PR to kubernetes-csi/external-attacher 🎉. 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-csi/external-attacher 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. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @rfranzke. Thanks for your PR.

I'm waiting for a kubernetes-csi 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 25, 2020
@rfranzke
Copy link
Contributor Author

rfranzke commented Mar 25, 2020

/assign @jsafrane
/assign @pohly
/assign @msau42

@pohly pohly removed their assignment Mar 26, 2020
@jsafrane
Copy link
Contributor

/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 Mar 26, 2020
Copy link
Contributor

@jsafrane jsafrane left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. I like it, however, can you please add an unit test for a migrated volume? Something like this, but with a migrated PV (so create migratedPVWithFinalizer()):

{
name: "VA deleted -> PV finalizer removed",
initialObjects: []runtime.Object{pvDeleted(pvWithFinalizer())},
deletedVA: va(false, "", nil),
expectedActions: []core.Action{
core.NewPatchAction(pvGroupResourceVersion, metav1.NamespaceNone, testPVName,
types.MergePatchType, patch(pvDeleted(pvWithFinalizer()),
pvDeleted(pv()))),
},
},

@jsafrane
Copy link
Contributor

@rfranzke, are you still working on the fix? IMO it's very close to get merged.

@rfranzke
Copy link
Contributor Author

Yes, sorry, I was busy the last days. I'll finish it tonight.

@rfranzke
Copy link
Contributor Author

Can you please check again? I was not entirely sure what you meant with

can you please add an unit test for a migrated volume? Something like this, but with a migrated PV (so create migratedPVWithFinalizer()):

Do you consider a migrated PV a PV with the annotation? If so, how is it related to the change? Instead, I added three test cases for the finalizer removal, please check if this is what you meant.

@jsafrane
Copy link
Contributor

I did not notice there already is gcePDPVWithFinalizer. You got it right :-).

/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 Mar 31, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jsafrane, rfranzke

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 Mar 31, 2020
@k8s-ci-robot k8s-ci-robot merged commit 9a20c3f into kubernetes-csi:master Mar 31, 2020
@rfranzke rfranzke deleted the hotfix-v2.1 branch March 31, 2020 07:48
@rfranzke
Copy link
Contributor Author

Thanks for approving! Do you want me to open a cherry-pick PR for the release-2.1 branch?

sunnylovestiramisu added a commit to sunnylovestiramisu/external-attacher that referenced this pull request Apr 12, 2023
6613c398 Merge pull request kubernetes-csi#223 from sunnylovestiramisu/update
0e7ae993 Update k8s image repo url
77e47cce Merge pull request kubernetes-csi#222 from xinydev/fix-dep-version
155854b0 Fix dep version mismatch
8f839056 Merge pull request kubernetes-csi#221 from sunnylovestiramisu/go-update
1d3f94dd Update go version to 1.20 to match k/k v1.27
e322ce5e Merge pull request kubernetes-csi#220 from andyzhangx/fix-golint-error
b74a5120 test: fix golint error
aa61bfd0 Merge pull request kubernetes-csi#218 from xing-yang/update_csi_driver
7563d196 Update CSI_PROW_DRIVER_VERSION to v1.11.0
a2171bef Merge pull request kubernetes-csi#216 from msau42/process
cb987826 Merge pull request kubernetes-csi#217 from msau42/owners
a11216e4 add new reviewers and remove inactive reviewers
dd986754 Add step for checking builds
b66c0824 Merge pull request kubernetes-csi#214 from pohly/junit-fixes
b9b6763b filter-junit.go: fix loss of testcases when parsing Ginkgo v2 JUnit
d4277839 filter-junit.go: preserve system error log
38e11468 prow.sh: publish individual JUnit files as separate artifacts

git-subtree-dir: release-tools
git-subtree-split: 6613c3980d1e418bebb7bc49d64c977cfff85671
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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to release finalizer for PVs created via legacy storage class
5 participants