Skip to content

Commit

Permalink
Codegen: subprojects: clean up verify scripts
Browse files Browse the repository at this point in the history
They all run successfully.

Kubernetes-commit: 357bfbc43643c956782e1ca5b7923a20338fba29
  • Loading branch information
thockin authored and k8s-publishing-bot committed Mar 5, 2023
1 parent 0902075 commit 04f11f3
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions hack/verify-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ set -o errexit
set -o nounset
set -o pipefail

SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/..

SCRIPT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
DIFFROOT="${SCRIPT_ROOT}/pkg"
TMP_DIFFROOT="${SCRIPT_ROOT}/_tmp/pkg"
_tmp="${SCRIPT_ROOT}/_tmp"
TMP_DIFFROOT="$(mktemp -d -t "$(basename "$0").XXXXXX")/pkg"

cleanup() {
rm -rf "${_tmp}"
rm -rf "${TMP_DIFFROOT}"
}
trap "cleanup" EXIT SIGINT

Expand All @@ -38,9 +36,7 @@ cp -a "${DIFFROOT}"/* "${TMP_DIFFROOT}"
echo "diffing ${DIFFROOT} against freshly generated codegen"
ret=0
diff -Naupr "${DIFFROOT}" "${TMP_DIFFROOT}" || ret=$?
cp -a "${TMP_DIFFROOT}"/* "${DIFFROOT}"
if [[ $ret -eq 0 ]]
then
if [[ $ret -eq 0 ]]; then
echo "${DIFFROOT} up to date."
else
echo "${DIFFROOT} is out of date. Please run hack/update-codegen.sh"
Expand Down

0 comments on commit 04f11f3

Please sign in to comment.