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

Module breaks semver rules and has complicated dependency tree #1059

Open
sindrepm opened this issue Mar 22, 2022 · 0 comments
Open

Module breaks semver rules and has complicated dependency tree #1059

sindrepm opened this issue Mar 22, 2022 · 0 comments

Comments

@sindrepm
Copy link

sindrepm commented Mar 22, 2022

Is this a BUG REPORT or FEATURE REQUEST?:

Bug report or maybe both?

What happened:

I have a project that depends on this package. Starting from v2.4.4 you moved from dep to go modules, and I've been having a hard time upgrading to the latest version. Basically, I'm unable to use "go get" to import the latest version of lib as part of my go modules dependencies.

What you expected to happen:

Everything to work as intended with go modules.

How to reproduce it (as minimally and precisely as possible):

Try adding to a new project with go modules enabled:

go get github.com/libopenstorage/stork@v2.8.2
go get: github.com/libopenstorage/stork@v2.8.2: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v2

According to the Go module reference:

Starting with major version 2, module paths must have a major version suffix like /v2 that matches the major version.

However, even in latest version this module's go.mod does not follow this rule:

module github.com/libopenstorage/stork

It should be:

module github.com/libopenstorage/stork/v2

Anything else we need to know?:

I notice that this module has a direct dependency on k8s.io/kubernetes. This makes it awkward to import this module into other projects as you have to explicitly pin each of the transitive dependencies to their respective versions in the project go.mod ("replace" rules). This is because k8s.io/kubernetes doesn't play well with go modules and semver.

Ideally, it would be great if this module could drop that depency and only depend on k8s.io/client-go, k8s.io/api, k8s.io/apimachinery, etc. which are intended to be used by 3. party libs. There doesn't seem to be a whole lot of functionality from the kubernetes package that is used (mostly stuff from pkg/printers), so perhaps those pieces could be extracted and included in this project instead? I haven't looked in detail, though, so it might not be possible. Just a suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant