Development environment for dex-operator
November 23, 2018 ยท View on GitHub
Project structure
This project follows the conventions presented in the standard Golang project.
Dependencies
go >= 1.11
Bumping the Kubernetes version used by dex-operator
Update the constraints in go.mod.
Building
A simple make should be enough. This should compile the main
function and generate a dex-operator binary as
well as a Docker image.
Running tests
Unit tests
Unit tests can be run using make test
Integration tests
Integration tests can be run using make integration
Code Coverage:
Run first the tests.
Then you can visualize the profile in html format:
go tool cover -html=cover.out
or use the make coverage target
Feel free to read more about this on : https://blog.golang.org/cover.
Regenerating CRDs, RBAC and the deployment all-in-one manifest
Some files are autogenerated when you run the integration tests, like the CRD generation
under (config/crds) or the RBAC generation under (config/rbac). Also, our all-in-one
manifest can be generated by running make manifests.
-
make integration- Will automatically regenerate files under
config{crds,rbac}
- Will automatically regenerate files under
-
make manifests- Will take some files from
config{crds,rbac}and will generate the all-in-one manifest underdeployments/dex-operator-full.yaml
- Will take some files from
Running dex-operator in your Development Environment
There are multiple ways you can run the dex-operator for bootstrapping
and managinig your Kubernetes cluster:
... in your local machine
You can run the dex-operator container locally with a
make local-run. This will:
- build the
dex-operatorimage - run it locally
- using the
kubeconfigin/etc/kubernetes/admin.conf - using the config files in
../config
- using the