Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
915655a2
Commit
915655a2
authored
May 16, 2016
by
Tim Hockin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document godep updates better
`godep update` doesn't work. It just says 'nothing to update'. Drop it, and use The Big Hammer instead.
parent
835a2577
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
10 deletions
+28
-10
development.md
docs/devel/development.md
+28
-10
No files found.
docs/devel/development.md
View file @
915655a2
...
...
@@ -244,25 +244,46 @@ godep restore
4) Next, you can either add a new dependency or update an existing one.
To add a new dependency is simple (if a bit slow):
```
sh
# To add a new dependency, do:
cd
$KPATH
/src/k8s.io/kubernetes
godep get path/to/dependency
DEP
=
example.com/path/to/dependency
godep get
$DEP
/...
# Now change code in Kubernetes to use the dependency.
hack/godep-save.sh
./hack/godep-save.sh
```
To update an existing dependency is a bit more complicated. Godep has an
`update`
command, but none of us can figure out how to actually make it work.
Instead, this procedure seems to work reliably:
# To update an existing dependency, do:
```
sh
cd
$KPATH
/src/k8s.io/kubernetes
go get
-u
path/to/dependency
# Change code in Kubernetes accordingly if necessary.
godep update path/to/dependency
DEP
=
example.com/path/to/dependency
# NB: For the next step, $DEP is assumed be the repo root. If it is actually a
# subdir of the repo, use the repo root here. This is required to keep godep
# from getting angry because `godep restore` left the tree in a "detached head"
# state.
rm
-rf
$KPATH
/src/
$DEP
# repo root
godep get
$DEP
/...
# Change code in Kubernetes, if necessary.
rm
-rf
Godeps
rm
-rf
vendor
./hack/godep-save.sh
git co
--
$(
git st
-s
|
grep
"^ D"
|
awk
'{print $2}'
|
grep
^Godeps
)
```
_If
`go get -u path/to/dependency`
fails with compilation errors, instead try
`go get -d -u path/to/dependency`
to fetch the dependencies without compiling
them. This is unusual, but has been observed._
After all of this is done,
`git status`
should show you what files have been
modified and added/removed. Make sure to
`git add`
and
`git rm`
them. It is
commonly advised to make one
`git commit`
which includes just the dependency
update and Godeps files, and another
`git commit`
that includes changes to
Kubernetes code to use the new/updated dependency. These commits can go into a
single pull request.
5) Before sending your PR, it's a good idea to sanity check that your
Godeps.json file and the contents of
`vendor/ `
are ok by running
`hack/verify-godeps.sh`
...
...
@@ -276,9 +297,6 @@ It is sometimes expedient to manually fix the /Godeps/Godeps.json file to
minimize the changes. However without great care this can lead to failures
with
`hack/verify-godeps.sh`
. This must pass for every PR.
Please send dependency updates in separate commits within your PR, for easier
reviewing.
6) If you updated the Godeps, please also update
`Godeps/LICENSES`
by running
`hack/update-godep-licenses.sh`
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment