Skip to content

Commit 12246ef

Browse files
committed
refactor chart process logic
1 parent 53a0268 commit 12246ef

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

offline/tasks/patch-chart-images.sh

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ patch_file() {
109109

110110
echo "Scanning and patching files..."
111111

112-
# Process values.yaml files
112+
# Process all target files (values.yaml, Chart.yaml, templates/*.yaml)
113113
while IFS= read -r -d '' file; do
114114
file_count=$((file_count + 1))
115115
patch_file "$file" && rc=$? || rc=$?
@@ -118,29 +118,7 @@ while IFS= read -r -d '' file; do
118118
elif [[ $rc -eq 2 ]]; then
119119
skipped_count=$((skipped_count + 1))
120120
fi
121-
done < <(find "$CHARTS_DIR" -name "values.yaml" -print0)
122-
123-
# Process Chart.yaml files
124-
while IFS= read -r -d '' file; do
125-
file_count=$((file_count + 1))
126-
patch_file "$file" && rc=$? || rc=$?
127-
if [[ $rc -eq 0 ]]; then
128-
patched_count=$((patched_count + 1))
129-
elif [[ $rc -eq 2 ]]; then
130-
skipped_count=$((skipped_count + 1))
131-
fi
132-
done < <(find "$CHARTS_DIR" -name "Chart.yaml" -print0)
133-
134-
# Process template files (for direct image references)
135-
while IFS= read -r -d '' file; do
136-
file_count=$((file_count + 1))
137-
patch_file "$file" && rc=$? || rc=$?
138-
if [[ $rc -eq 0 ]]; then
139-
patched_count=$((patched_count + 1))
140-
elif [[ $rc -eq 2 ]]; then
141-
skipped_count=$((skipped_count + 1))
142-
fi
143-
done < <(find "$CHARTS_DIR" -path "*/templates/*.yaml" -print0)
121+
done < <(find "$CHARTS_DIR" \( -name "values.yaml" -o -name "Chart.yaml" -o -path "*/templates/*.yaml" \) -print0)
144122

145123
echo
146124
echo "=== Patching Summary ==="

0 commit comments

Comments
 (0)