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

fix(test): pin version not latest which just introduced to use go 1.22 #934

Merged
merged 3 commits into from
Mar 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ GOLANGCI_LINT_VERSION ?= v1.54.0
YQ_VERSION ?= v4.12.2
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.24.2
ENVTEST_PACKAGE_VERSION = v0.0.0-20240320141353-395cfc7486e6
CRD_REF_DOCS_VERSION = 0.0.11

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
Expand Down Expand Up @@ -350,7 +351,7 @@ TEST_SRC=./controllers/... ./tests/integration/... ./pkg/...
.PHONY: envtest
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
$(ENVTEST): $(LOCALBIN)
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
test -s $(ENVTEST) || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@$(ENVTEST_PACKAGE_VERSION)
Copy link
Contributor

@ykaliuta ykaliuta Mar 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proposal is correct (except the test is redundant, we discussed it in another PR already, the dependency itself checks the existence:

sh-5.2$ git diff
diff --git a/Makefile b/Makefile
index ceb8880c1844..1cde16c3a294 100644
--- a/Makefile
+++ b/Makefile
@@ -351,7 +351,7 @@ TEST_SRC=./controllers/... ./tests/integration/... ./pkg/...
 .PHONY: envtest
 envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
 $(ENVTEST): $(LOCALBIN)
-       test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@$(ENVTEST_PACKAGE_VERSION)
+       GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@$(ENVTEST_PACKAGE_VERSION)
 
 .PHONY: test
 test: unit-test e2e-test
sh-5.2$ make envtest
GOBIN=/home/ykaliuta/work/RHODS/opendatahub-operator/bin go install sigs.k8s.io/controller-runtime/tools/setup-envtest@v0.0.0-20240320141353-395cfc7486e6
sh-5.2$ make envtest
make: Nothing to be done for 'envtest'.

but unrelated to the PR (deserves some clean up one)
Just 2c, not blocking :)

BTW, I can understand why it was done: since it depends on the directory without | it makes the dependency unsatisfied any time something is updated inside $(LOCALBIN). But @bartoszmajsak promised to fix it ;)


.PHONY: test
test: unit-test e2e-test
Expand Down
Loading