verify-openapi-spec.sh should not ignore extra file in the spec folder api/openapi-spec

This commit is contained in:
mbohlool 2016-10-28 17:02:10 -07:00
parent cc84673ebe
commit 034652b290

View File

@ -32,14 +32,15 @@ TMP_SPECROOT="${KUBE_ROOT}/_tmp/openapi-spec"
_tmp="${KUBE_ROOT}/_tmp"
mkdir -p "${_tmp}"
trap "rm -rf ${_tmp}" EXIT SIGINT
cp -a "${SPECROOT}" "${TMP_SPECROOT}"
trap "cp -a ${TMP_SPECROOT} ${SPECROOT}/..; rm -rf ${_tmp}" EXIT SIGINT
rm ${SPECROOT}/*
cp ${TMP_SPECROOT}/BUILD ${SPECROOT}/BUILD
"${KUBE_ROOT}/hack/update-openapi-spec.sh"
echo "diffing ${SPECROOT} against freshly generated openapi spec"
ret=0
diff -Naupr -I 'Auto generated by' "${SPECROOT}" "${TMP_SPECROOT}" || ret=$?
cp -a ${TMP_SPECROOT} "${KUBE_ROOT}/api"
if [[ $ret -eq 0 ]]
then
echo "${SPECROOT} up to date."