Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions validate-k9.sh
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,25 @@ validate_k9() {
:
fi

# Check for name field within pedigree.metadata or pedigree directly
if [[ "$line" =~ ^[[:space:]]+name[[:space:]]*= ]]; then
# Check for name field within pedigree.metadata or pedigree directly.
# Two patterns cover both multi-line and single-line pedigrees:
# 1. ^[[:space:]]+name[[:space:]]*= — the normal multi-line case where
# `name = "..."` appears on its own indented line.
# 2. [[:space:]]name[[:space:]]*= — inline within a single-line
# pedigree assignment such as:
# pedigree = component_pedigree & { name = "foo" }
# (root cause: developer-ecosystem@baab1534 — single-line form
# was missed entirely because the pedigree block opened and
# closed in one line, never reaching the ^[[:space:]]+ check on
# a subsequent iteration.)
if [[ "$line" =~ ^[[:space:]]+name[[:space:]]*= ]] || \
[[ "$line" =~ [[:space:]]name[[:space:]]*= ]]; then
has_pedigree_name=true
fi

# Check for version field
if [[ "$line" =~ ^[[:space:]]+(version|schema_version)[[:space:]]*= ]]; then
if [[ "$line" =~ ^[[:space:]]+(version|schema_version)[[:space:]]*= ]] || \
[[ "$line" =~ [[:space:]](version|schema_version)[[:space:]]*= ]]; then
has_pedigree_version=true
fi

Expand Down
Loading