Azure Red Hat OpenShift RP — ARM resource provider for OpenShift clusters on Azure. A single aro binary is produced with both RP-side services and the in-cluster ARO Operator, with the service selected in the command line (e.g. aro rp, aro portal, aro operator master)
All Golang code in this repository is written for Go 1.26+.
Cluster mutations (PUT/DELETE) are async: Frontend writes to CosmosDB with non-terminal state → Backend polls and processes → updates with terminal state. Never bypass this: public API frontend handlers must NOT perform cluster operations directly.
| Module | Path | go.mod |
|---|---|---|
| Root | github.com/Azure/ARO-RP |
go.mod |
| API | github.com/Azure/ARO-RP/pkg/api |
pkg/api/go.mod |
Root imports API via replace directive. ./... from root excludes pkg/api/ tests.
Read
docs/agent-guides/build.mdwhen changing build, test, or formatting targets.
make fmt # Format BOTH modules (golangci-lint, NOT gofmt)
make unit-test-go # Unit tests
make lint-go # Lint
make generate # Code generation (go generate, swagger)
make go-tidy # go mod tidy for BOTH modules
go test -v ./pkg/frontend/... -run TestSpecificFunction # Single testSTOP — read before touching these areas:
| Trigger | Required reading |
|---|---|
Modifying pkg/api/v* types |
docs/agent-guides/api-type-system.md |
| Adding/changing VM sizes | docs/agent-guides/azure-product-constraints.md |
| Changing Makefile, CI, or build targets | docs/agent-guides/build.md |
client-generate is destructive — it deletes all generated SDK clients before regenerating. If Docker/autorest fails mid-run, restore with git checkout -- pkg/client/ python/client/.
| Runtime context | Packages |
|---|---|
| RP control plane (Azure VMSS) | pkg/frontend, pkg/backend, pkg/cluster, pkg/monitor, pkg/gateway, pkg/portal |
| Customer OpenShift cluster | pkg/operator/controllers |
| CI/dev only (NOT production) | pkg/util/cluster, hack/cluster, test/e2e |
| RP infra deployment | pkg/deploy |
Admin API endpoints decouple HTTP parsing from business logic. The main handler extracts parameters and calls an underscore-prefixed function with raw values:
func (f *frontend) postAdminFoo(w http.ResponseWriter, r *http.Request) {
// HTTP layer: extract params, get logger
err := f._postAdminFoo(log, ctx, r)
adminReply(log, w, nil, nil, err)
}
func (f *frontend) _postAdminFoo(log *logrus.Entry, ctx context.Context, r *http.Request) error {
// Business logic: testable without HTTP mocking
}This allows business logic to be invoked by other Go packages without HTTP mocking. When adding admin APIs, follow this pattern and register routes in pkg/frontend/frontend.go.
- Imports:
gciis used to order Golang imports. See.golangci.yml. - Formatting:
make fmt(notgofmt). Pre-commit hook runsmake fmt. - Pointer creation: Use Go 1.26's
new(), notautorest/toork8s.io/utils/ptr. - Error handling: Wrap with
fmt.Errorf("...: %w", err). Useerrors.Is/errors.As. - No files directly in
pkg/util/— must use subpackages.
Before considering any change complete:
make fmtpassesmake unit-test-gopasses- No new lint violations:
make lint-go