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

Upgrading to go 1.22 + k8s 1.30 dependencies #2988

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

robscott
Copy link
Member

What type of PR is this?
/kind cleanup

What this PR does / why we need it:
Kubernetes v1.30 was released today, this bumps dependencies to match.

Which issue(s) this PR fixes:
Fixes #2956

Does this PR introduce a user-facing change?:

Dependencies have been updated to use Go 1.22 and Kubernetes 1.30.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 18, 2024
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 18, 2024
@robscott robscott added this to the v1.1.0 milestone Apr 18, 2024
go.mod Outdated
@@ -1,23 +1,23 @@
module sigs.k8s.io/gateway-api

go 1.21
go 1.22.2
Copy link
Contributor

Choose a reason for hiding this comment

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

there's no need to require .2 (I think)

this is viral and will force all dependencies to do so as well

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it's automatic now, go mod tidy will hardcode 1.22.0 if we just have 1.22 here. Maybe that's preferable? (x-ref https://github.com/kubernetes/kubernetes/blob/master/go.mod#L9)

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah I would put 1.22.0.

1.22.2 says "you MUST have the .2 patch to use this as a library". Really the Go specifier should be the minimum version you support (though in practice this doesn't matter much since the go ecosystem is pretty good about updating)

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I've complained here - golang/go#65847

Copy link
Member Author

Choose a reason for hiding this comment

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

It seems like upstream is moving to 1.22.2 for now (x-ref kubernetes/kubernetes#124386), will stick with this until a better option emerges.

Copy link

Choose a reason for hiding this comment

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

I closed kubernetes/kubernetes#124386 until we think through this more and left k/k at 1.22.0, xref kubernetes/kubernetes#124386 (comment)

Copy link

@liggitt liggitt Apr 19, 2024

Choose a reason for hiding this comment

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

I'd recommend go 1.22.0 or whatever go dictates your minimum has to be ... including the patch means you won't fight go tooling, leaving it at the minimum patch in the minor means you are permissive to your downstreams and builders as possible

Building with go patch versions above the minimum works perfectly well (and you can actually put toolchain directives in the go.mod file to indicate you require building main packages in this module with a higher patch version if you want)

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated to use 1.22.0, thanks everyone!

go.mod Outdated
k8s.io/utils v0.0.0-20240102154912-e7106e64919e
sigs.k8s.io/controller-runtime v0.16.3
sigs.k8s.io/controller-runtime v0.17.3
Copy link
Contributor

Choose a reason for hiding this comment

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

surprised this works since they don't support 1.30 yet and there were incompatible changes.. I guess we must not import some of those packages

Copy link
Member Author

Choose a reason for hiding this comment

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

Bumped back to v0.17.0 to allow dependent implementations to pick up newer changes from controller-runtime - no changes in either case from perspective of Gateway API directly.

@robscott robscott force-pushed the go-1-22 branch 2 times, most recently from 6ee70e6 to 6eeee6a Compare April 18, 2024 18:56
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 18, 2024
@robscott
Copy link
Member Author

robscott commented Apr 18, 2024

Looks like any use of applyconfiguration-gen is broken until kubernetes/kubernetes#124371 merges (ideally in time for v1.30.1). That leaves us with a few not-great options:

  1. Release RC1 without applyconfigurations
  2. Release RC1 without k8s 1.30 + go 1.22
  3. Wait for k8s v1.30.1 until releasing RC1

At this point, I'm thinking that if v1.30.1 is not ready (or close to ready) by the time we're ready to release RC1, we should move forward with option 1 with the idea that we might be able to add applyconfigurations back in before RC2 (cc @dprotaso).

@dprotaso
Copy link
Contributor

The docker images need bumping to go 1.22 as well - see #2993

@robscott robscott force-pushed the go-1-22 branch 2 times, most recently from bc726c7 to e22f237 Compare April 19, 2024 00:11
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Apr 19, 2024
@robscott
Copy link
Member Author

Looks like any use of applyconfiguration-gen is broken until kubernetes/kubernetes#124371 merges (ideally in time for v1.30.1). That leaves us with a few not-great options:

  1. Release RC1 without applyconfigurations
  2. Release RC1 without k8s 1.30 + go 1.22
  3. Wait for k8s v1.30.1 until releasing RC1

Thanks to some clever hacks by @dprotaso, we've got a workaround that should work until the upstream fix is released in v1.30.1. This PR is ready for another round of review.

@robscott
Copy link
Member Author

The docker images need bumping to go 1.22 as well - see #2993

Updated, thanks @dprotaso!

@dprotaso
Copy link
Contributor

/retest

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 23, 2024
@shaneutt
Copy link
Member

I think it would be nice if we could get this in for 1.1.

@robscott
Copy link
Member Author

I think @k8s-ci-robot needs some help clearing the needs-rebase label,

/honk

@k8s-ci-robot
Copy link
Contributor

@robscott:
goose image

In response to this:

I think @k8s-ci-robot needs some help clearing the needs-rebase label,

/honk

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.

@robscott robscott force-pushed the go-1-22 branch 2 times, most recently from 04937dc to 01aae89 Compare April 23, 2024 22:25
Co-authored-by: Dave Protasowski <dprotaso@gmail.com>
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 23, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: howardjohn, robscott

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

@howardjohn
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 23, 2024
@k8s-ci-robot k8s-ci-robot merged commit 12d50fe into kubernetes-sigs:main Apr 23, 2024
8 checks passed
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/gwctl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bump Go Version and Kubernetes Dependencies after Kubernetes v1.30 is released
6 participants