Conversation
There was a problem hiding this comment.
Pull request overview
Adds CPU architecture detection to remote OS release resolution, storing the raw architecture string on os.Release and exposing a new Arch() helper to normalize that value to a GOARCH string for downstream use.
Changes:
- Capture raw architecture during OS resolution (
uname -mon Linux/Darwin;$env:PROCESSOR_ARCHITECTUREon Windows). - Add
(*Release).Arch()plus sentinel errors for “not detected” and “unrecognized” architecture values. - Extend Linux resolver test coverage to validate
Arch()normalization forx86_64 -> amd64.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| os/release.go | Adds arch normalization, Arch() API, sentinel errors; also changes String() receiver. |
| os/linux.go | Executes uname -m and stores result in Release.arch. |
| os/darwin.go | Executes uname -m and stores result in Release.arch. |
| os/windows.go | Reads $env:PROCESSOR_ARCHITECTURE and stores result in Release.arch. |
| os/linux_test.go | Mocks uname -m and asserts Arch() returns amd64. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Each OS resolver now runs uname -m (Linux/Darwin) or $env:PROCESSOR_ARCHITECTURE (Windows) alongside existing OS detection commands and stores the raw value in Release.arch. Arch() normalizes it to a GOARCH string (amd64, arm64, arm, 386), returning sentinel errors ErrArchNotDetected or ErrUnrecognizedArch on failure. Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Each OS resolver now runs
uname -m(Linux/Darwin) or$env:PROCESSOR_ARCHITECTURE(Windows) alongside existing OS detection commands and stores the raw value inRelease.arch.Arch()normalizes it to aGOARCHstring (amd64, arm64, arm, 386), returning sentinel errorsErrArchNotDetectedorErrUnrecognizedArchon failure.