feat: multi-arch operator, bundle, and catalog image builds - #3055
Conversation
|
/agentic_review |
Code Review by Qodo
Context used✅ Compliance rules (platform):
18 rules✅ Cross-repo context Explored:
repo: redhat-developer/rhdh (sha: 5992bddd) Not relevant to this PR:
redhat-developer/rhdh-plugins 1.
|
367d356 to
38ac280
Compare
09fe0c7 to
256a876
Compare
|
/review |
PR Reviewer Guide 🔍(Review updated until commit 9a96327)Warning
Here are some key observations to aid the review process:
|
Fortune-Ndlovu
left a comment
There was a problem hiding this comment.
thanks for pushing this PR the design is sound and well-documented, I've added a few nitpicks. PTAL thanks
b111709 to
2bb081f
Compare
Fortune-Ndlovu
left a comment
There was a problem hiding this comment.
The new workflow_dispatch trigger (line 11) will be silently skipped when the latest commit didn't change relevant files, because tj-actions/changed-files still gates everything. Manual triggers typically mean 'build regardless.' Add || github.event_name == 'workflow_dispatch' to the if: on this line, line135, and line 267 (with parentheses on 267 to preserve the && precedence).
|
/agentic_review |
Code Review by Qodo
Context used✅ Compliance rules (platform):
18 rules✅ Cross-repo context Explored:
repo: redhat-developer/rhdh (sha: 5992bddd) Not relevant to this PR:
redhat-developer/rhdh-plugins 1. Bundle pull may break arm
|
a61c9dc to
9a96327
Compare
|
/review |
|
Persistent review updated to latest commit 9a96327 |
Replace the single-runner amd64-only build with a matrix strategy that builds on both ubuntu-24.04 (amd64) and ubuntu-24.04-arm (arm64), then merges per-arch images into multi-arch manifest lists. This follows the same proven pattern used by the hub repo's next-build-image.yaml workflow. The operator Dockerfile already supports TARGETOS/TARGETARCH and bundle images use FROM scratch, so no other changes are needed. All three images (operator, operator-bundle, operator-catalog) are now built and published as multi-arch manifest lists. Assisted-by: Claude Code
GitHub Actions doesn't allow direct secrets references in step `if` conditions. Use an env var intermediary instead. Assisted-by: Claude Code
The --annotation flag is not supported by docker buildx imagetools create on the ubuntu-latest runner. Expiry labels are already set during the per-arch image build via the Makefile LABEL variable. Assisted-by: Claude Code
- Use ${{ github.ref_name }} instead of detached-HEAD-unsafe git command
for branch detection; avoids mistagging images (next vs latest)
- Add strict shell mode (set -euo pipefail) and env var validation
across all run: blocks; quote all variable expansions
- Fix SHA-scoped manifest list to use ${BASE_VERSION}-${SHORT_SHA}-{amd64,arm64}
instead of ${BASE_VERSION}-{amd64,arm64} (was using wrong image content)
- Add separate `changes` job to gate both `build` and `merge` on
any_changed output; prevents merge from running when no files changed
- Remove unquoted redirections and improve shell robustness
All 4 Qodo findings resolved.
Assisted-by: Claude Code
Add if: needs.changes.outputs.any_changed == 'true' to individual steps in build job (Prepare, Setup Go, Login, Build, Upload marker) to explicitly skip when no relevant changes detected. This makes the gating more granular and avoids unnecessary compute. Add clarifying comment above Prepare step. Assisted-by: Claude Code
GitHub Actions doesn't support bash-style default syntax (:-). Use || 'operator' instead for fallback values. Assisted-by: Claude Code
- Move QUAY_OAUTH_TOKEN from inline ${{ secrets }} expansion in the
curl command to the step's env: block, resolving SonarCloud warning
about secrets expanded directly in run steps
- Add always() && needs.build.result == 'success' to merge job's if
condition so it won't attempt manifest creation when build failed
Assisted-by: Claude Code
operator-bundle is FROM scratch (pure YAML manifests/metadata, no compiled binaries), so its content is identical regardless of build architecture. The build matrix was rebuilding and pushing it on both the amd64 and arm64 legs to the same shared tag, which catalog-build's opm index add then pulled back non-deterministically (opm always pulls the bundle from the registry, never the local image). Build and push the bundle exactly once in a new, non-matrixed job. Both matrix legs' catalog-build now read that already-published, stable tag instead of racing to write it -- via `make -o bundle-push`, which skips catalog-build's phony bundle-push prerequisite. Verified locally end-to-end: real bundle build (FROM scratch, no RUN steps), real opm index add against a local registry, real arm64 catalog build. Assisted-by: Claude Code
Centralize image metadata in the changes job, drop unused skopeo and build markers, remove redundant per-step if guards, pass image name via env blocks, and log Quay cleanup HTTP status codes. Co-authored-by: Cursor <cursoragent@cursor.com>
Manual runs should always build even when changed-files reports no matching paths, matching Fortune's review suggestions. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Fortune Ndlovu <ndlovufortune97@gmail.com>
Remove unused PLATFORM_PAIR, move github.ref_name into an env block to avoid Actions expression injection in run scripts, and warn on unexpected Quay tag-deletion HTTP status codes. Co-authored-by: Cursor <cursoragent@cursor.com>
aa2f840 to
90c5644
Compare
|
|
Addressed the outstanding review comments and rebased onto
@Fortune-Ndlovu PTAL — ready for re-review. Thanks! |
Fortune-Ndlovu
left a comment
There was a problem hiding this comment.
LGTM - Tested and tests pass https://github.com/Fortune-Ndlovu/rhdh-operator/actions/runs/30461765143
|
/lgtm |
27f8511
into
redhat-developer:main



Summary
ubuntu-24.04(amd64) andubuntu-24.04-arm(arm64)mergejob that creates multi-arch manifest lists usingdocker buildx imagetools createWhat changes
File:
.github/workflows/next-container-build.yamlThe single
next-buildjob is replaced with two jobs:build— matrix over[ubuntu-24.04, ubuntu-24.04-arm], each runner builds all 3 images for its native architecture using existing Makefile targets (image-build,bundle-build,catalog-buildwithPLATFORMoverride), then pushes with per-arch tag suffixes (e.g.,operator:next-amd64)merge— downloads build markers, creates multi-arch manifest lists viadocker buildx imagetools create, tags final images (e.g.,operator:next), and optionally cleans up per-arch tags via Quay APIWhy
The community hub image (
quay.io/rhdh-community/rhdh) already ships as a multi-arch manifest list (amd64 + arm64). The operator stack is the remaining gap blocking ARM64 RHDH deployments via the operator.No Makefile or Dockerfile changes are needed — the operator Dockerfile already uses
TARGETOS/TARGETARCHbuild args and bundle images useFROM scratch.Pattern
Follows the same proven multi-arch build pattern from the hub repo's
next-build-image.yamlworkflow (matrix runners → per-arch push → manifest merge).Test plan
docker buildx imagetools inspect quay.io/rhdh-community/operator:nextshows both architecturespodman pull --platform linux/arm64 quay.io/rhdh-community/operator:nextsucceeds🤖 Generated with Claude Code
Related