values-override file not found issue fixed 2
This commit is contained in:
parent
a623d5dcc9
commit
6b1ad34a73
@ -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"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user