This doc explains how to setup a development environment so you can get started
contributing to Knative net-gateway-api
.
Before submitting a PR, see also:
If you use the konk script to setup your cluster, your cluster will be named knative
. However, most of the scripts expect it to be the default kind
name. Set the kind cluster name env export KIND_CLUSTER_NAME=knative
to point to knative
cluster. KO requires a registry which if you are developing locally you could use export KO_DOCKER_REPO=kind.local
to use the local one on kind. Please see official KO documentation for more information.
Versions to be installed are listed in hack/test-env.sh
.
Tests are currently wip. Please see README#tests
- A running cluster
- Knative serving installed
ko
(for development and testing)kubectl
(for managing development environments)bash
v4 or later. On macOS the default bash is too old, you can use Homebrew to install a later version.
To start your environment you'll need to set KO_DOCKER_REPO
: The repository to which developer/test images should be pushed. Ex:
export KO_DOCKER_REPO='gcr.io/my-gcloud-project-id'
- If you are using Docker Hub to store your images your
KO_DOCKER_REPO
variable should bedocker.io/<username>
. - Currently Docker Hub doesn't let you create subdirs under your username.
- You'll need to be authenticated with your
KO_DOCKER_REPO
before pushing images.- Google Container Registry:
gcloud auth configure-docker
- Docker Hub:
docker login
- Google Container Registry:
NOTE: this is only required when you run conformance/e2e tests locally with go test
commands, and may be required periodically.
The upload-test-images.sh
script can be used to build and push the test images used by the conformance and e2e tests.
./test/upload-test-images.sh
- Calling the script without arguments will create a new cluster in your current GCP project (assuming you have one) and run the tests against it.
- Calling the script with
--run-tests
and the variableKO_DOCKER_REPO
set will immediately start the tests against the cluster currently configured forkubectl
. - Use the script with
--kind
to run the tests against a kind cluster.
./test/e2e-tests.sh --istio --run-tests --kind --skip-dump-on-failure
./test/e2e-tests.sh --contour --run-tests --kind --skip-dump-on-failure
To run an individual test use
# Prepare environment
cd test
source e2e-common.sh
initialize --istio --run-tests --kind --skip-dump-on-failure
cd ..
# Running a single conformance test
go_test_e2e -tags=e2e -parallel=1 ./test/conformance \
-enable-alpha \
-enable-beta \
-run ^TestIngressConformance/basics$ \
-ingressClass=gateway-api.ingress.networking.knative.dev