Client-go: vendor directory

Created on 30 Aug 2016  Â·  21Comments  Â·  Source: kubernetes/client-go

I'm so stoked to see this client pulled out from the main repo. Thank you so much!

Okay, so it'd be nice for this repository to not vendor its dependencies. I think it may have happened accidentally since the Godeps directory next to it is blank.

There's been a rough consensus so far that vendoring dependencies is great for OSS binaries but that for OSS libraries they tend to hurt more than they help. This is because a number of Go libraries set globals and fiddle bits in other libraries and the collisions that occur when two (or more) versions of the library interact can be difficult to suss out or even identify.

And since the Godeps directory is blank, even if I was a supremely disciplined engineer that inspect all of my dependencies' dependencies' versions, that would be difficult to do.

But maybe this battle was fought some time ago. Would love to get a link that discussion!

lifecyclrotten

Most helpful comment

@caesarxuchao At the moment, libraries in Go _cannot_ vendor their dependencies (with one class of exceptions (viz.) that to the best of my knowledge do not apply in this circumstance). The solution here is to _remove_, not merely _minimize_, the vendor directory. This is not an optimization but rather an issue of correctness. Is there a way I can help accomplish this goal?

All 21 comments

I agree with this. We have many projects that would benefit from having a kube client and having the vendor libs potentially conflict is a non-trivial barrier.

It would also be a good forcing function for both minimizing external dependencies for the client and keeping those libs up-to-date in the main kube repo.

Godeps.json is checked in now. There are more discussions here.

Temporary solutions for dependency management: https://github.com/kubernetes/client-go/blob/master/README.md#dependency-management.

We are starting to analyze and minimize the vendor directory. Helps are appreciated!

@caesarxuchao At the moment, libraries in Go _cannot_ vendor their dependencies (with one class of exceptions (viz.) that to the best of my knowledge do not apply in this circumstance). The solution here is to _remove_, not merely _minimize_, the vendor directory. This is not an optimization but rather an issue of correctness. Is there a way I can help accomplish this goal?

@peterbourgon thanks. It would be great if you can submit PRs to the main repository (https://github.com/kubernetes/kubernetes) to decouple the clients from these vendored dependencies. I guess many dependencies can be removed easily.

We hate the vendored libraries too, however we're not actually confident that it will even work with head from all the dependencies.

@krousey is working on removing some dependencies.

Basically, if we delete the vendor directory, then it will be extremely difficult for people to identify the set of dependencies that is tested and known working.

If we leave the vendor directory there, then people can easily delete it if they want to take their chances with HEAD from everything.

I found yesterday that I can't use _client-go_ together with my own vendored _github.com/spf13/pflag_ package, falling prey to the problem exemplified in this _golang-broken-vendor_ repository, without using Glide's --strip-vendor option.

Is there a place you would have seen our documentation? (we mention this in
the README)

On Thu, Sep 29, 2016 at 5:02 AM, Steven E. Harris [email protected]
wrote:

I found yesterday that I can't use _client-go_ together with my own
vendored _github.com/spf13/pflag_ https://github.com/spf13/pflag
package, falling prey to the problem exemplified in this
_golang-broken-vendor_ repository
https://github.com/mattfarina/golang-broken-vendor, without using
Glide's --strip-vendor option.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/kubernetes/client-go/issues/2#issuecomment-250446960,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAnglkk_ZUGbIseAbXfO5EegI2EiZt7nks5qu6i7gaJpZM4JwFXs
.

First I'd have to notice that the the _README.md_ file exits, and actually _read_ it. I just did that, and I see that you do indeed mention this problem.

It would be helpful to address those using tools other than _godep_, such as Glide, but then in fairness it's not your responsibility to cover every possible tool under the sun.

The readme is displayed by github if you visit the client repo-- I guess I
was expecting most people to do that. If you don't mind saying, how did you
find the client repo? maybe there's another place we could have documented
this.

And yeah, sorry, we don't have experience with glide--we'd happily accept a
PR that adds a glide section to the README, though :)

On Thu, Sep 29, 2016 at 10:17 AM, Steven E. Harris <[email protected]

wrote:

First I'd have to notice that the the _README.md_ file exits, and
actually _read_ it. I just did that, and I see that you do indeed mention
this problem.

It would be helpful to address those using tools other than _godep_, such
as Glide, but then in fairness it's not your responsibility to cover every
possible tool under the sun.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/kubernetes/client-go/issues/2#issuecomment-250532258,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAnglgJqTRuRs447XqXLppCHwDlyPyEiks5qu_KngaJpZM4JwFXs
.

I was being cheeky there; me not reading the _README.md_ was my own laziness, not a problem with it being difficult to find.

I came upon this repository by way of watching issue kubernetes/kubernetes#28559 and PR kubernetes/kubernetes#29147 passively. One day I told _gb_ to update my Kubernetes dependencies, with some trepidation, and I found that some things had moved around. When I used GitHub to search for a few identifiers, I noticed that it found them in more than one place, including within the _client-go_ repository. I got excited and started porting my code over by trial and error: search GitHub, replace imports in my code, compile, note errors, and repeat. Never did I stop and consider the new repository as a new _thing_ from the outside in, where I would have encountered the _README.md_ file right away.

As for the documentation PR, once I'm sure that I have Glide working together, I will consider contributing the advice.

Thanks, that's good to know. Please feel free to file issues if we can make
your life easier. :)

On Thu, Sep 29, 2016 at 10:42 AM, Steven E. Harris <[email protected]

wrote:

I was being cheeky there; me not reading the _README.md_ was my own
laziness, not a problem with it being difficult to find.

I came upon this repository by way of watching issue
kubernetes/kubernetes#28559
https://github.com/kubernetes/kubernetes/issues/28559 and PR
kubernetes/kubernetes#29147
https://github.com/kubernetes/kubernetes/pull/29147 passively. One day
I told _gb_ to update my Kubernetes dependencies, with some trepidation,
and I found that some things had moved around. When I used GitHub to search
for a few identifiers, I noticed that it found them in more than one place,
including within the _client-go_ repository. I got excited and started
porting my code over by trial and error: search GitHub, replace imports in
my code, compile, note errors, and repeat. Never did I stop and consider
the new repository as a new _thing_ from the outside in, where I would
have encountered the _README.md_ file right away.

As for the documentation PR, once I'm sure that I have Glide working
together, I will consider contributing the advice.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/kubernetes/client-go/issues/2#issuecomment-250538785,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAnglkQ0O60dqZNX03fACCrnjj9FEg8Tks5qu_h7gaJpZM4JwFXs
.

Is https://github.com/kubernetes/kubernetes/pull/32208 possibly helping with removing the dependency on pflag in client-go?

It doesn't look like that will actually remove the dependency.

It still imports pflag.

On Tue, Oct 4, 2016 at 9:56 AM Daniel Smith [email protected]
wrote:

It doesn't look like that will actually remove the dependency.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/kubernetes/client-go/issues/2#issuecomment-251447160,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACsVaVtbRCUovkRCGBKvap7GUP2AEnS4ks5qwoVVgaJpZM4JwFXs
.

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta.
/lifecycle stale

The state of the world hasn't changed; libraries still _cannot_ vendor dependencies.

/remove-lifecycle stale

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten
/remove-lifecycle stale

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yashbhutwala picture yashbhutwala  Â·  4Comments

tamalsaha picture tamalsaha  Â·  6Comments

inetkiller picture inetkiller  Â·  6Comments

prestonvanloon picture prestonvanloon  Â·  6Comments

mheese picture mheese  Â·  5Comments