getporter / operator

The Porter Operator gives you a native, integrated experience for managing your bundles from Kubernetes. It is the recommended way to automate your bundle pipeline with support for GitOps.
https://porter.sh/operator
Apache License 2.0
31 stars 18 forks source link

Use controller-runtime controllerutil package #255

Open troy0820 opened 1 year ago

troy0820 commented 1 year ago

What design is being proposed?

We have a lot of functionality that is already done in the controllerutil package of controller-runtime. We can leverage this to remove the complexity of writing our own and reduce cognitive load around functionality that already exists.

Since upgrading controller-runtime we can also use interceptors in our unit tests which act like a prependReactor from client-go to assert on the failures of certain client calls.

Additional Context

This will help provide a means to help maintainability around the operator going forward.

Risks/Concerns

Benefits include utilizing a lib that already does what we need to replace the shared logic we are trying to consume and decouple the things we have rolled out to better create the operator going forward.

What other approaches were considered?

If we don't do it, we suffer the implementation that was used from over a year ago to maintain what could be utilized with a lib we already import.

Implementation details

Swapping out functions, deleting old code and updating the use cases we wish to implement.

Checklist

troy0820 commented 11 months ago

We have a lot of functions that do what this package does such as

remove<name of thing>Finalizer which actually uses the package in question. If we want to standardize around this to not have as many functions which do the same thing, we can optimize here.