kubernetes-sigs / kustomize

Customization of kubernetes YAML configurations
Apache License 2.0
11.09k stars 2.26k forks source link

Update go 1.22.7 #5763

Closed koba1t closed 2 months ago

koba1t commented 2 months ago

fix https://github.com/kubernetes-sigs/kustomize/issues/5762

k8s-ci-robot commented 2 months ago

This PR has multiple commits, and the default merge method is: merge. You can request commits to be squashed using the label: tide/merge-method-squash

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
koba1t commented 2 months ago

@varshaprasad96 Please type the retest command after https://github.com/kubernetes/test-infra/pull/33478 is merged.

varshaprasad96 commented 2 months ago

/retest

k8s-ci-robot commented 2 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: koba1t, varshaprasad96

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: - ~~[OWNERS](https://github.com/kubernetes-sigs/kustomize/blob/master/OWNERS)~~ [koba1t,varshaprasad96] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
sbueringer commented 1 month ago

@koba1t Was the minimum go version in the go.mod file intentionally bumped to 1.22.7? (instead of just 1.22.0)

We have a dependency to kyaml and the minimum go version in the kyaml go.mod file would now force us to also require 1.22.7 as min version (which I would prefer to avoid if possible, as it in turn forces everyone that uses our module also to use >= 1.22.7)

(xref: https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/pull/3222#issuecomment-2414665249)

koba1t commented 1 month ago

@sbueringer

Sorry, I just wanted to use go >= 1.22.0. However, I feel that it is hard to downgrade the golang version of this project.

If it is acceptable, can you wait to upgrade kyaml until kubernetes-sigs/cluster-api-provider-vsphere is upgraded to go 1.23?

sbueringer commented 1 month ago

Sorry, I just wanted to use go >= 1.22.0.

No worries.

If it is acceptable, can you wait to upgrade kyaml until kubernetes-sigs/cluster-api-provider-vsphere is upgraded to go 1.23?

Talked to @chrischdi. We're fine, we have ways to work around it.

However, I feel that it is hard to downgrade the golang version of this project.

For us it's okay to keep it as is. Just one note for the future. There is a difference between the Go version that is used to compile a module and the minimium go version ("go 1.22.7") defined in the go.mod file. The latter forces everyone that imports the module to:

This affects everyone who has a transitive dependency on a module.

E.g. controller-runtime chose because of that to only require 1.22.0 in their go module: https://github.com/kubernetes-sigs/controller-runtime/blob/v0.18.5/go.mod

So overall I would just recommend going forward to use .0 versions in the go.mod file. You can (and should) still use a higher Go patch version for running unit tests, compiling binaries etc.

chrischdi commented 1 month ago

Note: For fixing the linked issue it should have been enough to bump the go version used for compiling and keep the go 1.21. That would even be cherry-pickable to branches for patch releases.

(Edit:)For fixing those issues it would still have been

~Still~ okay I think to bump the directive to e.g. go 1.22.0 for a next minor release.