-
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
Detailed installation instructions #106
Conversation
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.
@lavalamp Feel free to merge if you think you know the answers :)
|
||
# Make sure you have a go file in your directory which imports k8s.io/client-go | ||
# first--I suggest copying one of the examples. | ||
$ dep ensure k8s.io/client-go@^1.5.1 |
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.
Maybe we should use 2.0-alpha or 2.0-beta as an example. 1.5.1 is not maintained at the moment.
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.
We can't randomly stop maintaining branches. I'll make an issue about this.
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.
INSTALL.md
Outdated
godep save ./... | ||
``` | ||
|
||
Alternatively, if you want to build using the dependencsie in your `$GOPATH`, |
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.
s/dependencsie/dependencies
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.
done
INSTALL.md
Outdated
``` | ||
|
||
At this point, you could copy the `glide.yaml` file into your own project and | ||
run `glide up`. Alternatively, if you already have a `glide.yaml` file, you'll |
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 doesn't look right. The glide.yaml
won't contain any entry for client-go, but "my own project" depends on client-go. Could you double check?
Sorry, I can't verify if this works. The redirection of gopkg.in doesn't work for me, maybe it's because on mac, or because i'm in China..
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.
Hm, good point, I'll fix
Self merging to get this out there. |
@@ -0,0 +1,136 @@ | |||
# Installing client-go | |||
|
|||
## For the casual user |
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'm not sure that this approach will ever work. The minute you start using any API objects you pull in apimachinery from your gopath. I think the only real way to make this work is to flatten dependencies.
$ mkdir -p ~/tmp/go
$ export GOPATH=~/tmp/go
$ go get k8s.io/client-go/...
$ cd ~/tmp
$ cp go/src/k8s.io/client-go/examples/out-of-cluster/main.go
$ go build main.go
main.go:24:2: cannot find package "k8s.io/apimachinery/pkg/apis/meta/v1" in any of:
/usr/local/Cellar/go/1.7.4/libexec/src/k8s.io/apimachinery/pkg/apis/meta/v1 (from $GOROOT)
/Users/jbeda/tmp/go/src/k8s.io/apimachinery/pkg/apis/meta/v1 (from $GOPATH)
$ go get k8s.io/apimachinery/...
$ go build main.go
# command-line-arguments
./main.go:46: cannot use "k8s.io/apimachinery/pkg/apis/meta/v1".ListOptions literal (type "k8s.io/apimachinery/pkg/apis/meta/v1".ListOptions) as type "k8s.io/client-go/vendor/k8s.io/apimachinery/pkg/apis/meta/v1".ListOptions in argument to clientset.CoreV1().Pods("").List
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.
Chao is removing such dependencies (k8s.io/apimachinery & glog for starters) from vendor/
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.
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.
Verified that #2077 did fix the problem @jbeda mentioned.
This is a huge improvement but I don't think we have a solution here without flattening dependencies. This sucks but I'm not sure what is to be done. |
|
||
One thing to note about dep is that it will omit dependencies that aren't | ||
actually used, and some dependencies of `client-go` are used only if you import | ||
one of the plugins (for example, the auth plugins). So you may need to run `dep |
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.
For some reason we statically import the plugins: https://github.com/kubernetes/kubernetes/blob/6bfe0b6741d10574a1ab0b5a401b81831801d0a7/staging/src/k8s.io/client-go/kubernetes/clientset.go#L39-L39
Is this intentional?
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.
No, it's a bug and I'm pretty sure I filed an issue about it some time ago.
@lavalamp well written. Thanks! |
|
||
```sh | ||
$ go get github.com/golang/dep | ||
$ go install github.com/golang/dep/cmd |
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 is already out-of-date btw.
go install github.com/golang/dep/cmd/dep
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 think someone already fixed it.
I'm going to put together an update on this today.
…On Wed, Mar 1, 2017 at 11:56 AM Timothy St. Clair ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In INSTALL.md
<#106 (comment)>:
> +* You want your install to be reproducible. For example, for your CI system or
+ for new team members.
+
+There are three tools you could in theory use for this. Instructions
+for each follows.
+
+### Dep
+
+[dep](github.com/golang/dep) is an up-and-coming dependency management tool,
+which has the goal of being accepted as part of the standard go toolchain. It
+is currently pre-alpha. However, it comes the closest to working easily out of
+the box.
+
+```sh
+$ go get github.com/golang/dep
+$ go install github.com/golang/dep/cmd
this is already out-of-date btw.
go install github.com/golang/dep/cmd/dep
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#106 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACRvqw8gyQPaVht29hlntl03CN-F7iWks5rhc13gaJpZM4MBHNq>
.
|
Fix #105.