Skip to content

Detect host architecture for GOARCH in build script#165

Merged
openshift-merge-bot[bot] merged 1 commit into
mainfrom
multiarch/detect-goarch
May 17, 2026
Merged

Detect host architecture for GOARCH in build script#165
openshift-merge-bot[bot] merged 1 commit into
mainfrom
multiarch/detect-goarch

Conversation

@razo7

@razo7 razo7 commented Apr 15, 2026

Copy link
Copy Markdown
Member

Why we need this PR

hack/build.sh hardcodes GOARCH=amd64, which prevents building the operator binary on non-x86_64 hosts (e.g. arm64, s390x, ppc64le). Anyone building on those platforms must manually override GOARCH.

Changes made

  • Detect host architecture at build time using go env GOARCH
  • Fall back to amd64 if the value is empty (safeguard)
  • No behavior change on x86_64 hosts (go env GOARCH returns amd64, same as before)

Which issue(s) this PR fixes

Related to RHWA-514. Enables the Go binary build to work on non-amd64 hosts.

Test plan

  • Existing CI runs on amd64 and produces identical behavior (no regression)
  • go env GOARCH returns the correct architecture on all supported platforms

@openshift-ci

openshift-ci Bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@razo7 razo7 force-pushed the multiarch/detect-goarch branch from 1ba05fb to de13bc3 Compare April 15, 2026 12:57
@coderabbitai

coderabbitai Bot commented Apr 15, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@razo7 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 41 minutes and 31 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3e7ddb44-14d9-4069-b771-67e9b21e46bb

📥 Commits

Reviewing files that changed from the base of the PR and between 22656e5 and 18fc75b.

📒 Files selected for processing (1)
  • hack/build.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch multiarch/detect-goarch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@razo7 razo7 changed the title Add multi-architecture build support Detect host architecture for GOARCH in build script Apr 16, 2026
Use go env GOARCH to detect the target architecture at build time
instead of hardcoding amd64. Falls back to amd64 if unset.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@razo7 razo7 force-pushed the multiarch/detect-goarch branch from de13bc3 to 18fc75b Compare May 17, 2026 12:05
@openshift-ci

openshift-ci Bot commented May 17, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mshitrit, razo7

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@razo7 razo7 marked this pull request as ready for review May 17, 2026 12:23
@openshift-ci openshift-ci Bot requested review from beekhof and mshitrit May 17, 2026 12:23
@razo7

razo7 commented May 17, 2026

Copy link
Copy Markdown
Member Author

/retest

@openshift-merge-bot openshift-merge-bot Bot merged commit 3a54cd1 into main May 17, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants