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
4eeebf76
Commit
4eeebf76
authored
Sep 21, 2016
by
Daniel Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make verify godeps help you fix your problems
parent
ca00e596
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
43 deletions
+67
-43
verify-godeps.sh
hack/verify-godeps.sh
+67
-43
No files found.
hack/verify-godeps.sh
View file @
4eeebf76
...
...
@@ -52,9 +52,14 @@ fi
# Create a nice clean place to put our new godeps
_tmpdir
=
"
$(
mktemp
-d
-t
gopath.XXXXXX
)
"
KEEP_TMP
=
false
function
cleanup
{
echo
"Removing
${
_tmpdir
}
"
rm
-rf
"
${
_tmpdir
}
"
if
[
"
${
KEEP_TMP
}
"
==
"true"
]
;
then
echo
"Leaving
${
_tmpdir
}
for you to examine or copy. Please delete it manually when finished. (rm -rf
${
_tmpdir
}
)"
else
echo
"Removing
${
_tmpdir
}
"
rm
-rf
"
${
_tmpdir
}
"
fi
}
trap
cleanup EXIT
...
...
@@ -67,48 +72,67 @@ _kubetmp="${_kubetmp}/kubernetes"
# Do all our work in the new GOPATH
export
GOPATH
=
"
${
_tmpdir
}
"
cd
"
${
_kubetmp
}
"
# Build the godep tool
go get
-u
github.com/tools/godep 2>/dev/null
GODEP
=
"
${
GOPATH
}
/bin/godep"
pin-godep
()
{
pushd
"
${
GOPATH
}
/src/github.com/tools/godep"
>
/dev/null
git checkout
"
$1
"
"
${
GODEP
}
"
go
install
popd
>
/dev/null
}
# Use to following if we ever need to pin godep to a specific version again
#pin-godep 'v63'
# Fill out that nice clean place with the kube godeps
echo
"Starting to download all kubernetes godeps. This takes a while"
"
${
GODEP
}
"
restore
echo
"Download finished"
# Destroy deps in the copy of the kube tree
rm
-rf
./Godeps ./vendor
# For some reason the kube tree needs to be a git repo for the godep tool to
# run. Doesn't make sense.
git init
>
/dev/null 2>&1
# Recreate the Godeps using the nice clean set we just downloaded
hack/godep-save.sh
# Test for diffs
if
!
_out
=
"
$(
diff
-Naupr
--ignore-matching-lines
=
'^\s*\"GoVersion\":'
--ignore-matching-line
=
'^\s*\"GodepVersion\":'
--ignore-matching-lines
=
'^\s*\"Comment\":'
${
KUBE_ROOT
}
/Godeps/Godeps.json
${
_kubetmp
}
/Godeps/Godeps.json
)
"
;
then
echo
"Your Godeps.json is different:"
echo
"
${
_out
}
"
echo
"Godeps Verify failed."
exit
1
fi
if
!
_out
=
"
$(
diff
-Naupr
${
KUBE_ROOT
}
/vendor
${
_kubetmp
}
/vendor
)
"
;
then
echo
"Your vendored results are different:"
echo
"
${
_out
}
"
echo
"Godeps Verify failed."
exit
1
pushd
"
${
_kubetmp
}
"
2>&1
>
/dev/null
# Build the godep tool
go get
-u
github.com/tools/godep 2>/dev/null
GODEP
=
"
${
GOPATH
}
/bin/godep"
pin-godep
()
{
pushd
"
${
GOPATH
}
/src/github.com/tools/godep"
>
/dev/null
git checkout
"
$1
"
"
${
GODEP
}
"
go
install
popd
>
/dev/null
}
# Use to following if we ever need to pin godep to a specific version again
#pin-godep 'v63'
# Fill out that nice clean place with the kube godeps
echo
"Starting to download all kubernetes godeps. This takes a while"
"
${
GODEP
}
"
restore
echo
"Download finished"
# Destroy deps in the copy of the kube tree
rm
-rf
./Godeps ./vendor
# For some reason the kube tree needs to be a git repo for the godep tool to
# run. Doesn't make sense.
git init
>
/dev/null 2>&1
# Recreate the Godeps using the nice clean set we just downloaded
hack/godep-save.sh
popd
2>&1
>
/dev/null
ret
=
0
pushd
"
${
KUBE_ROOT
}
"
2>&1
>
/dev/null
# Test for diffs
if
!
_out
=
"
$(
diff
-Naupr
--ignore-matching-lines
=
'^\s*\"GoVersion\":'
--ignore-matching-line
=
'^\s*\"GodepVersion\":'
--ignore-matching-lines
=
'^\s*\"Comment\":'
Godeps/Godeps.json
${
_kubetmp
}
/Godeps/Godeps.json
)
"
;
then
echo
"Your Godeps.json is different:"
echo
"
${
_out
}
"
echo
"Godeps Verify failed."
echo
"
${
_out
}
"
>
godepdiff.patch
echo
"If you're seeing this locally, run the below command to fix your Godeps.json:"
echo
"patch -p0 < godepdiff.patch"
echo
"(The above output can be saved as godepdiff.patch if you're not running this locally)"
KEEP_TMP
=
true
ret
=
1
fi
if
!
_out
=
"
$(
diff
-Naupr
vendor
${
_kubetmp
}
/vendor
)
"
;
then
echo
"Your vendored results are different:"
echo
"
${
_out
}
"
echo
"Godeps Verify failed."
echo
"
${
_out
}
"
>
vendordiff.patch
echo
"If you're seeing this locally, run the below command to fix your directories:"
echo
"patch -p0 < vendordiff.patch"
echo
"(The above output can be saved as godepdiff.patch if you're not running this locally)"
KEEP_TMP
=
true
ret
=
1
fi
popd
2>&1
>
/dev/null
if
[[
${
ret
}
>
0
]]
;
then
exit
${
ret
}
fi
echo
"Godeps Verified."
...
...
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