Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Regenerate go.mod indirect dependencies #724

Merged

Conversation

gibizer
Copy link
Contributor

@gibizer gibizer commented Mar 1, 2024

During the golang version bump we unintentionally introduced a too new
indirect dependency on kube-openapi:

k8s.io/kube-openapi@v0.0.0-20240209001042-7a0d5b415232

This is not required by any of our direct deps and this is also a
version that required golang 1.21. If your system has golang 1.21
installed the this dependency might force go mod tidy to change the
golang version in the go.mod file to 1.21.

This patch removed all the indirect dependencies and let go mod tidy to
regenerate them to get rid of the too new kube-openapi version.

This happened again in the bump dc2ba9b and revert 7a0ed7b of the
cert-manager dependency.

Copy link
Contributor

@jpodivin jpodivin left a comment

Choose a reason for hiding this comment

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

If possible we shouldn't introduce dependency on an unmaintained library, even if it's an indirect one.

Bumping zap to version 1.27 should get rid of it. As zap maintainers removed this dependency themselves over a year ago. uber-go/zap#1331

@@ -1,3 +1,4 @@
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
Copy link
Contributor

Choose a reason for hiding this comment

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

This library is no longer maintained.

@gibizer
Copy link
Contributor Author

gibizer commented Mar 1, 2024

If possible we shouldn't introduce dependency on an unmaintained library, even if it's an indirect one.

Bumping zap to version 1.27 should get rid of it. As zap maintainers removed this dependency themselves over a year ago. uber-go/zap#1331

We are already on zap 1.27 as per https://github.com/openstack-k8s-operators/dataplane-operator/pull/724/files#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6R69 . But some of our deps are using older zap. Hence the go.sum line:

❯ go mod graph | grep ' go.uber.org/zap'
github.com/openstack-k8s-operators/dataplane-operator go.uber.org/zap@v1.27.0
github.com/cert-manager/cert-manager@v1.13.4 go.uber.org/zap@v1.25.0
github.com/go-logr/zapr@v1.2.4 go.uber.org/zap@v1.24.0
github.com/openstack-k8s-operators/infra-operator/apis@v0.3.1-0.20240221083751-49edc0df8a12 go.uber.org/zap@v1.26.0
github.com/openstack-k8s-operators/lib-common/modules/certmanager@v0.0.0-20240229121803-169ced56d56e go.uber.org/zap@v1.27.0
github.com/openstack-k8s-operators/lib-common/modules/common@v0.3.1-0.20240229121803-169ced56d56e go.uber.org/zap@v1.27.0
github.com/openstack-k8s-operators/openstack-ansibleee-operator/api@v0.3.1-0.20240226163515-d53e4f43e3b0 go.uber.org/zap@v1.27.0
k8s.io/apiextensions-apiserver@v0.28.7 go.uber.org/zap@v1.19.0
k8s.io/component-base@v0.28.7 go.uber.org/zap@v1.19.0
sigs.k8s.io/controller-runtime@v0.16.5 go.uber.org/zap@v1.25.0

Copy link
Collaborator

@fao89 fao89 left a comment

Choose a reason for hiding this comment

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

+2

@openshift-ci openshift-ci bot added the lgtm label Mar 5, 2024
@slagle slagle dismissed jpodivin’s stale review March 5, 2024 15:36

Given all the other approvals, let's followup the concern here with a separate PR if you feel strongly it needs to be addressed.

@openshift-ci openshift-ci bot removed the lgtm label Mar 5, 2024
Copy link

Merge Failed.

This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset.
Warning:
Error merging github.com/openstack-k8s-operators/dataplane-operator for 724,2907027a5f42793241b0ab695078515289731117

During the golang version bump we unintentionally introduced a too new
indirect dependency on kube-openapi:

k8s.io/kube-openapi@v0.0.0-20240209001042-7a0d5b415232

This is not required by any of our direct deps and this is also a
version that required golang 1.21. If your system has golang 1.21
installed the this dependency might force go mod tidy to change the
golang version in the go.mod file to 1.21.

This patch removed all the indirect dependencies and let go mod tidy to
regenerate them to get rid of the too new kube-openapi version.

This happened again in the bump dc2ba9b and revert 7a0ed7b of the
cert-manager dependency.
@gibizer
Copy link
Contributor Author

gibizer commented Mar 5, 2024

and rebased again

@openshift-ci openshift-ci bot added the lgtm label Mar 5, 2024
Copy link
Contributor

openshift-ci bot commented Mar 5, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bshephar, fao89, gibizer, rebtoor, slagle

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 [bshephar,fao89,rebtoor,slagle]

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

@openshift-merge-bot openshift-merge-bot bot merged commit 03eaf6d into openstack-k8s-operators:main Mar 5, 2024
5 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants