This document contains a quickstart guide to build and running and debugging the operator locally. Being able to run and build the binary locally can help with faster feedback-cycles.
- Follow the general setup to be able to run e2e tests locally with our suite as described here, which includes the usage of telepresence:
- contributing.md
- build_operator_locally.md
- If above has been configured there should be either:
$HOME/.kube/config
KUBECONFIG
environment variable pointing at a file- Note: either of these are necessary to be able to run the operator locally
- Have a folder
.community-operator-dev
- Optional - if you want to export the environment variables, you can run the following command:
source .community-operator-dev/local-test.export.env
. ( These environment variables are generated with themake generate-env-file
)
- Run the operator locally as a binary (optionally in debug mode) in command line or in an IDE
- Run e2e tests locally
- Use the dedicated make target which exports the needed environment variables and builds & runs the operator binary
make run
- For debugging one can use the following make target, which uses dlv:
make debug
- Our e2e tests, contains sub-steps that will install the following helm-chart: operator.yaml
- By default, the template chart sets the number of operator replicas to
1
. This will clash with our local running operator. With this in mind the solution is to set the replicas number to0
temporarily. - Follow the guide on how to run
e2e
tests as described in our contributing.md, for instance:
make e2e-telepresence test=<test-name>