fix: improve document counting in kubeconform validation
Some checks failed
Validate Kubernetes Manifests / kubeconform (pull_request) Has been cancelled
Some checks failed
Validate Kubernetes Manifests / kubeconform (pull_request) Has been cancelled
This commit is contained in:
@@ -63,9 +63,9 @@ jobs:
|
||||
for file in ${ALL_CHANGED_FILES}; do
|
||||
[ -z "$file" ] && continue
|
||||
echo "=== Validating: $file ==="
|
||||
DOC_COUNT=$(yq eval 'length' <(yq eval-all '.' "$file"))
|
||||
for i in $(seq 0 $((DOC_COUNT - 1))); do
|
||||
KIND=$(yq eval ".[$i].kind // \"\"" <(yq eval-all '.' "$file"))
|
||||
DOCS=$(yq eval-all '...' "$file" | wc -l)
|
||||
for i in $(seq 0 $((DOCS - 1))); do
|
||||
KIND=$(yq eval-all ".[$i].kind // \"\"" "$file")
|
||||
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]}"
|
||||
|
||||
Reference in New Issue
Block a user