skip empty docs
Some checks failed
Validate Kubernetes Manifests / kubeconform (pull_request) Failing after 18s
Some checks failed
Validate Kubernetes Manifests / kubeconform (pull_request) Failing after 18s
This commit is contained in:
@@ -67,6 +67,11 @@ jobs:
|
|||||||
for i in $(seq 0 $((DOC_COUNT - 1))); do
|
for i in $(seq 0 $((DOC_COUNT - 1))); do
|
||||||
TMP_DOC="/tmp/doc_${i}_$$.yaml"
|
TMP_DOC="/tmp/doc_${i}_$$.yaml"
|
||||||
yq eval-all ".[$i]" "$file" > "$TMP_DOC"
|
yq eval-all ".[$i]" "$file" > "$TMP_DOC"
|
||||||
|
if [[ ! -s "$TMP_DOC" ]] || grep -q '^\s*$' "$TMP_DOC"; then
|
||||||
|
echo "Skipping empty or invalid document $i in $file"
|
||||||
|
rm -f "$TMP_DOC"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
KIND=$(yq eval ".kind // \"\"" "$TMP_DOC")
|
KIND=$(yq eval ".kind // \"\"" "$TMP_DOC")
|
||||||
if [[ -n "$KIND" && -n "${SCHEMA_MAP[$KIND]}" ]]; then
|
if [[ -n "$KIND" && -n "${SCHEMA_MAP[$KIND]}" ]]; then
|
||||||
echo "Found $KIND in document $i - using custom schema"
|
echo "Found $KIND in document $i - using custom schema"
|
||||||
|
|||||||
Reference in New Issue
Block a user