Skip to content

Conversation

oliver-goetz
Copy link
Member

How to categorize this PR?

/area dev-productivity
/kind enhancement

What this PR does / why we need it:
There were several cases where tests in pipelines failed because not every test images had the most recent patch level of golang.

go: go.mod requires go >= 1.22.2 (running go 1.22.0; GOTOOLCHAIN=local)

In these cases logs similar to the line above could be found.

Relevant issue we would like to have fixed are usually in golang itself and not in its toolchain, so this PR pins it to 1.22.0 and disables patch updates for the go directive in go.mod.
golang images are still updated.

Other projects like kubernetes and controller-runtime are using the same approach.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Release note:

NONE

@gardener-prow gardener-prow bot added area/dev-productivity Developer productivity related (how to improve development) kind/enhancement Enhancement, improvement, extension cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. labels Apr 10, 2024
@gardener-prow gardener-prow bot requested review from ary1992 and rfranzke April 10, 2024 15:31
@gardener-prow gardener-prow bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 10, 2024
@rfranzke
Copy link
Member

/lgtm
/approve

@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label Apr 11, 2024
Copy link
Contributor

gardener-prow bot commented Apr 11, 2024

LGTM label has been added.

Git tree hash: 39e78191d8bdf4ad2993f8a67e7fc4a56e6e5ea9

Copy link
Contributor

gardener-prow bot commented Apr 11, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rfranzke

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gardener-prow gardener-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 11, 2024
ialidzhikov added a commit to gardener/gardener-extension-registry-cache that referenced this pull request Apr 11, 2024
@gardener-prow gardener-prow bot merged commit 05825c7 into gardener:master Apr 11, 2024
Copy link
Member

@timebertt timebertt left a comment

Choose a reason for hiding this comment

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

I'm curious about two alternatives:

  • If we only specify the minor go version in go.mod we would instruct go to use a compatible toolchain version, so that CI images will need to be on the same minor version but patch version differences won't matter.
  • If we specify GOTOOLCHAIN=auto or something like GOTOOLCHAIN=go1.22.0 in CI jobs, go will automatically use the right toolchain version.

@oliver-goetz oliver-goetz deleted the enh/go-toolchain branch April 11, 2024 07:53
@oliver-goetz
Copy link
Member Author

I'm curious about two alternatives:

  • If we only specify the minor go version in go.mod we would instruct go to use a compatible toolchain version, so that CI images will need to be on the same minor version but patch version differences won't matter.

There have been some issues with that like for dependabot (ref).

Afaik, go x.y breaks forward compatibility (ref) starting with Go 1.21.0 too, because Go is not able to identify the toolchain in this case. Since Go 1.21 the toolchain name changed from go1.20 to go1.21.0 (ref).

  • If we specify GOTOOLCHAIN=auto or something like GOTOOLCHAIN=go1.22.0 in CI jobs, go will automatically use the right toolchain version.

We are setting the GOTOOLCHAIN=auto in golang-test image (ref). This works (most of the time) as expected 😄
However, according to our experiences the last weeks there are so many repositories using Gardener with so many pipelines that there are always cases where something breaks.
In practice checking the pipelines and updating the Go versions was often an additional burden to the person who updated the gardener/gardener dependency.

@oliver-goetz
Copy link
Member Author

/cherry-pick release-v1.91

@oliver-goetz
Copy link
Member Author

/cherry-pick release-v1.92

@gardener-ci-robot
Copy link
Contributor

@oliver-goetz: #9564 failed to apply on top of branch "release-v1.91":

Applying: Use Go Toolchain `1.22.0`
Using index info to reconstruct a base tree...
M	go.mod
Falling back to patching base and 3-way merge...
Auto-merging go.mod
CONFLICT (content): Merge conflict in go.mod
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Use Go Toolchain `1.22.0`
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-v1.91

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/test-infra repository.

@gardener-ci-robot
Copy link
Contributor

@oliver-goetz: new pull request created: #9568

In response to this:

/cherry-pick release-v1.92

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/test-infra repository.

gardener-prow bot pushed a commit that referenced this pull request Apr 12, 2024
…of the Go Toolchain only (#9569)

* Use Go Toolchain `1.22.0`

* Update renovate config
dimitar-kostadinov added a commit to gardener/gardener-extension-registry-cache that referenced this pull request Apr 19, 2024
gardener-prow bot pushed a commit to gardener/gardener-extension-registry-cache that referenced this pull request Apr 19, 2024
* Bump github.com/gardener/gardener from 1.92.0 to 1.93.0

Bumps [github.com/gardener/gardener](https://github.com/gardener/gardener) from 1.92.0 to 1.93.0.
- [Release notes](https://github.com/gardener/gardener/releases)
- [Commits](gardener/gardener@v1.92.0...v1.93.0)

---
updated-dependencies:
- dependency-name: github.com/gardener/gardener
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Use `x.y.0` versions of the Go Toolchain only

Similar to gardener/gardener#9564

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dimitar Kostadinov <dimitar.kostadinov@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/dev-productivity Developer productivity related (how to improve development) cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/enhancement Enhancement, improvement, extension lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants