|
1 | 1 | #### Adding a New Dependency
|
2 |
| -Minikube uses `Godep` to manage vendored dependencies. |
3 |
| -`Godep` can be a bit finnicky with a project with this many dependencies. |
4 |
| -Here is a rough set of steps that usually works to add a new dependency. |
| 2 | +Minikube uses `dep` to manage vendored dependencies. |
5 | 3 |
|
6 |
| -1. Make a clean GOPATH, with minikube in it. |
7 |
| - This isn't strictly necessary, but it usually helps. |
| 4 | +See the `dep` [documentation](https://golang.github.io/dep/docs/introduction.html) for installation and usage instructions. |
8 | 5 |
|
9 |
| - ```shell |
10 |
| - mkdir -p $HOME/newgopath/src/k8s.io |
11 |
| - export GOPATH=$HOME/newgopath |
12 |
| - cd $HOME/newgopath/src/k8s.io |
13 |
| - git clone https://github.com/kubernetes/minikube.git |
14 |
| - cd minikube |
15 |
| - ``` |
16 |
| - |
17 |
| -1. Install the package versions specified in Godeps/Godeps.json |
18 |
| - ```shell |
19 |
| - godep restore ./... |
20 |
| - ``` |
21 |
| - NOTE: If you encounter a HTTP 301 error, you may need to set the following: |
22 |
| - `git config --global http.https://gopkg.in.followRedirects true` |
23 |
| - |
24 |
| -1. `go get` your new dependency. |
25 |
| - ```shell |
26 |
| - go get mynewdepenency |
27 |
| - ``` |
28 |
| - |
29 |
| -1. Use it in code, build and test. |
30 |
| - |
31 |
| -1. Import the dependency from GOPATH into vendor/ |
32 |
| - ```shell |
33 |
| - godep save ./... |
34 |
| - ``` |
35 |
| - |
36 |
| - NOTE: godep seems to have an issue with not recovering files in `vendor/golang.org/x/sys/windows/` |
37 |
| - IF you plan on committing your updated dependencies, make sure not to remove these files in your commit |
38 |
| - |
39 |
| - |
40 |
| - If it is a large dependency, please commit the vendor/ directory changes separately. |
41 |
| - This makes review easier in GitHub. |
42 |
| - |
43 |
| - NOTE: We have recently added a deprecation message regarding boot2docker. Make sure that this deprecation message ends up in the vendored code at `/vendor/github.com/docker/machine/libmachine/provision/boot2docker.go`: [https://github.com/kubernetes/minikube/blob/master/vendor/github.com/docker/machine/libmachine/provision/boot2docker.go#L220](https://github.com/kubernetes/minikube/blob/master/vendor/github.com/docker/machine/libmachine/provision/boot2docker.go#L220) |
44 |
| - |
45 |
| - ```shell |
46 |
| - git add vendor/ |
47 |
| - git commit -m "Adding dependency foo" |
48 |
| - git add --all |
49 |
| - git commit -m "Adding cool feature" |
50 |
| - ``` |
| 6 | +If you are introducing a large dependency change, please commit the vendor/ directory changes separately. |
| 7 | +This makes review easier in GitHub. |
0 commit comments