Merge pull request #35841 from mbohlool/o2

Automatic merge from submit-queue

Update verify-openapi-spec script to check for extra generated spec

hack/verify-openapi-spec.sh only check for existing spec changes. If for some reason (here most probably I forgot to delete a file in api/openapi-spec folder in #35388 after a rebase) there is an old spec exists in the spec folder, it won't panic but it should. This resulted in an unused out of date v1.spec file in the api/openapi-spec folder that this PR also removes.
This commit is contained in:
Kubernetes Submit Queue 2016-11-01 23:15:16 -07:00 committed by GitHub
commit 46dc7e5244
2 changed files with 3 additions and 16251 deletions

File diff suppressed because it is too large Load Diff

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."