-
Notifications
You must be signed in to change notification settings - Fork 3k
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
k8s.io/client-go vendors k8s.io/apimachinery which breaks build #83
Comments
TL;DR: go's vendoring system is fundamentally broken. We are working on switching to the new dep vendoring management tool, after which this should be acceptable. (You'll run dep ensure and it will flatten the dependencies.) If we don't vendor, then you'll have a very difficult time getting a set of dependencies that actually works. We describe this in the top level README. This is a huge source of pain for us--we just did some code moves to other packages which are causing the current set of difficulties. |
(And I know the go doctrine is "have stable public apis and make new repos when you break them" but we are untangling a big ball of spaghetti and that's just totally impractical for us.) |
@lavalamp no argument there, vendor/ is utterly broken for library writers. /cc @spf13
This tool is marked pre alpha, are you sure that is prudent? Can you at least update the vendored copy of k8s.io/apimachinery ? |
apimachinery updates a lot faster than client-go because of the way the process goes. client-go is the one that needs updating, but because of the merge queue process its difficult to do. See my comment here for fixing client-go sync kubernetes/kubernetes#39504 (comment) |
@davecheney do you use a vendor package management tool? Both godep and glide will flatten the dependencies. However, godep won't handle version conflicts in dependencies. This is why we want to switch to dep or glide, which supports specifying a range of versions, lowing the probability of conflicts. For now, can you use the release-2.0 branch of client-go? That branch doesn't depend on k8s.io/apimachinary. |
dpw/vendetta. I've worked around the issue for the moment.
Please feel free to close this issue.
…On Wed, Feb 1, 2017 at 8:39 PM, Chao Xu ***@***.***> wrote:
This program will not compile because the vendored copy of
k8s.io/apimachinery (https://github.com/kubernetes/client-go/tree/
master/vendor/k8s.io/apimachinery) aliases the copy in my own project
@davecheney <https://github.com/davecheney> do you use a vendor package
management tool? Both godep and glide will flatten the dependencies.
However, godep won't handle version conflicts in dependencies. This is why
we want to switch to dep or glide, which supports specifying a range of
versions, lowing the probability of conflicts.
For now, can you use the release-2.0 branch of client-go? That branch
doesn't depend on k8s.io/apimachinary.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#83 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAcA0CWgCsBYohiA8mIaGTztY2-Vcoyks5rYFK5gaJpZM4LyGG0>
.
|
A version of client-go with the apimachinery package flattened back out is in github.com/lavalamp/client-go-flat. (go get github.com/lavalamp/client-go-flat should work.) Is this approach something we should automate and officialize? |
Using Glide with its |
@lavalamp @smarterclayton @liggitt in the experiment you've created here: https://github.com/lavalamp/client-go-flat/, how would another library writer who generated his clients using our client generator against the apimachinery repo go about creating a compatible client? The signatures for anything that uses an apimachinery type like RESTClient https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/client-go/rest/client.go#L61-L89 will be incompatible. As we add aggregated API servers, we expect this to be more common, not less. |
@lavalamp I think we ought to try to deleting the content of |
@deads2k Leaving only apimachinery out of vendor/ is strange. If a user use The synchronized rollout work (kubernetes/test-infra#1784) will keep client-go/vendor/k8s.io/apimachinery up-to-date, so keeping the whole We could also remove the entire |
@caesarxuchao is there another option that will allow different |
ok, I think flattening out the dependencies like we talked about at the SIG is not a workable plan. I think our approach should be:
|
I currently need to have set exact revisions of this repo and |
@seh I am also using |
@caesarxuchao has kubernetes/test-infra#1784 to change the client-go publishing infrastructure so that it stops lagging behind. |
Current strategy is being worked out in https://docs.google.com/document/d/1h_IBGYPMa8FS0oih4NbVkAMAzM7YTHr76VBcKy1qFbg/edit# |
@lavalamp That's not publicly viewable? |
It's shared with the api machinery sig group--there should be a link in the
title.
…On Mon, Feb 13, 2017 at 11:10 AM, Ruben Vermeersch ***@***.*** > wrote:
@lavalamp <https://github.com/lavalamp> That's not publicly viewable?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#83 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAnglicvYPxH_Qo3JWUSIJ8NHRu4Nsqeks5rcKqngaJpZM4LyGG0>
.
|
edit: redacted. I misunderstood what tags import what.
[0] https://github.com/kubernetes/client-go/blob/v2.0.0-alpha.1/Godeps/Godeps.json Line 319 in 8b466d6
|
@ericchiang v2.0.0 doesn't depend on k8s.io/apimachinery, why would glide try to import apimachinery? |
@caesarxuchao ah my bad. So master imports |
Right. v2.0.0 is reflect kuberentes 1.5, when k8s.io/apimanichery doesn't exist yet. |
Maybe most of you have seen this already: @lavalamp wrote a good summary about ways to vendor client-go: https://github.com/kubernetes/client-go/blob/master/INSTALL.md |
Given my changes to README.md & INSTALL.md, and the fact that @caesarxuchao has cut & blessed the v2.0.0 tag and added some detail to CHANGELOG.md, I think we can finally consider this resolved. Separate issues have been filed for a few remaining tasks (e.g. CI for the install instructions). |
@lavalamp I've tried following your instructions in INSTALL.md (I'm one of those pesky users who just wants to use I don't think it's even possible. It states:
It's not possible to not share dependencies. For instance, getting a Pod has the following signature (as part of
That's hardly obscure as a use case. Am I missing something? |
@rubenv thanks for pointing that out. I forgot about it in the stack of other things that were broken. |
@lavalamp have you found any time to look into this? It's currently still impossible to use |
@rubenv this is being worked on in kubernetes/test-infra#1784 and related PRs by @caesarxuchao. Until that is merged and runs daily, client-go master branch continues to be kind of broken. Not really satisfying now, but we are getting near to a solution. |
Cool, subscribing. Thanks a lot for the effort and apologies for the complaining :-) |
Now if a user |
So, I'm sure you all are familiar with https://github.com/ericchiang/k8s, they manage to provide from what I can tell the same functionality with only two dependencies. I am curious from a design perspective what advantage your numerous dependencies have over their two dependency solution? |
TL;DR: libraries must not vendor their dependencies
It is not possible to build programs that vendor k8s.io/client-go as the latter has vendored k8s.io/apimachinery.
Sample program:
This program will not compile because the vendored copy of k8s.io/apimachinery (https://github.com/kubernetes/client-go/tree/master/vendor/k8s.io/apimachinery) aliases the copy in my own project, this breaks type equality.
The text was updated successfully, but these errors were encountered: