Skip to content

The v.2.x.x versions are not importable #1407

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

Closed
gibizer opened this issue Jul 21, 2023 · 1 comment · Fixed by #1411
Closed

The v.2.x.x versions are not importable #1407

gibizer opened this issue Jul 21, 2023 · 1 comment · Fixed by #1411
Assignees
Labels
bug Something isn't working

Comments

@gibizer
Copy link

gibizer commented Jul 21, 2023

Describe the bug

The v2.x.x versions cannot be imported to another go project.

The https://github.com/golang/go/wiki/Modules#semantic-import-versioning states that:

If the module is version v2 or higher, the major version of the module must be included as a /vN at the end of the module paths used in go.mod files (e.g., module github.com/my/mod/v2, require github.com/my/mod/v2 v2.0.1)

It seem this is not followed and therefore go mod fails to pick up the new major version:

$ GOPROXY="direct" go list -m --versions github.com/rabbitmq/cluster-operator
github.com/rabbitmq/cluster-operator v1.0.0 v1.1.0 v1.2.0 v1.3.0 v1.4.0 v1.5.0 v1.6.0 v1.7.0 v1.8.0 v1.8.1 v1.8.2 v1.8.3 v1.9.0 v1.10.0 v1.11.0 v1.11.1 v1.12.0 v1.12.1 v1.13.0 v1.13.1 v1.14.0
$ GOPROXY="direct" go list -m --versions github.com/rabbitmq/cluster-operator/v2
go: loading module retractions for github.com/rabbitmq/cluster-operator/[email protected]: version "v2.4.0" invalid: go.mod has non-.../v2 module path "github.com/rabbitmq/cluster-operator" (and .../v2/go.mod does not exist) at revision v2.4.0

To Reproduce

  1. go list -m --versions github.com/rabbitmq/cluster-operator
  2. go list -m --versions github.com/rabbitmq/cluster-operator/v2

Expected behavior
v2 versions are listed

Screenshots

N/A

Version and environment information

N/A

Additional context

We are importing this operator in https://github.com/openstack-k8s-operators/infra-operator

@gibizer gibizer added the bug Something isn't working label Jul 21, 2023
gibizer added a commit to gibizer/infra-operator that referenced this issue Jul 21, 2023
We cannot go higher as v2.3.0 pulls in new k8s and controller runtime
versions we are not compatible with yet.

Also we cannot point to v2.2.0 directly as they are not properly
releasing the v2 versions. See rabbitmq/cluster-operator#1407
@Zerpet
Copy link
Member

Zerpet commented Jul 25, 2023

Looks like we missed updating the go.mod when we created a new major. In fairness, I didn't expect people to import our code 😅 Thank you for reporting this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants