From 63efb06f61acc8c68389d4ec8f2391a4c07cf7a6 Mon Sep 17 00:00:00 2001 From: Martin Schuppert Date: Thu, 12 Dec 2024 12:17:13 +0100 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. Signed-off-by: Martin Schuppert --- 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 c431ae50..3a252acd 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