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

Use toolchain to define desired Go version #6378

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

HeavyWombat
Copy link
Contributor

@HeavyWombat HeavyWombat commented Nov 29, 2024

Follow-up from: #6305 (comment)

Ref: https://go.dev/doc/modules/gomod-ref#go

Use toolchain to define the desired Go compiler version to be used.

Use go directive to show the minimum version it can still compile with.

Checklist

Relates to #6305

@HeavyWombat HeavyWombat requested a review from a team as a code owner November 29, 2024 13:51
@HeavyWombat
Copy link
Contributor Author

HeavyWombat commented Nov 29, 2024

I ran go mod tidy and go mod vendor, which led to changes in the vendor that surprised me to be honest.

@JorTurFer
Copy link
Member

JorTurFer commented Dec 2, 2024

/run-e2e internal
Update: You can check the progress here

@JorTurFer
Copy link
Member

I see the benefits of not limiting the minimum version but only suggesting it in case of 3rd parties using KEDA as dependency, but we also must ensure that the user version to build and ship KEDA is the desired one and (AFAIK), toolchain is more a suggestion than a requirement (not like the go directive which is mandatory).

Our current approach is based on generating updated build tools image so the toolchain available should be the same or above than the one in the go.mod. This point leads me to another question, how we can maintain the minimum version of the go directive? If we update a dependency that increases the minimum go version (like k8s deps), will the go directive updated automatically?

@wozniakjan
Copy link
Member

wozniakjan commented Dec 2, 2024

If we update a dependency that increases the minimum go version (like k8s deps), will the go directive updated automatically?

I think so, both go and toolchain directives are updated with go get -u. As far as I can tell, go is updated based on the dependencies and toolchain is updated based on the available toolchain on the machine.

I ran go mod tidy and go mod vendor, which led to changes in the vendor that surprised me to be honest.

it's possible those are not related to the toolchain directive addition, the vendor is maintained best effort in a semi-automated fashion iirc

Copy link
Member

@wozniakjan wozniakjan left a comment

Choose a reason for hiding this comment

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

lgtm

should we add a changelog entry? I think it's not necessary.

Follow-up from: kedacore#6305 (comment)

Ref: https://go.dev/doc/modules/gomod-ref#go

Use toolchain to define the desired Go compiler version to be used.

Use `go` directive to show the minimum version it can still compile
with.

Signed-off-by: Matthias Diester <[email protected]>
@JorTurFer
Copy link
Member

JorTurFer commented Dec 2, 2024

/run-e2e internal
Update: You can check the progress here

@JorTurFer JorTurFer enabled auto-merge (squash) December 2, 2024 13:47
@JorTurFer JorTurFer merged commit faf42ef into kedacore:main Dec 2, 2024
19 checks passed
@HeavyWombat HeavyWombat deleted the change/go-mod-go-version branch December 2, 2024 14:56
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

Successfully merging this pull request may close these issues.

3 participants