cybozu-go / accurate

Kubernetes controller for multi-tenancy. It propagates resources between namespaces accurately and allows tenant users to create/delete sub-namespaces.
https://cybozu-go.github.io/accurate/
Apache License 2.0
34 stars 5 forks source link

test: migrate envtests to komega #116

Closed erikgb closed 6 months ago

erikgb commented 6 months ago

This introduces komega from controller-runtime envtest framework. IMO it makes the test more readable and test-code shorter. Also standardizing on the Ginkgo pattern to use Expect(<func>).Should(Succeed()) when the K8s client operation is supposed to success without error. It just makes things a bit more compact.

I hope you like this, and that the PR is reviewable. It is a bit large in the number of changes, but I have attempted to change things in a way that doesn't clutter the diff.

This PR is mainly motivated by planned test improvements in https://github.com/cybozu-go/accurate/pull/112.