From 6b1ad34a731facf700ff78542c036fd84728c937 Mon Sep 17 00:00:00 2001 From: Vaibhav Pathak Date: Wed, 18 Feb 2026 12:02:02 +0530 Subject: [PATCH] values-override file not found issue fixed 2 --- .../workflow-template.yaml | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/environment-provisioner/workflow-template.yaml b/environment-provisioner/workflow-template.yaml index 0efbbe3..cfac1fc 100644 --- a/environment-provisioner/workflow-template.yaml +++ b/environment-provisioner/workflow-template.yaml @@ -438,15 +438,25 @@ spec: # Insert inline values block after valueFiles if user provided edited content if [ "$INCLUDE_INLINE_VALUES" = "yes" ]; then echo " Inserting edited values into Application manifest..." - # Create a temp file with the values block - VALUES_INDENT=" values: |" - INDENTED_CONTENT=$(echo "$EDITED_CONTENT" | sed 's/^/ /') - # Use awk to insert the values block after the valueFiles line - awk -v values_line="$VALUES_INDENT" -v content="$INDENTED_CONTENT" ' - /valueFiles:/ { print; getline; print; print values_line; print content; next } + # Write the values block to a temp file (preserves newlines properly) + VALUES_TMP="/tmp/values_block_$$.txt" + { + echo " values: |" + echo "$EDITED_CONTENT" | sed 's/^/ /' + } > "$VALUES_TMP" + # Use awk with getline to read from temp file (preserves multi-line content) + awk ' + /valueFiles:/ { + print + getline + print + while ((getline line < "'"$VALUES_TMP"'") > 0) print line + next + } { print } ' "manifests/$APP_NAME-application.yaml" > "manifests/$APP_NAME-application.yaml.tmp" mv "manifests/$APP_NAME-application.yaml.tmp" "manifests/$APP_NAME-application.yaml" + rm -f "$VALUES_TMP" fi echo " HTTPRoute URL: https://$HTTPROUTE_HOST"