Generate conversions/deep-copies for experimental. Currently we make (and register) duplicate functions but this is benign.

This commit is contained in:
Muhammed Uluyol
2015-08-07 11:26:44 -07:00
parent 4d5899955e
commit 567bb15432
17 changed files with 661 additions and 127 deletions

View File

@@ -23,25 +23,31 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
kube::golang::setup_env
APIROOT="${KUBE_ROOT}/pkg/api"
TMP_APIROOT="${KUBE_ROOT}/_tmp/api"
APIROOTS=${APIROOTS:-pkg/api pkg/expapi}
_tmp="${KUBE_ROOT}/_tmp"
mkdir -p "${_tmp}"
cp -a "${APIROOT}" "${TMP_APIROOT}"
cleanup() {
rm -rf "${_tmp}"
}
trap "cleanup" EXIT SIGINT
for APIROOT in ${APIROOTS}; do
mkdir -p "${_tmp}/${APIROOT%/*}"
cp -a "${KUBE_ROOT}/${APIROOT}" "${_tmp}/${APIROOT}"
done
"${KUBE_ROOT}/hack/update-generated-conversions.sh"
echo "diffing ${APIROOT} against freshly generated conversions"
ret=0
diff -Naupr -I 'Auto generated by' "${APIROOT}" "${TMP_APIROOT}" || ret=$?
cp -a ${TMP_APIROOT} "${KUBE_ROOT}/pkg"
rm -rf "${_tmp}"
if [[ $ret -eq 0 ]]
then
echo "${APIROOT} up to date."
else
echo "${APIROOT} is out of date. Please run hack/update-generated-conversions.sh"
exit 1
fi
# ex: ts=2 sw=2 et filetype=sh
for APIROOT in ${APIROOTS}; do
TMP_APIROOT="${_tmp}/${APIROOT}"
echo "diffing ${APIROOT} against freshly generated conversions"
ret=0
diff -Naupr -I 'Auto generated by' "${KUBE_ROOT}/${APIROOT}" "${TMP_APIROOT}" || ret=$?
cp -a "${TMP_APIROOT}" "${KUBE_ROOT}/${APIROOT%/*}"
if [[ $ret -eq 0 ]]; then
echo "${APIROOT} up to date."
else
echo "${APIROOT} is out of date. Please run hack/update-generated-conversions.sh"
exit 1
fi
done