Testing Kubernetes controller is a big subject, and the boilerplate testing files generated for you by kubebuilder are fairly minimal.
Until more documentation has been written, your best bet to get started is to look at some existing examples, such as:
- Azure Databricks Operator: see their fully fleshed-out
suite_test.goas well as any
*_test.gofile in that directory like this one.
The basic approach is that, in your generated
suite_test.go file, you will
create a local Kubernetes API server, instantiate and run your controllers, and
then write additional
*_test.go files to test it using