Act like a professional software developer and engineer. Adhere to architecture, naming conventions and coding standards in this codebase. If unsure, read similar files and get inspiration from the rest of the codebase. If introducing new features, make sure to cover them via unit tests and don't forget to take edge cases into account.
Kubernetes operator (controller-runtime) for managing middleware updates for serverless functions deployed with the func CLI. Written in Go, uses Ginkgo/Gomega for tests.
Before committing, test locally following the table below:
| If changed | Target | Description |
|---|---|---|
*.go files |
make test |
Unit tests |
| Any files | make lint |
Linting |
api/ types or interfaces |
make update-codegen |
Regenerate CRDs, DeepCopy, and mock implementations |
| Significant changes | make test-e2e |
E2E tests (Kind cluster with Gitea required - check the CONTRIBUTING.md, for how to setup a local development cluster and how to build and install the operator) |
api/v1alpha1/- Function CRD typesinternal/- controller and business logictest/e2e/- e2e tests using in-cluster Giteatest/utils/- e2e test helpers (RepositoryProvider, func CLI wrappers)hack/- cluster setup scriptsconfig/- Kustomize manifests
- Run
make testbefore considering any change complete - Run
make lintbefore commits - Run
make manifests generateafter modifyingapi/types - Read
CONTRIBUTING.mdfor development setup and workflow
- Security-related code changes (authentication, credentials, secrets handling)
- API changes
- Adding new dependencies
- Modifying CI/GitHub Actions workflows
- Commit secrets, API keys, or credentials
- Delete files without explicit user approval
- Force push to main/master branch
- Skip tests or linting
Read these files to understand the project setup, conventions, and development workflow:
README.md- user-facing usage, API reference table, installationCONTRIBUTING.md- development setup, workflow, coding conventionsdocs/architecture.md- system architecture, reconciliation flow, component interactionsdocs/release.md- release process, branching model, versioningdocs/development/- developer guides (e.g. Gitea integration, test patterns)docs/plans/- design documents capturing rationale and tradeoffs for past decisions
After implementing a feature or making significant changes, check whether these docs need updating. The API reference table in README.md must stay in sync with api/v1alpha1/function_types.go.