Go library for the HyperFleet desire contract and store backends. A desire is the declarative intent for a single Kubernetes resource on a management cluster (apply, delete, or read). Store backends persist that intent and its status so appliers can reconcile resources without ManifestWork-style bulk transport.
It collaborates with other HyperFleet components:
- API is the source of truth for fleet resource desired state and aggregated status
- Sentinel polls the API and publishes CloudEvents that drive reconciliation
- Adapter listens for those events, applies changes, and reports status back to the API
Prerequisites: Go 1.26+, Make
make build
make test
make lintRun make help for the full list of targets.
The binary follows the same command and configuration conventions as the other HyperFleet services:
make runLocal runs are not in a pod, so the election namespace comes from
POD_NAMESPACE; the Makefile defaults it to hyperfleet. Override it with
make run POD_NAMESPACE=<namespace>.
Override the default configuration path with make run CONFIG=/path/to/applier.yaml. The shared
Kubernetes discovery cache is invalidated using discovery_refresh_interval, allowing newly
installed CRDs to be reconciled without restarting the applier. All three controllers use
poll_interval.
make run uses $KUBECONFIG when set, otherwise $HOME/.kube/config. Override it with
make run KUBE_CONFIG_PATH=/path/to/kubeconfig. Redis must already be reachable at the URL in the
configuration file (or supplied through HYPERFLEET_REDIS_URL).
Configuration precedence follows the HyperFleet convention: command-line flags, then
HYPERFLEET_* environment variables, then YAML, then defaults. Use
bin/hyperfleet-applier config-dump --config configs/applier.yaml to inspect the merged,
redacted configuration.
Leader election is always enabled: only the lease holder runs the apply, delete, and read loops, and standby replicas wait. Namespace resolution, lease timings, failover, and deployment constraints are documented in Replica model and leader election.
| Package | Description |
|---|---|
pkg/desire |
Desire types (ApplyDesire, DeleteDesire, ReadDesire), identity validation, SpecStore / StatusStore interfaces |
pkg/desire/store/memory |
In-memory store for unit tests |
pkg/desire/client |
Partition-bound HTTPS client for the Desire Store v1 gateway |
pkg/desire/store/redis |
Redis-backed store with WATCH/MULTI/EXEC CAS |
pkg/desire/store/conformance |
Shared conformance suite exercised by both backends |
go get github.com/openshift-hyperfleet/hyperfleet-applierConstruct client.New(client.Config{GatewayURL: origin, Partition: partition, TokenFile: tokenPath, CABundleFile: caPath})
with the registered partition's HTTPS origin, management-cluster projected service-account token, and dedicated gateway
CA bundle. Call Close on shutdown. The client reads the token on every HTTP attempt. Roll the process after a CA
bundle update so the replacement transport loads the new roots. Certificate and reachability failures are available
through errors.Is(err, client.ErrCertificate) and errors.Is(err, client.ErrUnreachable).
Each GET accepts up to 8 MiB of decompressed JSON by default. Set Config.MaxResponseBytes to size this local
limit for your records and list pages. A page that exceeds the limit leaves the previous complete view in place.
Call SyncPartition under the leader context before starting reconciliation. Each pass calls ListReferences afresh
for each type. A failed list returns an error and preserves LastComplete. Use Read references' target versions for
watch selection. GET the current Apply or Delete record immediately before acting. Send the resulting status with that
record's version and stamp conditions with its generation. Read status is unversioned. A lost PUT response triggers a
readback. A matching status confirms success. If the status differs, observe the current record again before writing because
the v1 contract can reuse the same version after recreation.
The service process currently selects Redis. HYPERFLEET-1839 integrates reference lists into the controllers. A conformance harness running against the service directly supplies its test Wristband through its own gateway fixture and may read back a successful status PUT to obtain the updated record.
Import github.com/openshift-hyperfleet/hyperfleet-applier/pkg/desire/client directly from the Applier Go module.
In this repository, make test also generates models from the pinned Desire Store OpenAPI spec and tests the
client against those models.
| Resource | Description |
|---|---|
make help |
Build, test, lint, format, and verify targets |
pkg/desire package docs |
Desire model, identity rules, and store contracts |
| Resource | Description |
|---|---|
| HyperFleet Architecture | System design |
| HyperFleet API Spec | API contract |
| Broker Library | Messaging abstraction |
| Infrastructure | Deployment automation |
Credentials are stored scoped to the applier's own partition by convention. Cryptographic enforcement of that scoping arrives with the production backends.
FIPS mode is enabled only in the container image build. Local make build,
make test, and make test-envtest do not enable FIPS by default. The Dockerfile
selects GOFIPS140=v1.0.0 and builds with -tags=fips,no_openssl. cmd/fips.go
enables FIPS and rejects runtime attempts to disable it; no_openssl selects
Go's native crypto backend on Red Hat Go. The image build checks the selected
module, compiled FIPS default, and startup with GOLANG_FIPS=1. Do not disable
TLS 1.2 EMS enforcement with fips140ems=0 in the environment, module/workspace
defaults, or main-package directives. The build check rejects compiled overrides
only. Neither that check nor the runtime FIPS-mode guard detects a deployment-time
GODEBUG=fips140ems=0 override; deployment configuration must be reviewed
separately. See Go's FIPS documentation
and HYPERFLEET-1940.
The applier's ClusterRole uses an explicit GVR allowlist. See Deriving the RBAC allowlist in the chart README for how to compute and configure it.
- Verify you're a member of the
openshift-hyperfleetorganization - Confirm you're added to the hyperfleet team
- Code reviews and approvals are managed through the OWNERS file
For access issues, contact a repository administrator or organization owner.
This project is licensed under the Apache License 2.0. See LICENSE for details.