Event-driven Kubernetes resource manager. Consumes CloudEvents from a message broker, executes configured actions (K8s resource apply, HyperFleet API calls, Maestro ManifestWork), and reports status back.
Go 1.26.0 · Cobra CLI · Viper config · golangci-lint (pinned in tools/go.mod) · Tekton CI (Konflux)
make install-hooks # Install pre-commit hooks (secret scanning, linting, etc.)
make build # Build binary → bin/hyperfleet-adaptermake fmt # Format code + imports (golangci-lint fmt with gci)
make lint # golangci-lint (config: .golangci.yml)
make test # Unit tests with race detection (excludes test/ dir)
make test-integration # Integration tests via testcontainers (needs Docker/Podman)
make build # Build binary → bin/hyperfleet-adaptermake test-all runs make lint, make test, make test-integration, and make test-helm.
Install: make install-hooks
Hooks:
leaktk.git.pre-commit— secret scanning (open-source, no VPN required)hyperfleet-commitlint— validates commit message format (commit-msg stage)hyperfleet-gofmt— Go code formattinghyperfleet-golangci-lint— lintinghyperfleet-go-vet— Go vet checkstrailing-whitespace— removes trailing whitespaceend-of-file-fixer— ensures files end with newlinecheck-added-large-files— prevents large files from being committed
Subcommands: adapter serve, adapter config-dump, adapter version. Config paths via -c/HYPERFLEET_ADAPTER_CONFIG and -t/HYPERFLEET_TASK_CONFIG. All flags have env var equivalents — run adapter serve --help.
Dry-run mode: adapter serve --dry-run-event event.json processes a single event with mock clients, no broker or cluster needed.
Adapter loads two configs merged at startup: deployment config (adapter-config.yaml — infra, clients, logging) and task config (adapter-task-config.yaml — params, preconditions, resources, post-actions). Override rules differ — see Gotchas. Templates in configs/.
| Topic | Location |
|---|---|
| Configuration reference | docs/configuration.md |
| Adapter authoring guide | docs/adapter-authoring-guide.md |
| Metrics & Prometheus queries | docs/metrics.md |
| Alerts | docs/alerts.md |
| Runbook | docs/runbook.md |
| Helm chart | charts/ |
| CI pipelines | .tekton/ (Konflux/Tekton PipelineRuns) |
@docs/conventions/logging.md @docs/conventions/cel.md
pkg/errors provides ServiceError constructors for API-style errors with numeric codes and HTTP status:
errors.NotFound("cluster %s not found", clusterID) // → *ServiceError
errors.KubernetesError("failed to get resource: %v", err)IMPORTANT: These return *ServiceError, not error. Use .AsError() to convert.
- Every CLI flag must have a corresponding env var (Viper convention)
- IMPORTANT: Two config files, different override rules. Deployment config supports env/flag overrides via Viper. Task config is pure YAML — env vars do nothing there. Mixing them up wastes debugging time.
- IMPORTANT: Naming conventions differ by layer. Config YAML:
snake_case(subscription_id). Go code:CamelCase(SubscriptionID). Helm values:camelCase(subscriptionId). Wrong casing silently drops values. - Tracing default mismatch. Binary defaults to tracing ON. Helm chart defaults to OFF. Local
adapter servewill attempt OTLP export unless you setHYPERFLEET_TRACING_ENABLED=false. - Integration tests build a container on first run.
make test-integrationcallsmake image-integration-testifINTEGRATION_ENVTEST_IMAGEis unset. First run takes minutes.
internal/executor/— event execution pipeline (params → preconditions → resources → post-actions)internal/transportclient/— unified apply interface abstracting K8s direct and Maestro ManifestWorkinternal/logctx/— adapter-specific typed context keys and the stack-trace filter for the sharedhyperfleet-loggerhandler (seedocs/conventions/logging.md)