-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
4 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,7 @@ | ||
#### Adding a New Dependency | ||
Minikube uses `Godep` to manage vendored dependencies. | ||
`Godep` can be a bit finnicky with a project with this many dependencies. | ||
Here is a rough set of steps that usually works to add a new dependency. | ||
Minikube uses `dep` to manage vendored dependencies. | ||
|
||
1. Make a clean GOPATH, with minikube in it. | ||
This isn't strictly necessary, but it usually helps. | ||
See the `dep` [documentation](https://golang.github.io/dep/docs/introduction.html) for installation and usage instructions. | ||
|
||
```shell | ||
mkdir -p $HOME/newgopath/src/k8s.io | ||
export GOPATH=$HOME/newgopath | ||
cd $HOME/newgopath/src/k8s.io | ||
git clone https://github.com/kubernetes/minikube.git | ||
cd minikube | ||
``` | ||
|
||
1. Install the package versions specified in Godeps/Godeps.json | ||
```shell | ||
godep restore ./... | ||
``` | ||
NOTE: If you encounter a HTTP 301 error, you may need to set the following: | ||
`git config --global http.https://gopkg.in.followRedirects true` | ||
|
||
1. `go get` your new dependency. | ||
```shell | ||
go get mynewdepenency | ||
``` | ||
|
||
1. Use it in code, build and test. | ||
|
||
1. Import the dependency from GOPATH into vendor/ | ||
```shell | ||
godep save ./... | ||
``` | ||
|
||
NOTE: godep seems to have an issue with not recovering files in `vendor/golang.org/x/sys/windows/` | ||
IF you plan on committing your updated dependencies, make sure not to remove these files in your commit | ||
|
||
|
||
If it is a large dependency, please commit the vendor/ directory changes separately. | ||
This makes review easier in GitHub. | ||
|
||
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) | ||
|
||
```shell | ||
git add vendor/ | ||
git commit -m "Adding dependency foo" | ||
git add --all | ||
git commit -m "Adding cool feature" | ||
``` | ||
If you are introducing a large dependency change, please commit the vendor/ directory changes separately. | ||
This makes review easier in GitHub. |