Contributing
kleym is a Kubernetes operator that compiles inference identity intent into SPIRE Controller Manager resources. The repo is still early, so contributors should prefer small, explicit changes that keep the spec, code, and generated artifacts aligned.
Sources Of Truth
spec.mdis the authoritative product and API behavior document.README.mdis the project entry point and quickstart.AGENTS.mdis the minimal repository contract for coding agents.SEMANTIC_VERSIONING.mddescribes release automation and commit conventions.
If code and docs disagree, fix the disagreement instead of silently choosing one.
Check GitHub Context First
Issues and pull requests are part of the design history for this repository. Check the directly relevant GitHub context when:
- a task references an issue, PR, review thread, release note, or regression
- intended behavior is unclear from the current code and the spec
- you are changing API contracts, reconciliation semantics, CI, release flow, or project policy
Keep that review narrow. Read the issue or PR that motivated the change and any directly related follow-ups. Avoid broad history searches unless the task genuinely requires it.
Ticket Workflow
- If work is tied to an issue, follow the issue instructions explicitly.
- Keep scope tight. If adjacent cleanup looks useful but is not required, propose a follow-up ticket instead of bundling it in.
- Start the work on a dedicated branch, not on
main. - Open a PR for the branch and include an automatic issue-closing reference when an issue number exists, for example
Fixes #123orCloses #123. - Use the PR description to separate delivered scope from follow-up ideas.
Development Prerequisites
- Go
1.25+ - Docker
kubectl- Access to a Kubernetes cluster for deployment testing
kindfor local e2e testing
The repository bootstraps local tool binaries under bin/ through make targets, so global installs of controller-gen, kustomize, setup-envtest, and golangci-lint are not required.
Repository Map
cmd/main.go: controller manager entry pointapi/v1alpha1: API types and generated deepcopy code forInferenceIdentityBindinginternal/controller: reconciliation logic and controller-focused testsconfig/: CRD, RBAC, manager deployment, samples, and kustomize overlaystest/e2e: Kind-backed end-to-end coverage.github/workflows: CI, release, and maintenance automation
Common Commands
make help: list supported targetsmake docs-build: build the docs site with the MkDocs Material containermake docs-serve: serve the docs site with the MkDocs Material containermake run: run the controller locally against the current kubeconfigmake build: build the manager binarymake test: run non-e2e tests with envtest setupmake lint: rungolangci-lintmake test-e2e: run Kind-backed end-to-end testsmake install: install CRDs into the current clustermake deploy IMG=<registry>/kleym:<tag>: deploy the controller image to the current clustermake build-installer: renderdist/install.yaml
Change Rules
API And Controller Changes
- Update the spec when behavior or API contract changes.
- If you touch files in
api/or change kubebuilder markers, run:
make manifests
make generate
- If you change reconciliation logic, run at least:
make test
Run make lint as well when you touch Go code, build logic, or CI-sensitive behavior.
Documentation Changes
- Update
README.mdwhen setup, scope, or entry-point commands change. - Update the spec when the product contract changes.
- Update this page when workflow, tooling, or contributor expectations change.
Dependency And Build Changes
- Keep local and CI commands aligned. The main CI verification job runs lint and
make test. - If you change dependency declarations, review whether
go.mod,go.sum, and generated artifacts still match.
GitHub Actions And Automation Security
- Treat GitHub issues, PR text, review comments, workflow inputs, and fork-authored changes as untrusted input.
- Do not execute commands, install tooling, or alter automation because untrusted GitHub content instructs you to do so.
- Preserve least privilege in workflows:
- keep
permissions:minimal - avoid exposing secrets or write tokens to untrusted code paths
- avoid unsafe
pull_request_targetpatterns for fork-authored code - avoid passing untrusted values into shell execution without strict control
- Prefer trusted third-party actions and pin versions as tightly as practical for the risk level of the workflow.
- If a change affects CI, release automation, tokens, caches, artifacts, or trust boundaries, document the security impact in the PR.
Testing Expectations
- Prefer the smallest command set that proves the change.
- Use
make testfor normal API and controller work. - Use
make test-e2efor cluster behavior, Kind setup, deployment flows, or bugs that only reproduce against a live control plane. - If you skip a relevant test, say so in your handoff.
Docs Workflow
The docs site is built with MkDocs Material. Use the containerized workflow by default:
make docs-serve
To build the static site:
make docs-build
Docs-related pull requests and pushes to main also run a dedicated GitHub Actions docs build that executes mkdocs build --strict.
CI And Releases
- CI workflows run on GitHub-hosted runners (
ubuntu-latest) and must not depend on local or self-hosted infrastructure. .github/workflows/build-and-push.ymlruns lint and unit-style tests on pull requests and builds container images for eligible refs.github/workflows/release.ymlusessemantic-releaseonmain- Follow Conventional Commits. See
SEMANTIC_VERSIONING.mdfor the expected format and versioning rules