-
Notifications
You must be signed in to change notification settings - Fork 77
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
Bump Go version to 1.22 & controller-gen to 0.14 #1437
Conversation
You need to run |
It seems you might also need to update |
I think the e2e tests are getting a false cache hit (because we haven't actually changed any dependencies) and are still using 1.21 :( |
@@ -113,7 +113,7 @@ help: ## Show this help screen | |||
all: manager ## Build all binaries | |||
|
|||
go-licenses: | |||
@which go-licenses || go install github.com/google/go-licenses@latest | |||
go install github.com/google/go-licenses@latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to always try to install go-licences, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah (the same with controller-gen) but it ensures we're installing the version we want, and as far as I can tell go install
will just exit if it's already installed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to expand; this feels safer, and I had issues when doing this with both controller-gen
and go-licenses
because I had old versions installed and which
doesn't care what version there is, just that it exists.
@@ -239,7 +239,7 @@ vet: $(TIMESTAMPS_DIR)/vet ## Run go vet against code | |||
|
|||
.PHONY: controller-gen | |||
controller-gen: ## Download controller-gen locally if necessary | |||
@which controller-gen || go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.9.2 | |||
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...here as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM in general. Just two questions about the Makefile
targets
@@ -1,6 +1,6 @@ | |||
module github.com/mongodb/mongodb-atlas-kubernetes/v2 | |||
|
|||
go 1.21 | |||
go 1.22.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is important to note, and is discussed at some length in golang/go#62278.
TL;DR - the go
in go.mod
expects a 'full' version (maj.min.patch), and has since 1.21. You can define a maj.min, but then you need to define toolchain
in go.mod
as well. This feels like a breaking change 🤷, but I think we managed to fluke avoiding this issue with 1.21 because there was an actual (development!) release called 1.21.
Going forward we should define the patch version here too (which requires more frequent updates). Note that this doesn't (currently) apply to the Docker bases we use, where there is still a generic 1.22
version that gets bumped to whatever the newest patch version is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I realized this as well in atlas CLI :-/
This will need rebase now before merging, but hopefully it will get simpler after the few fixes in the CI. |
We need to run |
Co-authored-by: josvaz <jose.vazquez@mongodb.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great work, LGTM 👍
All Submissions:
closes #XXXX
in your comment to auto-close the issue that your PR fixes (if there is one).