From 62de445592b28f85fbdd4255d6cc6ce5b67949a1 Mon Sep 17 00:00:00 2001 From: Martin Schuppert Date: Thu, 12 Dec 2024 12:28:44 +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 c431ae5..3a252ac 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