Commit ef5af15
Extend arch-check to controller-gen/kustomize/golangci-lint too
Cherry-pick of the same extension from oadp-dev. The version-marker
check alone isn't enough: a binary can have a correct .version marker
but still be the wrong architecture, e.g. if a containerized build
with a different GOARCH bind-mounts the host's bin/ directory (this
Makefile documents exactly that workflow for `make test`: `docker run
--platform linux/amd64 -v $PWD:$PWD ...`). Anything that does
`go install` in there writes onto the host's real bin/ tree since
it's the same mounted path, not a copy. Not envtest-specific — it can
happen to any of these four cached tool binaries.
go-install-tool-versioned now also probes `$(1) --version` and checks
specifically for exit code 126 (POSIX "found but cannot execute" /
exec format error), same technique as the envtest fix already on this
branch. Verified controller-gen and kustomize (this branch's v4.5.5
pin) correctly detect and repair a wrong-arch binary even when its
.version marker already matches the pinned version: cross-compiled a
real linux/amd64 binary, copied it over the working native binary,
confirmed each was detected and replaced. golangci-lint shares the
identical code path but couldn't be exercised directly on this branch
(its v1.54.2 pin fails to build against this sandbox's Go 1.26
toolchain, a pre-existing environment issue unrelated to this change).
Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>1 parent af5468b commit ef5af15
1 file changed
Lines changed: 16 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
712 | 712 | | |
713 | 713 | | |
714 | 714 | | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
720 | 724 | | |
721 | | - | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
722 | 731 | | |
723 | 732 | | |
| 733 | + | |
724 | 734 | | |
725 | 735 | | |
726 | 736 | | |
| |||
0 commit comments