Skip to content

ENVTest - cannot delete PVCs in BDD test #2854

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

Closed
rahulsb opened this issue Jun 17, 2024 · 5 comments
Closed

ENVTest - cannot delete PVCs in BDD test #2854

rahulsb opened this issue Jun 17, 2024 · 5 comments

Comments

@rahulsb
Copy link

rahulsb commented Jun 17, 2024

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

@sbueringer
Copy link
Member

I assume usually the kube-controller-manager does something there? (it doesn't exist in envtest)

@Yesphet
Copy link
Contributor

Yesphet commented Jul 12, 2024

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.

@rahulsb
Copy link
Author

rahulsb commented Jul 15, 2024

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.

thanks @Yesphet , this solution works.

@sbueringer
Copy link
Member

Great!

/close

@k8s-ci-robot
Copy link
Contributor

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants