Thank you for your interest in contributing to func-operator! This guide will help you get started.
If you find a bug or have a feature request, please open an issue on GitHub.
- Fork the repository and create your branch from
main. - Make your changes, ensuring they follow the guidelines below.
- Run tests and linting locally before pushing.
- Open a pull request against
main.
All CI checks must pass before a pull request can be merged.
- Go (see
go.modfor the required version) - Docker
- Kind (for local development)
- kubectl
For local development, you can use the provided script to set up a Kind cluster with all prerequisites:
./hack/create-kind-cluster.shThis script will:
- Create a local Kind cluster with multiple worker nodes
- Set up a local container registry on
localhost:5001 - Install Tekton Pipelines
- Install Knative Serving with Kourier
- Configure the cluster to use the local registry
Note: The local registry uses HTTPS with a self-signed certificate. When running E2E tests locally, you need to set REGISTRY_INSECURE=true so the operator accepts the self-signed certificate (see E2E Tests).
make docker-build IMG=<your-registry>/func-operator:latest
make deploy IMG=<your-registry>/func-operator:latestFor debugging the operator with Delve, use the debug targets:
# Build the debug image (includes Delve debugger and debug symbols)
make docker-build-debugger IMAGE_TAG_BASE=<your-registry>/func-operator
# Push the debug image
make docker-push-debugger IMAGE_TAG_BASE=<your-registry>/func-operator
# Deploy the operator in debug mode
make deploy-debugger IMAGE_TAG_BASE=<your-registry>/func-operatorThe debug deployment runs the operator under Delve in headless mode, listening on port 40000. To connect your debugger:
# Port-forward to access the debugger
kubectl port-forward -n func-operator-system deployment/func-operator-controller-manager 40000:40000
# Connect with Delve CLI
dlv connect localhost:40000You can also connect using your IDE's remote debugging features (VS Code, GoLand, etc.) by configuring it to connect to localhost:40000.
After modifying API types or interfaces, regenerate the derived code:
make update-codegenThis runs three sub-targets:
generate— DeepCopy and DeepCopyInto methodsmanifests— CRDs, ClusterRoles, and webhook configurationsgen-mocks— Mock implementations via mockery
make testE2E tests require a Kind cluster with Gitea (an in-cluster Git server providing complete test isolation):
make create-kind-cluster # Sets up cluster with Gitea
REGISTRY_INSECURE=true make test-e2eThe REGISTRY_INSECURE=true flag is required because the local Kind registry uses a self-signed TLS certificate.
See Gitea Integration for details on the test infrastructure.
REGISTRY_INSECURE=true make test-e2e-bundle# Run linter
make lint
# Run linter with auto-fix
make lint-fix