From a8ef410bbbeb0d44de01ba5c6a4d6ebc2d8a0f83 Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Mon, 2 Dec 2024 13:55:23 -0500 Subject: [PATCH] crd-schema-check: allow new CRDs If the 'git show BASE_REF' fails assume it is a net new CRD and should be fine. --- hack/crd-schema-checker.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hack/crd-schema-checker.sh b/hack/crd-schema-checker.sh index c431ae50b..3a252acd6 100755 --- a/hack/crd-schema-checker.sh +++ b/hack/crd-schema-checker.sh @@ -14,8 +14,9 @@ trap cleanup EXIT for crd in config/crd/bases/*.yaml; do mkdir -p "$(dirname "$TMP_DIR/$crd")" - git show "$BASE_REF:$crd" > "$TMP_DIR/$crd" - $CHECKER check-manifests \ - --existing-crd-filename="$TMP_DIR/$crd" \ - --new-crd-filename="$crd" + if git show "$BASE_REF:$crd" > "$TMP_DIR/$crd"; then + $CHECKER check-manifests \ + --existing-crd-filename="$TMP_DIR/$crd" \ + --new-crd-filename="$crd" + fi done