-
Notifications
You must be signed in to change notification settings - Fork 378
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
Incorrect repository layour for v2 Go Modules #239
Comments
Hi @pohly, can you take a look? |
@xing-yang you need to do something similar to kubernetes-csi/csi-test#232 You can probably drop the "dep" compatibility symlinks. This seems less important for external-snapshotter than it was for csi-test. |
Agree, drop the |
If I understood well the documentation, a new tag should be also added once |
That's correct. The existing v2.0.0 release needs to be replaced by a v2.0.1. |
I'm still getting the same error after merging the fix and cutting the v2.0.1 release:
I tried csi-test, but it also does not work for me.
Reopen this issue. |
The original issue is solved, dependency can be resolved now. You can check it: https://sum.golang.org/lookup/github.com/kubernetes-csi/external-snapshotter/[email protected]
Example go.mod
Import statements have to be updated to use it correctly: package main
import (
snapshotv1beta1api "github.com/kubernetes-csi/external-snapshotter/v2/pkg/apis/volumesnapshot/v1beta1"
)
// Your code here |
I think it is a defect of Step 1% docker run --rm -it golang:1.13
root@ebbe414b9f65:/go# mkdir -p src/github.com/kubernetes-csi
root@ebbe414b9f65:/go# cd src/github.com/kubernetes-csi
root@ebbe414b9f65:/go/src/github.com/kubernetes-csi# git clone https://github.com/kubernetes-csi/external-snapshotter.git
root@ebbe414b9f65:/go/src/github.com/kubernetes-csi# cd external-snapshotter/
root@d5d5f0a0e82a:/go/src/github.com/kubernetes-csi/external-snapshotter# # optional - git checkout -b release-2.0 origin/release-2.0
root@ebbe414b9f65:/go/src/github.com/kubernetes-csi/external-snapshotter# rm -fr v2/ Step 2 - add
|
One more step: git checkout -- hack/update-generated-code.sh |
It tried it and it worked for me, but too complicated and error prone. I wonder if v2 should actually be the physical path while pkg and cmd should be symlinks, but I'm not sure what additional problems that will bring. Can you submit a PR and add these steps to hack/README.md? |
Xing Yang <[email protected]> writes:
I tried csi-test, but it also does not work for me.
```
# go get -v ***@***.***
go: finding github.com/kubernetes-csi/csi-test v3.0.0
go: finding github.com/kubernetes-csi/csi-test v3.0.0
go get ***@***.***: ***@***.***: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v3
```
You also need to include the version in the path, like this:
go get github.com/kubernetes-csi/csi-test/v3/pkg/[email protected]
|
@pohly that works. Thanks. |
It is impossible to use repository with Go Modules because it breaks the mandatory requirements for
v2
.It works with
v1.2.2
but not withv2.0.0
.https://sum.golang.org/lookup/github.com/kubernetes-csi/[email protected]
Details and requirements:
The text was updated successfully, but these errors were encountered: