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
|
# 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..."
|
||||||
# Create a temp file with the values block
|
# Write the values block to a temp file (preserves newlines properly)
|
||||||
VALUES_INDENT=" values: |"
|
VALUES_TMP="/tmp/values_block_$$.txt"
|
||||||
INDENTED_CONTENT=$(echo "$EDITED_CONTENT" | sed 's/^/ /')
|
{
|
||||||
# Use awk to insert the values block after the valueFiles line
|
echo " values: |"
|
||||||
awk -v values_line="$VALUES_INDENT" -v content="$INDENTED_CONTENT" '
|
echo "$EDITED_CONTENT" | sed 's/^/ /'
|
||||||
/valueFiles:/ { print; getline; print; print values_line; print content; next }
|
} > "$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 }
|
{ print }
|
||||||
' "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"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo " HTTPRoute URL: https://$HTTPROUTE_HOST"
|
echo " HTTPRoute URL: https://$HTTPROUTE_HOST"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user