Skip to content

Resolve host architecture in legacy toolregistry Darwin install scripts#7006

Open
rootp1 wants to merge 1 commit into
pipe-cd:masterfrom
rootp1:fix/toolregistry-arch-darwin-arm64
Open

Resolve host architecture in legacy toolregistry Darwin install scripts#7006
rootp1 wants to merge 1 commit into
pipe-cd:masterfrom
rootp1:fix/toolregistry-arch-darwin-arm64

Conversation

@rootp1

@rootp1 rootp1 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

What this PR does:

Parameterizes the legacy (v0) piped tool registry's Darwin (and Linux) install scripts for kubectl, kustomize, helm, and terraform with the host architecture (runtime.GOARCH) instead of a hardcoded amd64, matching the pattern already used by the pipedv1 tool registries. Adds a focused test asserting the rendered Darwin install scripts reference the host architecture rather than a hardcoded value.

Why we need it:

On darwin/arm64 (Apple Silicon) hosts, the legacy tool registry downloaded darwin/amd64 binaries, which cannot execute natively (fork/exec ...: bad CPU type in executable), breaking local development and any test relying on these tools (e.g. pkg/app/piped/platformprovider/kubernetes).

Which issue(s) this PR fixes:

Fixes #7005

Does this PR introduce a user-facing change?:

  • How are users affected by this change: Developers running piped v0 (legacy) tooling on darwin/arm64 now get architecture-correct kubectl/kustomize/helm/terraform binaries instead of incompatible amd64 ones. No behavior change on amd64 hosts.
  • Is this breaking change: No
  • How to migrate (if breaking change): Not applicable

Verification

  • go build ./... — passed
  • go vet ./pkg/app/piped/toolregistry/... — passed
  • gofmt -l on changed files — passed (no output)
  • go test ./pkg/app/piped/toolregistry/... — passed
  • go test ./pkg/app/piped/platformprovider/kubernetes/... (with tool cache cleared, real downloads) — TestTemplateLocalChart_WithNamespace and TestKustomizeTemplate_WithHelm (helm-based paths) now pass on darwin/arm64, where they previously failed with bad CPU type in executable. TestKustomizeTemplate still fails, but for an unrelated reason: the pinned default kustomize version (3.8.1) never published a darwin_arm64 release artifact upstream (confirmed via direct HTTP HEAD, 404), so no code-level fix can download it. This is a pre-existing upstream artifact gap for that specific pinned version, not a regression from this change.
  • go vet ./... — pre-existing unrelated lock-copy warnings across the repo (not touched by this change); no new warnings introduced by this diff.
  • make check (full target, requires Docker-based golangci-lint, web build, and envtest/Docker-backed integration tests) — not run: Docker and golangci-lint are not available in this environment.
  • ./hack/ensure-dco.sh — reported an unrelated pre-existing failure because it diffs against the fork's stale origin/master (13 commits behind upstream/master); the actual commit on this branch carries a proper Signed-off-by trailer (verified via git log).

Scope

  • Only pkg/app/piped/toolregistry/install.go, pkg/app/piped/toolregistry/tool_darwin.go, and the new pkg/app/piped/toolregistry/tool_darwin_test.go were changed. No unrelated files were modified.

The v0 toolregistry hardcoded darwin/amd64 for kubectl, kustomize, helm,
and terraform downloads, so installed binaries could not run on
darwin/arm64 (Apple Silicon) hosts. Template the host architecture via
runtime.GOARCH, matching the pattern already used by the pipedv1 tool
registries.

Fixes pipe-cd#7005

Signed-off-by: rootp1 <arnav.iitr@gmail.com>
@rootp1
rootp1 requested a review from a team as a code owner July 10, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Legacy v0 tool installer hardcodes amd64 binaries, breaking darwin/arm64 hosts

1 participant