We use the following tools for development. Some are installed via script (as stated):
- ko - Used to build the container images with
make images, installed via Makefile - golangci-lint - Used to lint the codebase with
make check, installed via Makefile (Gardener Script) - mirrord - Intercept and redirect traffic for local debugging
For rapid iteration cycles, you can use mirrord to run or debug the
provider extension in an existing Gardener installation. Run the make targets mirrord-debug and mirrord-run
with your KUBECONFIG pointing to a seed cluster. These targets will scale down the existing deployment to 1 replica
(to intercept webhook calls), disable all controllers running in the cluster, and then run/debug the application with the files,
environment variables, and command line flags used in the cluster. All webhook requests will be intercepted and redirected to
your local machine.
When debugging, the script starts a headless dlv server that you can attach to from your IDE. For example, with VSCode:
# launch.json
{
"configurations": [
{
"name": "Debug in-cluster",
"type": "go",
"request": "attach",
"mode": "remote",
"port": 2345,
"host": "127.0.0.1",
}
]
}Create a classic personal access token in GitHub. Set an expiration date and enable the write:packages scope.
Note: Using a token generated by the gh cli is not sufficient.
Login to the ghcr.io registry. When asked for a password, paste the access token:
ko login -u <your_username> --password-stdin ghcr.ioBuild image and push to the regsitry:
PUSH=true make artifactsThe pushed image name and tag are logged to the console.