This is demo project to use rancher/wrangler to write controllers. Comparing the client-go and controller-runtime, it provide more convinent interface to write the controllers. Besides, you don't need to generate code with CLI. Instead, it encapsulate into code piece that you could run with golang.
Run make all
.
Like distributed lock, usually we hope there is one controller to monitor the resource to avoid data race or race condition. So, we could make use of wrangler leader.RunOrDie
which uses kubernetes lease to achieve the distributed lock.
More example here
You could use fake client to do unit test without building a kubernetes environment. But, remember to use custom resource fake client if would like to test custom resource controller behavior.
More example here