Skip to content

Commit

Permalink
crd-schema-check: allow new CRDs
Browse files Browse the repository at this point in the history
If the 'git show BASE_REF' fails assume it is a net new CRD and should be fine.

Signed-off-by: Martin Schuppert <[email protected]>
  • Loading branch information
stuggi committed Dec 12, 2024
1 parent 02b00af commit 63efb06
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions hack/crd-schema-checker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 63efb06

Please sign in to comment.