Adding a New Dependency
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.
- Make a clean GOPATH, with minikube in it. This isn't strictly necessary, but it usually helps.
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
- Install the package versions specified in Godeps/Godeps.json
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
go getyour new dependency.
go get mynewdepenency
Use it in code, build and test.
Import the dependency from GOPATH into vendor/
godep save ./...
NOTE: godep seems to have an issue with not recovering files in
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
git add vendor/ git commit -m "Adding dependency foo" git add --all git commit -m "Adding cool feature"