This repo accompanies the talk Testing Kubernetes CRDs at Kubecon Shanghai 2018.
These tests are generated by kubebuilder and use Ginkgo. They will start a controller process and api server locally.
The test (which hasn't been modified from the default) lives in feline_controller_test.go.
To run these tests:
go test ./pkg/controller/feline
After you have deployed the controller, you can run the integration tests against
the current-context
cluster in your kube config:
go test -v -count=1 -tags=e2e ./client-go/test
go test -v -count=1 -tags=e2e ./kubebuilder/test
-count=1
is the idiomatic way to disable test caching.
You can override the kubeconfig and context if you'd like:
go test -v -tags=e2e -count=1 ./client-go/test --kubeconfig ~/special/kubeconfig --cluster myspecialcluster