Merge pull request #22429 from wojtek-t/fix_update_codecgen

Auto commit by PR queue bot
pull/6/head
k8s-merge-robot 2016-03-04 02:29:33 -08:00
commit 18160741d4
1 changed files with 10 additions and 1 deletions

View File

@ -32,12 +32,21 @@ generated_files=($(
-o -wholename './target' \
-o -wholename '*/third_party/*' \
-o -wholename '*/Godeps/*' \
-o -wholename '*/codecgen-*-1234.generated.go' \
\) -prune \
\) -name '*.generated.go'))
# Build codecgen binary from Godeps.
# Register function to be called on EXIT to remove codecgen
# binary and also to touch the files that should be regenerated
# since they are first removed.
# This is necessary to make the script work after previous failure.
function cleanup {
rm -f "${CODECGEN:-}"
pushd "${KUBE_ROOT}" > /dev/null
for (( i=0; i < number; i++ )); do
touch "${generated_files[${i}]}" || true
done
popd > /dev/null
}
trap cleanup EXIT