-
Notifications
You must be signed in to change notification settings - Fork 157
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
Change module name to k8c.io/kubermatic/v2 #5728
Conversation
/retest |
/approve |
/retest |
# move files into their correct location, generate-groups.sh does not handle | ||
# non-v1 module names very well | ||
cp -r v2/* . | ||
rm -rf v2/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this still necessary or inclusion of k8c.io/kubermatic/v2
in vanitygen solved the issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, now I understand, this is still required. The updated vanity URL has no impact on this particular hack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the source code initially placed in $GOPATH/src/k8c.io/kubermatic/v2
, then codegen works perfectly well, without need for hacks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah but you cannot go-get Kubermatic into a v2 directory. I tried it with a random module:
$ go get -u -v github.com/cespare/xxhash/v2
github.com/cespare/xxhash (download)
package github.com/cespare/xxhash/v2: cannot find package "github.com/cespare/xxhash/v2" in any of:
/usr/local/go/src/github.com/cespare/xxhash/v2 (from $GOROOT)
/home/xrstf/gospace/src/github.com/cespare/xxhash/v2 (from $GOPATH)
$ go get -u -v github.com/cespare/xxhash
github.com/cespare/xxhash (download)
I doubt that we would have to clone Kubermatic into a v2
directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ go get -v github.com/cespare/xxhash/v2
go: downloading github.com/cespare/xxhash/v2 v2.1.1
go: downloading github.com/cespare/xxhash v1.1.0
go: github.com/cespare/xxhash/v2 upgrade => v2.1.1
github.com/cespare/xxhash/v2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose you had GO111MODULE=off
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But go get places the module into pkg/, not into src/, so how does it relate?
/retest |
1 similar comment
/retest |
@@ -40,6 +40,7 @@ presubmits: | |||
run_if_changed: "^(cmd|codegen|hack|pkg)/" | |||
decorate: true | |||
clone_uri: "ssh://git@github.com/kubermatic/kubermatic.git" | |||
path_alias: k8c.io/kubermatic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path_alias: k8c.io/kubermatic | |
path_alias: k8c.io/kubermatic/v2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be wrong. The repo is not cloned to /v2. Or is it? I don't have it there, I have it in $GOPATH/src/k8c.io/kubermatic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried this way (moved my local repo into $GOPATH/src/k8c.io/kubermatic/v2) and codegen was perfect!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgive my language, but having the entire repo unter v2/
is just .... so ugly that I would backpeddle on the whole proposal and not include the version in the module name at all :-D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point is that "codegen shell scripts" from k8s.io/code-generator don't care about modules and always treat package names as paths, thus — they will generate to the $GOPATH/src/k8c.io/kubermatic/v2
. So in order to have normally working codegen locally one will have to git clone into the $GOPATH/src/k8c.io/kubermatic/v2
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or, how about we keep the two lines in the bash script and thereby get the best of both worlds? Working codegen and a sane repository structure, where ../dashboard
is actually still the dashboard. Nobody will ever do a git clone https://github.com/kubermatic/kubermatic v2
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, sure, on CI nobody cares about the path_alias. But I think it's good to have the script work on CI and locally, so both should use the same filesystem location for the repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to left a warning for the reference, because it caught me unguarded. With go mods it's now possible to place go sources anywhere, not just in $GOPATH/src/<FDPN>
, but codegen doesn't know about this and it will mkdir -p $GOPATH/src/k8c.io/kubermatic/v2
and write files there, no matter where your real kubermatic is in the FS.
/retest |
LGTM label has been added. Git tree hash: 261c21e9ecf0ea254c7f67025a911ab9459ed745
|
/hold Let's prepare others. |
What this PR does / why we need it:
Step 3 on our way to use Go Modules as defined in #5439: Change the module name.
Does this PR introduce a user-facing change?: