Detect host architecture for GOARCH in build script#165
Conversation
|
Skipping CI for Draft Pull Request. |
1ba05fb to
de13bc3
Compare
|
Warning Rate limit exceeded
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 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. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
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>
de13bc3 to
18fc75b
Compare
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
Why we need this PR
hack/build.shhardcodesGOARCH=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
go env GOARCHamd64if the value is empty (safeguard)go env GOARCHreturnsamd64, 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
go env GOARCHreturns the correct architecture on all supported platforms