This directory contains the oapi-codegen configuration and the extracted OpenAPI specification for the HyperFleet API, sourced from the hyperfleet-api-spec Go module.
The openapi.yaml file is copied during make generate from the hyperfleet-api-spec
Go module cache (located via go list -m). The module version is pinned in go.mod:
github.com/openshift-hyperfleet/hyperfleet-api-spec v1.0.12
Important: The openapi.yaml file is NOT committed to git. It is copied fresh on
every make generate from the module cache.
To generate the Go client from the pinned spec:
make generateThis will:
- Copy
$(VARIANT)/openapi.yamlfrom thehyperfleet-api-specmodule cache (located viago list -m) - Generate Go client code in
pkg/api/openapi/
Important: Generated files in pkg/api/openapi/ are also NOT committed to git. They
must be regenerated locally during development.
Sentinel is a client of hyperfleet-api, so both services must use the compatible hyperfleet-api-spec
version. Before upgrading, check which version hyperfleet-api currently pins.
Once you have the target version:
go get github.com/openshift-hyperfleet/hyperfleet-api-spec@vX.Y.Z
go mod tidy
make generateThen update internal/client/client.go if needed to support new endpoints or models, and run
make test to verify compatibility.
- Tool: OAPI Codegen
- Language: Go
- Output:
pkg/api/openapi/(not committed to git) - Schema extraction:
go list -m -f '{{.Dir}}'locates the module cache directory;$(VARIANT)/openapi.yamlis copied toopenapi/openapi.yamlfor oapi-codegen input - Wrapper:
internal/client/client.goprovides a simplified interface to the generated client