kubewarden / kubewarden-controller

Manage admission policies in your Kubernetes cluster with ease
https://kubewarden.io
Apache License 2.0
189 stars 33 forks source link

Increase the usage of `metadata.ownerReferences` #660

Closed flavio closed 4 months ago

flavio commented 7 months ago

Each PolicyServer resource owns a series of Kubernetes resources:

Currently none of these resources are set to be owned by the PolicyServer instance that created them. Because of that, we have this custom code that deals with the cleanup of these resources.

We can rely on Kubernetes' garbage collector to cleanup all these resources, removing code from our code base.

Acceptance criteria

jvanz commented 5 months ago

@kubewarden/kubewarden-developers this is block due an issue in the upgrade process of the controller. As we discussed during one of our daily, I'll work on code to use the createOrUpdate helper function from the controller-runtime package to simplify our code and workaround this.

jvanz commented 5 months ago

I've rebased the PR for this issue on top of #730 . Moving this to block until we merge that PR.

jvanz commented 4 months ago

As now we merge all the refactoring PRs in the controller, I'll resume this work. Starting by retesting the upgrade process