Generate conversions/deep-copies for experimental. Currently we make (and register) duplicate functions but this is benign.
This commit is contained in:
@@ -25,25 +25,32 @@ kube::golang::setup_env
|
||||
|
||||
gendeepcopy=$(kube::util::find-binary "gendeepcopy")
|
||||
|
||||
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-deep-copies.sh"
|
||||
echo "diffing ${APIROOT} against freshly generated deep copies"
|
||||
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-deep-copies.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 deep copies"
|
||||
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-deep-copies.sh"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
Reference in New Issue
Block a user