Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] setup-envtest unable to find version for linux #2838

Closed
sk593 opened this issue May 22, 2024 · 8 comments
Closed

[bug] setup-envtest unable to find version for linux #2838

sk593 opened this issue May 22, 2024 · 8 comments

Comments

@sk593
Copy link

sk593 commented May 22, 2024

Running into this error when installing the setup-envtest tools on a linux-amd64 system

/bin/sh: 1: /home/runner/go/bin/setup-envtest: not found
=> Installing Kubebuilder test tools...
go: downloading sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240522175850-2e9781e9fc60
go: downloading github.com/spf13/afero v1.6.0
go: downloading go.uber.org/zap v1.26.0
go: downloading sigs.k8s.io/yaml v1.3.0
go: downloading golang.org/x/text v0.14.0
go: downloading go.uber.org/multierr v1.10.0
=> Instructions:
=> Set environment variable KUBEBUILDER_ASSETS for tests.
=> KUBEBUILDER_ASSETS=""
unable to find a version that was supported for platform linux/amd64
KUBEBUILDER_ASSETS="" CGO_ENABLED=1 gotestsum --junitfile ./dist/unit_test/results.xml -- -v ./pkg/... -race -coverprofile ./dist/unit_test/ut_coverage.out

This is happening in a makefile where the controller-runtime package gets downloaded and used: https://github.com/radius-project/radius/blob/66aad2c07b0793a1c59088b4868a83596ca3e448/build/test.mk#L51

This seems to be isolated to linux-amd64 and it's not happening for other architectures

@sbueringer
Copy link
Member

Can you share the exact setup-envtest command your running?

@sbueringer
Copy link
Member

Context: we merged this PR yesterday: #2811 (comment)

But all envtest binaries in controller tools are available for the same OS/ARCH permutations.

@sk593
Copy link
Author

sk593 commented May 23, 2024

Sure, we're running into issues with the makefile. This code in test.mk where we try to download the setup-envtest package is causing the error: https://github.com/radius-project/radius/blob/66aad2c07b0793a1c59088b4868a83596ca3e448/build/test.mk#L50. Because the setup-envtest package doesnt get installed correctly, the tests that use the package fail.

This is how we use the setup-envtest package in our code: https://github.com/radius-project/radius/blob/main/test/ucp/kubeenv/testenv.go. And this is the test it gets used in: https://github.com/radius-project/radius/blob/4cacb5872861e0fcce74a9109f0cdecd361d80ed/pkg/ucp/queue/apiserver/client_test.go#L100

This started happening after #2811 was merged and only for linux which is interesting. Previous versions of the package are working as expected and I tested on a darwin machine that downloaded the binary completely fine.

Daniel-Fan added a commit to Daniel-Fan/operand-deployment-lifecycle-manager that referenced this issue May 23, 2024
ibm-ci-bot pushed a commit to IBM/operand-deployment-lifecycle-manager that referenced this issue May 23, 2024
* Bump ODLM to 4.3.2 for 4.6.3

Signed-off-by: Daniel Fan <fanyuchensx@gmail.com>

* Rollback package setup-envtest due to issue kubernetes-sigs/controller-runtime#2838

Signed-off-by: Daniel Fan <fanyuchensx@gmail.com>

---------

Signed-off-by: Daniel Fan <fanyuchensx@gmail.com>
@sbueringer
Copy link
Member

sbueringer commented May 23, 2024

@sk593 will be fixed by: kubernetes-sigs/controller-tools#979

Basically setup-envtest@latest now gets the binaries from controller-tools releases instead of GCS. We only published v1.23+.

Might be worth considering using a newer Kubernetes version than 1.23 for your tests. I have absolutely no idea why this woul only happen on linux, we published the same versions for all OS/architecture combinations.

@sbueringer
Copy link
Member

sbueringer commented May 23, 2024

@sk593 Should be done. Can you try again?

(xref: https://github.com/kubernetes-sigs/controller-tools/releases/tag/envtest-v1.23.5)

@sk593
Copy link
Author

sk593 commented May 23, 2024

@sk593 Should be done. Can you try again?

(xref: https://github.com/kubernetes-sigs/controller-tools/releases/tag/envtest-v1.23.5)

Just confirmed that the fix works. We'll look into using a newer Kubernetes version to avoid similar issues in the future. Thanks for the quick turnaround!

@sbueringer
Copy link
Member

No problem. We basically just created envtest binaries for relatively recent versions at the new location (controller-tools). We stopped at 1.24 :)

/close

@k8s-ci-robot
Copy link
Contributor

@sbueringer: Closing this issue.

In response to this:

No problem. We basically just created envtest binaries for relatively recent versions at the new location (controller-tools). We stopped at 1.24 :)

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

sk593 added a commit to radius-project/radius that referenced this issue May 28, 2024
Reverts #7629

This was fixed as per the convo in
kubernetes-sigs/controller-runtime#2838. It
looks like the binaries weren't released for the version of Kubernetes
that we were using (they had up until 1.24 but we were using 1.23)

Fixes: #7630

---------

Signed-off-by: sk593 <shruthikumar@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants