diff --git a/hack/verify-openapi-spec.sh b/hack/verify-openapi-spec.sh index 1c45d19addc..ac56cea1095 100755 --- a/hack/verify-openapi-spec.sh +++ b/hack/verify-openapi-spec.sh @@ -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."