mirror of https://github.com/kubernetes/kops.git
add 'how to add new dependencies' to development docs.
This commit is contained in:
parent
953b032608
commit
f38108ce7c
|
@ -21,6 +21,33 @@ See for example the discussion [here](https://github.com/dpw/vendetta/issues/13)
|
|||
* We have to manually manage our dependencies (this is arguably also an advantage, in the absence of any real rules to resolve conflicts)
|
||||
* `go get` will fetch the submodules, so we pull a lot more data than we need to
|
||||
|
||||
## Adding a dependency
|
||||
|
||||
1. Add dependency as a submodule in the `_vendor` directory.
|
||||
2. Make sure you have all the git submodules populated. If not you can run `git submodule init` and `git submodule update`.
|
||||
3. Run `make copydeps`.
|
||||
4. The make command should move the new dependency (and all other current dependencies) into the `vendor` folder, ignoring each submodules own `vendor` directory.
|
||||
5. Commit your changes.
|
||||
|
||||
Here is an example of us adding the `go-md2man` package and it's required dependencies:
|
||||
|
||||
```
|
||||
git submodule add https://github.com/cpuguy83/go-md2man.git _vendor/github.com/cpuguy83/go-md2man
|
||||
git submodule add https://github.com/russross/blackfriday.git _vendor/github.com/russross/blackfriday
|
||||
git submodule add https://github.com/shurcooL/sanitized_anchor_name.git _vendor/github.com/shurcooL/sanitized_anchor_name
|
||||
git submodule init
|
||||
git submodule update
|
||||
make copydeps
|
||||
git add .gitmodules
|
||||
git add _vendor/github.com/cpuguy83/go-md2man
|
||||
git add _vendor/github.com/russross/blackfriday
|
||||
git add _vendor/github.com/shurcooL/sanitized_anchor_name
|
||||
git add vendor/github.com/cpuguy83/go-md2man
|
||||
git add vendor/github.com/russross/blackfriday
|
||||
git add vendor/github.com/shurcooL/sanitized_anchor_name
|
||||
git commit -m "Added go-md2man, blackfriday and sanitized_anchor_name deps"
|
||||
```
|
||||
|
||||
## Updating a dependency
|
||||
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue