refactor(ci): convert CRD schema generator to uv inline script
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/kubeconform Pipeline failed

This commit is contained in:
2026-06-02 16:12:30 +10:00
parent 93581bfde2
commit fd7fc8f41b
2 changed files with 7 additions and 3 deletions
+6 -2
View File
@@ -1,9 +1,13 @@
#!/usr/bin/env python3 #!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.11"
# dependencies = ["pyyaml"]
# ///
""" """
Extract OpenAPI v3 schemas from CRD YAML on stdin and write JSON schema files Extract OpenAPI v3 schemas from CRD YAML on stdin and write JSON schema files
to the output directory for use with kubeconform. to the output directory for use with kubeconform.
Usage: kustomize build ... | python3 ci/generate-crd-schemas.py <output-dir> Usage: kustomize build ... | ci/generate-crd-schemas.py <output-dir>
""" """
import sys import sys
import json import json
+1 -1
View File
@@ -16,7 +16,7 @@ total=0
while IFS= read -r -d "" k; do while IFS= read -r -d "" k; do
dir="$(dirname "$k")" dir="$(dirname "$k")"
n=$(kustomize build --enable-helm "$dir" 2>/dev/null \ n=$(kustomize build --enable-helm "$dir" 2>/dev/null \
| python3 "$SCRIPT_DIR/generate-crd-schemas.py" "$OUTPUT_DIR") || continue | "$SCRIPT_DIR/generate-crd-schemas.py" "$OUTPUT_DIR") || continue
total=$((total + n)) total=$((total + n))
done < <(find apps/overlays clusters -name kustomization.yaml -print0 | sort -z) done < <(find apps/overlays clusters -name kustomization.yaml -print0 | sort -z)