From 1cd7c3b34793d0b7310aa007d14a953e4e6902aa Mon Sep 17 00:00:00 2001 From: Siu Wa Wu Date: Tue, 31 Mar 2026 13:50:02 +1000 Subject: [PATCH 1/2] fix: remove duplicated error message for cloud console --- cmd/ocm-backplane/cloud/common.go | 10 +--------- cmd/ocm-backplane/cloud/common_test.go | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/cmd/ocm-backplane/cloud/common.go b/cmd/ocm-backplane/cloud/common.go index 803d5dfb..b4e3d7e9 100644 --- a/cmd/ocm-backplane/cloud/common.go +++ b/cmd/ocm-backplane/cloud/common.go @@ -333,15 +333,7 @@ func (cfg *QueryConfig) getIsolatedCredentials(ocmToken string) (aws.Credentials if readErr == nil { bodyStr = strings.TrimSpace(string(bodyBytes)) } - // Restore the body for TryPrintAPIError to parse it - if readErr == nil { - response.Body = io.NopCloser(strings.NewReader(bodyStr)) - } - apiErr := utils.TryPrintAPIError(response, false) - if apiErr != nil { - return aws.Credentials{}, fmt.Errorf("failed to fetch arn sequence: %w (response body: %s)", apiErr, bodyStr) - } - return aws.Credentials{}, fmt.Errorf("failed to fetch arn sequence: status %s (response body: %s)", response.Status, bodyStr) + return aws.Credentials{}, fmt.Errorf("failed to fetch arn sequence:\nStatus: %s\nResponse body: %s", response.Status, bodyStr) } bytes, err := io.ReadAll(response.Body) diff --git a/cmd/ocm-backplane/cloud/common_test.go b/cmd/ocm-backplane/cloud/common_test.go index 570c543c..0ea13e10 100644 --- a/cmd/ocm-backplane/cloud/common_test.go +++ b/cmd/ocm-backplane/cloud/common_test.go @@ -283,7 +283,7 @@ var _ = Describe("getIsolatedCredentials", func() { Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("failed to fetch arn sequence:")) // Verify the response body is included in the error message - Expect(err.Error()).To(ContainSubstring("response body:")) + Expect(err.Error()).To(ContainSubstring("Response body:")) Expect(err.Error()).To(ContainSubstring("Internal server error")) }) It("should fail if error creating backplane api client", func() { From 998c825fc6508ec0415e712cfefb6a4f4b0ff7be Mon Sep 17 00:00:00 2001 From: Siu Wa Wu Date: Fri, 24 Apr 2026 16:42:40 +1000 Subject: [PATCH 2/2] add a doc for macOS setup --- docs/macOS.md | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 docs/macOS.md diff --git a/docs/macOS.md b/docs/macOS.md new file mode 100644 index 00000000..b8e4cc46 --- /dev/null +++ b/docs/macOS.md @@ -0,0 +1,53 @@ +# Running backplane-cli on macOS Apple Silicon + +The `ocm backplane console` command runs the console container locally using the same container image as the logged-in cluster, which is typically built for Linux/amd64. For better compatibility and performance on macOS with Apple Silicon (M1/M2/M3), you should configure Podman to use `Rosetta` instead of `QEMU` for x86_64 emulation. + +## Steps to Configure Podman with Rosetta + +### 1. Update Podman + +Ensure you have the latest version of Podman installed: + +```bash +brew upgrade podman +``` + +Alternatively, download the latest installer from [podman.io](https://podman.io/). + +### 2. Configure Rosetta Support + +Edit `~/.config/containers/containers.conf` to specify the provider and enable Rosetta: + +```ini +[machine] +provider = "applehv" +rosetta = true +``` + +### 3. Recreate the Podman Machine + +Remove the existing VM and create a new one. **Warning:** This will erase all existing container images and data. + +```bash +podman machine reset +podman machine init +podman machine start +``` + +### 4. Verify Rosetta is Enabled + +Check that Rosetta is properly configured: + +```bash +# Verify Rosetta is enabled in machine configuration +podman machine inspect --format '{{.Rosetta}}' +# Expected output: true + +# Enable Rosetta activation +podman machine ssh "sudo touch /etc/containers/enable-rosetta" +podman machine ssh "sudo systemctl restart rosetta-activation.service" + +# Verify Rosetta is available in binfmt +podman machine ssh "ls /proc/sys/fs/binfmt_misc/" +# Expected output should include 'rosetta' in the list +```