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

PV controller changes to support PV Deletion protection finalizer #105773

Merged
merged 1 commit into from Nov 10, 2021

Conversation

deepakkinni
Copy link
Member

@deepakkinni deepakkinni commented Oct 19, 2021

What type of PR is this?

/kind feature
/sig storage

What this PR does / why we need it:

Add the alpha HonorPVReclaimPolicy feature gate

Which issue(s) this PR fixes:

Fixes # kubernetes/enhancements#2644

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Ensures that volume is deleted from the storage backend when the user tries to delete the PV object manually and the PV ReclaimPolicy is Delete.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

- [KEP]: https://github.com/kubernetes/enhancements/pull/2680

Signed-off-by: Deepak Kinni dkinni@vmware.com

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. sig/storage Categorizes an issue or PR as relevant to SIG Storage. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 19, 2021
@k8s-ci-robot
Copy link
Contributor

@deepakkinni: This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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 needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Oct 19, 2021
@k8s-ci-robot
Copy link
Contributor

Welcome @deepakkinni!

It looks like this is your first PR to kubernetes/kubernetes 🎉. 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/kubernetes 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 @deepakkinni. 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 /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-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 19, 2021
@deepakkinni
Copy link
Member Author

@xing-yang @jsafrane

@xing-yang
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 Oct 20, 2021
@xing-yang
Copy link
Contributor

/assign @jsafrane

@xing-yang
Copy link
Contributor

/assign

@xing-yang
Copy link
Contributor

/milestone v1.23

@k8s-ci-robot k8s-ci-robot added this to the v1.23 milestone Oct 20, 2021
@deepakkinni
Copy link
Member Author

/retest

@jsafrane
Copy link
Member

Can you please add also code for the feature? IMO it's so small that it would fit a single PR (perhaps except e2e tests).

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. sig/apps Categorizes an issue or PR as relevant to SIG Apps. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 29, 2021
@deepakkinni deepakkinni changed the title Add HonorPVReclaimPolicy feature gate PV controller changes to support PV Deletion protection finalizer Oct 29, 2021
@deepakkinni
Copy link
Member Author

Can you please add also code for the feature? IMO it's so small that it would fit a single PR (perhaps except e2e tests).

done.

@deepakkinni deepakkinni force-pushed the 2680_fgate_v1 branch 3 times, most recently from 44e08b3 to 6b8d8fd Compare October 29, 2021 19:28
@deepakkinni
Copy link
Member Author

/retest

@deepakkinni
Copy link
Member Author

/retest

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 2, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 2, 2021
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 8, 2021
Signed-off-by: Deepak Kinni <dkinni@vmware.com>
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 8, 2021
@jsafrane
Copy link
Member

jsafrane commented Nov 10, 2021

/lgtm
/approve

There are "sibling" PRs is other components that look mostly OK: kubernetes-sigs/sig-storage-lib-external-provisioner#117 kubernetes-csi/external-provisioner#679

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

[APPROVALNOTIFIER] This PR is APPROVED

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

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 Nov 10, 2021
@k8s-ci-robot k8s-ci-robot merged commit 9b083c4 into kubernetes:master Nov 10, 2021
// provisioner name depending if the annotation came from a PVC or not.
// It will then add a "pv.kubernetes.io/migrated-to" annotation if migration with
// the CSI driver name for that provisioner is "on" based on feature flags, it will also
// remove the annotation if migration is "off" for that provisioner in rollback
// scenarios. Returns true if the annotations map was modified and false otherwise.
// remove the PV deletion protection finalizer and "pv.kubernetes.io/migrated-to" annotation
Copy link
Member

Choose a reason for hiding this comment

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

@jsafrane @xing-yang I'm not clear why the finalizer feature is related to csi migration. Could you explain the reasoning?

We're trying to turn on gce migration in #104722 but the unit test is failing.

Copy link
Contributor

Choose a reason for hiding this comment

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

If the finalizer feature is turned on, the finalizer will be added to all csi volumes including csi migrated volumes as well. When the finalizer feature is turned off, we need to make sure the finalizers are deleted.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not clear why the logic to remove the finalizer is tied with the logic that determines if migration is enabled or not. I think it should be independent of any migration logic.

Copy link
Member Author

Choose a reason for hiding this comment

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

The finalizer is added by the external-provisioner on migrated volumes, however, when migration is disabled pv-controller becomes responsible to remove the finalizer since external-provisioner is no longer responsible for that pv. The side-effect of detecting a migration off is removing the finalizer on the pv. The fix is pretty much what is being done in #104722, i.e, introduce a disabledDriverGates in the test struct and add CSIMigrationGCE to if the test description mentions disabled migration.

Copy link
Member

Choose a reason for hiding this comment

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

@deepakkinni can you please fix the unit tests? They should set their own feature gate(s) and not depend on the current default in kube_features.go.

Copy link
Member

Choose a reason for hiding this comment

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

Now I remember @deepakkinni said something about public holiday, I submitted #106376

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Nov 15, 2021
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/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. 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. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants