values-override debug

This commit is contained in:
Vaibhav Pathak 2026-02-18 12:09:12 +05:30
parent 6b1ad34a73
commit 6366d7c814

View File

@ -438,12 +438,27 @@ spec:
# Insert inline values block after valueFiles if user provided edited content # Insert inline values block after valueFiles if user provided edited content
if [ "$INCLUDE_INLINE_VALUES" = "yes" ]; then if [ "$INCLUDE_INLINE_VALUES" = "yes" ]; then
echo " Inserting edited values into Application manifest..." echo " Inserting edited values into Application manifest..."
# Debug: show what we're inserting
echo " DEBUG: EDITED_CONTENT length: ${#EDITED_CONTENT}"
echo " DEBUG: EDITED_CONTENT first 200 chars:"
echo "$EDITED_CONTENT" | head -c 200
echo ""
# Only insert if we have actual content
if [ -n "$EDITED_CONTENT" ]; then
# Write the values block to a temp file (preserves newlines properly) # Write the values block to a temp file (preserves newlines properly)
VALUES_TMP="/tmp/values_block_$$.txt" VALUES_TMP="/tmp/values_block_$$.txt"
{ {
echo " values: |" echo " values: |"
echo "$EDITED_CONTENT" | sed 's/^/ /' echo "$EDITED_CONTENT" | sed 's/^/ /'
} > "$VALUES_TMP" } > "$VALUES_TMP"
# Debug: show temp file content
echo " DEBUG: Temp file content:"
cat "$VALUES_TMP"
echo " DEBUG: End of temp file"
# Use awk with getline to read from temp file (preserves multi-line content) # Use awk with getline to read from temp file (preserves multi-line content)
awk ' awk '
/valueFiles:/ { /valueFiles:/ {
@ -457,6 +472,13 @@ spec:
' "manifests/$APP_NAME-application.yaml" > "manifests/$APP_NAME-application.yaml.tmp" ' "manifests/$APP_NAME-application.yaml" > "manifests/$APP_NAME-application.yaml.tmp"
mv "manifests/$APP_NAME-application.yaml.tmp" "manifests/$APP_NAME-application.yaml" mv "manifests/$APP_NAME-application.yaml.tmp" "manifests/$APP_NAME-application.yaml"
rm -f "$VALUES_TMP" rm -f "$VALUES_TMP"
# Debug: show generated manifest
echo " DEBUG: Generated manifest helm section:"
grep -A 30 "helm:" "manifests/$APP_NAME-application.yaml" || true
else
echo " WARNING: EDITED_CONTENT is empty, skipping inline values insertion"
fi
fi fi
echo " HTTPRoute URL: https://$HTTPROUTE_HOST" echo " HTTPRoute URL: https://$HTTPROUTE_HOST"