ENVTest - cannot delete PVCs in BDD test
In my BDD test of operator, I would like to delete the PVCs created before running nee test as the cleanup. While deleting the PVC they remains in the pending state. Are there any workaround or solutions using ENVTest.
Using : sigs.k8s.io/controller-runtime v0.16.5
I assume usually the kube-controller-manager does something there? (it doesn't exist in envtest)
This is because the finalizer kubernetes.io/pvc-protection is automatically added when creating the PVC, but there is no controller to handle the finalizer when deleting in the ENVTest environment, so the PVC remains in pending. You can perform an update or patch to remove the finalizer of the PVC before deleting.
This is because the finalizer
kubernetes.io/pvc-protectionis automatically added when creating the PVC, but there is no controller to handle the finalizer when deleting in the ENVTest environment, so the PVC remains in pending. You can perform an update or patch to remove the finalizer of the PVC before deleting.
thanks @Yesphet , this solution works.
Great!
/close
@sbueringer: Closing this issue.
In response to this:
Great!
/close
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-sigs/prow repository.