include-system-upgrade-in-kubeconform-validation #203
@@ -65,7 +65,9 @@ jobs:
|
||||
echo "=== Validating: $file ==="
|
||||
DOC_COUNT=$(yq eval-all '...' "$file" | grep -c '^---')
|
||||
for i in $(seq 0 $((DOC_COUNT - 1))); do
|
||||
KIND=$(yq eval-all ".[$i].kind // \"\"" "$file")
|
||||
TMP_DOC="/tmp/doc_${i}_$$.yaml"
|
||||
yq eval-all ".[$i]" "$file" > "$TMP_DOC"
|
||||
KIND=$(yq eval ".kind // \"\"" "$TMP_DOC")
|
||||
if [[ -n "$KIND" && -n "${SCHEMA_MAP[$KIND]}" ]]; then
|
||||
echo "Found $KIND in document $i - using custom schema"
|
||||
SCHEMA_URL="https://raw.githubusercontent.com/datreeio/CRDs-catalog/refs/heads/main/${SCHEMA_MAP[$KIND]}"
|
||||
@@ -73,7 +75,7 @@ jobs:
|
||||
-schema-location "$SCHEMA_URL" \
|
||||
-cache "$KUBECONFORM_CACHE_DIR" \
|
||||
-output json \
|
||||
"$file"; then
|
||||
"$TMP_DOC"; then
|
||||
EXIT_CODE=1
|
||||
fi
|
||||
else
|
||||
@@ -82,10 +84,11 @@ jobs:
|
||||
-schema-location default \
|
||||
-cache "$KUBECONFORM_CACHE_DIR" \
|
||||
-output json \
|
||||
"$file"; then
|
||||
"$TMP_DOC"; then
|
||||
EXIT_CODE=1
|
||||
fi
|
||||
fi
|
||||
rm -f "$TMP_DOC"
|
||||
done
|
||||
echo ""
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user