Thanks for taking the time to contribute to the project. These guidelines will help you get started with the Cross-cluster Connectivity project.
The majority of our tests use the Ginkgo BDD framework to write our tests. Any new tests written should also be written using Ginkgo and Gomega.
To run the unit tests for the Cross-cluster Connectivity components, run the following command:
make test-unit
When you want to build new images of the components, with local changes, to deploy to a Kubernetes cluster, you can run:
make build-images
These images can then be deployed into a set of
Kind clusters by running (NOTE: If you are
encountering rate limiting issues with Docker Hub you can specify
DOCKERHUB_PROXY
to use a mirror):
make e2e-up
At the end of this you will have a local end-to-end development environment.
There will be a management
cluster with Cluster
API deployed on it and two workload clusters
called cluster-a
and cluster-b
.
These tests verify the end-to-end functionality of the Cross-cluster
Connectivity components. The test creates an example exported service on
cluster-a
and tests connectivity to it from cluster-b
.
With the clusters created by the e2e-up
above, run the following command:
make test-cluster-api-dns
After running e2e-up
, there will be three kubeconfig files created in the repo
root: management.kubeconfig
, cluster-a.kubeconfig
, cluster-b.kubeconfig
.
For example, to get the pods on cluster-a
you can run:
kubectl --kubeconfig ./cluster-a.kubeconfig get pods -A
Run the following to tear down the Kind clusters created by e2e-up
:
make e2e-down
If you are introducing any new source files, then you must add the license to the top of every file. This can be done automatically using:
make addlicense
This section describes the process for contributing a bug fix or new feature.
Please raise an issue before working on any code. This helps us discuss any proposed changes to the project before you spend your valuable time working on it.
- Have a short subject on the first line and a body. The body can be empty.
- Use the imperative mood (ie "If applied, this commit will (subject)" should make sense).
- Target the
main
branch in your pull request. Ifmain
has moved on, you may need to rebase and resolve any conflicts before we can merge. - Add any test cases where they make sense.
- Update any document as applicable.
- Add license to any new source files
- Sign the CLA
We welcome contributions from everyone but we can only accept them if you sign our Contributor License Agreement (CLA). If you would like to contribute and you have not signed it, our CLA-bot will walk you through the process when you open a Pull Request. For questions about the CLA process, see the FAQ or submit a question through the GitHub issue tracker.