Currently in the controller we wrote code to detect if policy server resource should be create and/or updated. However, this is not necessary because the controller-runtime package has a helper function that does that for us. Therefore, we shoud use and simplify our code. Which makes our life easier in the longer run because we do not need to keep track of the fields that should trigger a resource update.
@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.
Currently in the controller we wrote code to detect if policy server resource should be create and/or updated. However, this is not necessary because the controller-runtime package has a helper function that does that for us. Therefore, we shoud use and simplify our code. Which makes our life easier in the longer run because we do not need to keep track of the fields that should trigger a resource update.
Originally posted by @jvanz in #660
Acceptance criteria
createOrUpdate
function to create or update the resources created to make the policy server run.