Skip to content

Commit

Permalink
Update vendoring documentation for go modules
Browse files Browse the repository at this point in the history
  • Loading branch information
rifelpet committed Nov 17, 2019
1 parent 8c3c493 commit 4797189
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions docs/development/vendoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,26 @@ update commands:
* [go mod](https://github.com/golang/go/wiki/Modules) for kops 1.15 and newer branches (including master)
* [hg](https://www.mercurial-scm.org/wiki/Download)

<!-- TODO: update dependency management for go mod -->

## Adding a dependency to the vendor directory

The `dep` tool will manage required dependencies based on the imports
Go modules will manage required dependencies based on the imports
found in the source code. Follow these steps to run the update process:

1. Add the desired import to a `.go` file.
1. Run `make dep-ensure` to start the update process. If this step is
2. Run `make gomod` to start the update process. If this step is
successful, the imported dependency will be added to the `vendor`
subdirectory.
1. Commit any changes, including changes to the `vendor` directory,
`Gopkg.lock` and `Gopkg.toml`.
`go.mod`, and `go.sum`.
1. Open a pull request with these changes separately from other work
so that it is easier to review.

## Updating a dependency in the vendor directory (e.g. aws-sdk-go)

1. Update the locked version as specified in Gopkg.toml
1. Run `make dep-ensure`.
1. Review the changes to ensure that they are as intended / trustworthy.
1. Commit any changes, including changes to the `vendor` directory,
`Gopkg.lock` and `Gopkg.toml`.
1. Update the locked version as specified in `go.mod`
2. Run `make gomod`.
3. Review the changes to ensure that they are as intended / trustworthy.
4. Commit any changes, including changes to the `vendor` directory,
`go.mod` and `go.sum`.
1. Open a pull request with these changes separately from other work so that it
is easier to review. Please include any significant changes you observed.

0 comments on commit 4797189

Please sign in to comment.