values-override file not found issue fixed 1

This commit is contained in:
Vaibhav Pathak 2026-02-18 11:46:44 +05:30
parent 29a7ffc505
commit a623d5dcc9

View File

@ -352,15 +352,11 @@ spec:
HTTPROUTE_HOST="${SANITIZED_SERVICE}-${NAMESPACE}.${INGRESS_DOMAIN}"
echo " HTTPRoute hostname: $HTTPROUTE_HOST"
# Build inline values block if user provided edited content
INLINE_VALUES=""
# Check if user provided edited values content
INCLUDE_INLINE_VALUES=""
if [ -n "$EDITED_CONTENT" ] && [ "$EDITED_CONTENT" != "null" ]; then
echo " User edited values content detected, embedding as inline values..."
# Indent the content for YAML embedding (16 spaces = nested under helm.values)
INDENTED_CONTENT=$(echo "$EDITED_CONTENT" | sed 's/^/ /')
INLINE_VALUES="
values: |
$INDENTED_CONTENT"
echo " User edited values content detected, will embed as inline values..."
INCLUDE_INLINE_VALUES="yes"
fi
# Process external params for disabled Helm dependencies (e.g., external database config)
@ -400,7 +396,7 @@ $INDENTED_CONTENT"
path: $HELM_PATH
helm:
valueFiles:
- $HELM_VALUES$INLINE_VALUES
- $HELM_VALUES
parameters:
- name: mysql.enabled
value: "$MYSQL_ENABLED"
@ -438,6 +434,21 @@ $INDENTED_CONTENT"
- CreateNamespace=false
- ServerSideApply=true
EOF
# 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 }
{ print }
' "manifests/$APP_NAME-application.yaml" > "manifests/$APP_NAME-application.yaml.tmp"
mv "manifests/$APP_NAME-application.yaml.tmp" "manifests/$APP_NAME-application.yaml"
fi
echo " HTTPRoute URL: https://$HTTPROUTE_HOST"
else
# No Helm chart - create simple deployment manifest