kubernetes-sigs / sig-storage-lib-external-provisioner

Apache License 2.0
539 stars 172 forks source link

Fix removal of PV protection finalizer #173

Closed jsafrane closed 2 months ago

jsafrane commented 2 months ago

What type of PR is this? /kind bug

What this PR does / why we need it: removeFinalizer() should not modify the input array of finalizers, because that is directly PV object finalizers and thus it would modify the source PV.

We need the initial PV intact to compute correct JSON patch from the initial PV to a PV with removed finalizers.

Allocate a separate slice instead.

Which issue(s) this PR fixes:

Fixes https://github.com/kubernetes-csi/external-provisioner/issues/1235

Does this PR introduce a user-facing change?:

Fixed removal of PV protection finalizer. PVs are no longer Terminating forever after PVC deletion.
k8s-ci-robot commented 2 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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: - ~~[OWNERS](https://github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/blob/master/OWNERS)~~ [jsafrane] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
carlory commented 2 months ago

/lgtm