Resolve host architecture in legacy toolregistry Darwin install scripts#7006
Open
rootp1 wants to merge 1 commit into
Open
Resolve host architecture in legacy toolregistry Darwin install scripts#7006rootp1 wants to merge 1 commit into
rootp1 wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does:
Parameterizes the legacy (v0) piped tool registry's Darwin (and Linux) install scripts for
kubectl,kustomize,helm, andterraformwith the host architecture (runtime.GOARCH) instead of a hardcodedamd64, matching the pattern already used by thepipedv1tool 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 downloadeddarwin/amd64binaries, 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?:
pipedv0 (legacy) tooling ondarwin/arm64now get architecture-correctkubectl/kustomize/helm/terraformbinaries instead of incompatibleamd64ones. No behavior change onamd64hosts.Verification
go build ./...— passedgo vet ./pkg/app/piped/toolregistry/...— passedgofmt -lon changed files — passed (no output)go test ./pkg/app/piped/toolregistry/...— passedgo test ./pkg/app/piped/platformprovider/kubernetes/...(with tool cache cleared, real downloads) —TestTemplateLocalChart_WithNamespaceandTestKustomizeTemplate_WithHelm(helm-based paths) now pass ondarwin/arm64, where they previously failed withbad CPU type in executable.TestKustomizeTemplatestill fails, but for an unrelated reason: the pinned defaultkustomizeversion (3.8.1) never published adarwin_arm64release 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-basedgolangci-lint, web build, and envtest/Docker-backed integration tests) — not run: Docker andgolangci-lintare not available in this environment../hack/ensure-dco.sh— reported an unrelated pre-existing failure because it diffs against the fork's staleorigin/master(13 commits behindupstream/master); the actual commit on this branch carries a properSigned-off-bytrailer (verified viagit log).Scope
pkg/app/piped/toolregistry/install.go,pkg/app/piped/toolregistry/tool_darwin.go, and the newpkg/app/piped/toolregistry/tool_darwin_test.gowere changed. No unrelated files were modified.