Merge pull request #134 from jbeda/update-readme

Update INSTALL.md to match reality
This commit is contained in:
Daniel Smith 2017-03-02 10:21:54 -08:00 committed by GitHub
commit ca90456a21

View File

@ -2,24 +2,10 @@
## For the casual user ## For the casual user
If you want to write a simple script, don't care about a reproducible client Currently, there is no super easy way to use client-go. Hopefully this will
library install, don't mind getting head (which may be less stable than a change soon. Simply running `go get k8s.io/client-go/...` will leave you with a
particular release) and don't share any dependencies with client-go, then library that can't practically be used. It is important to synchronize your
simply: dependencies with the ones that are required by the library.
```sh
$ go get k8s.io/client-go/...
# Test install
$ go build k8s.io/client-go/examples/...
```
This will install `k8s.io/client-go` in your `$GOPATH`. `k8s.io/client-go` includes its own
dependencies in its `k8s.io/client-go/vendor` path. `go get` will not flatten
those dependencies into your `$GOPATH`, which means they will be distinct from
any dependencies you may already have there. This will be problematic if you
happen to already have a copy of, say, glog, and in that case you'll need to
look down at the next section.
Note: the official go policy is that libraries should not vendor their Note: the official go policy is that libraries should not vendor their
dependencies. This is unworkable for us, since our dependencies change and HEAD dependencies. This is unworkable for us, since our dependencies change and HEAD
@ -53,10 +39,11 @@ $ go install github.com/golang/dep/cmd/dep
# Make sure you have a go file in your directory which imports k8s.io/client-go # Make sure you have a go file in your directory which imports k8s.io/client-go
# first--I suggest copying one of the examples. # first--I suggest copying one of the examples.
$ dep init
$ dep ensure k8s.io/client-go@^2.0.0 $ dep ensure k8s.io/client-go@^2.0.0
``` ```
This will set up a /vendor directory in your current directory, add `k8s.io/client-go` This will set up a `vendor` directory in your current directory, add `k8s.io/client-go`
to it, and flatten all of `k8s.io/client-go`'s dependencies into that vendor directory, to it, and flatten all of `k8s.io/client-go`'s dependencies into that vendor directory,
so that your code and `client-go` will both get the same copy of each so that your code and `client-go` will both get the same copy of each
dependency. dependency.