sh: verify operator code generation
Signed-off-by: jwcesign <jwcesign@gmail.com>
This commit is contained in:
parent
bb1d2e8f6f
commit
6e79a57255
|
@ -10,6 +10,8 @@ DIFFROOT="${SCRIPT_ROOT}/pkg"
|
||||||
TMP_DIFFROOT="${SCRIPT_ROOT}/_tmp/pkg"
|
TMP_DIFFROOT="${SCRIPT_ROOT}/_tmp/pkg"
|
||||||
DIFFEXAMPLES="${SCRIPT_ROOT}/examples/customresourceinterpreter/apis"
|
DIFFEXAMPLES="${SCRIPT_ROOT}/examples/customresourceinterpreter/apis"
|
||||||
TMP_DIFFEXAMPLES="${SCRIPT_ROOT}/_tmp/examples/customresourceinterpreter/apis"
|
TMP_DIFFEXAMPLES="${SCRIPT_ROOT}/_tmp/examples/customresourceinterpreter/apis"
|
||||||
|
DIFFOPERATOR="${SCRIPT_ROOT}/operator/pkg/apis/operator"
|
||||||
|
TMP_DIFFOPERATOR="${SCRIPT_ROOT}/_tmp/operator/pkg/apis/operator"
|
||||||
_tmp="${SCRIPT_ROOT}/_tmp"
|
_tmp="${SCRIPT_ROOT}/_tmp"
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
|
@ -25,6 +27,9 @@ cp -a "${DIFFROOT}"/* "${TMP_DIFFROOT}"
|
||||||
mkdir -p "${TMP_DIFFEXAMPLES}"
|
mkdir -p "${TMP_DIFFEXAMPLES}"
|
||||||
cp -a "${DIFFEXAMPLES}"/* "${TMP_DIFFEXAMPLES}"
|
cp -a "${DIFFEXAMPLES}"/* "${TMP_DIFFEXAMPLES}"
|
||||||
|
|
||||||
|
mkdir -p "${TMP_DIFFOPERATOR}"
|
||||||
|
cp -a "${DIFFOPERATOR}"/* "${TMP_DIFFOPERATOR}"
|
||||||
|
|
||||||
bash "${SCRIPT_ROOT}/hack/update-codegen.sh"
|
bash "${SCRIPT_ROOT}/hack/update-codegen.sh"
|
||||||
echo "diffing ${DIFFROOT} against freshly generated codegen"
|
echo "diffing ${DIFFROOT} against freshly generated codegen"
|
||||||
ret=0
|
ret=0
|
||||||
|
@ -49,3 +54,15 @@ else
|
||||||
echo "${DIFFEXAMPLES} is out of date. Please run hack/update-codegen.sh"
|
echo "${DIFFEXAMPLES} is out of date. Please run hack/update-codegen.sh"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "diffing ${DIFFOPERATOR} against freshly generated codegen"
|
||||||
|
ret=0
|
||||||
|
diff -Naupr "${DIFFOPERATOR}" "${TMP_DIFFOPERATOR}" || ret=$?
|
||||||
|
cp -a "${TMP_DIFFOPERATOR}"/* "${DIFFOPERATOR}"
|
||||||
|
if [[ $ret -eq 0 ]]
|
||||||
|
then
|
||||||
|
echo "${DIFFOPERATOR} up to date."
|
||||||
|
else
|
||||||
|
echo "${DIFFOPERATOR} is out of date. Please run hack/update-codegen.sh"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue