Skip to content

Commit

Permalink
v0.27.5: escaping $ symbol in bash script
Browse files Browse the repository at this point in the history
  • Loading branch information
zaychenko-sergei committed Jul 1, 2024
1 parent e6f23a7 commit 1e0182e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion charts/kamu-api-server/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: kamu-api-server
description: API server component of the Kamu Compute Node
type: application
version: 0.27.4
version: 0.27.5
appVersion: "0.27.1"
home: https://kamu.dev
icon: https://www.kamu.dev/images/kamu_logo_icon_bg_square.png
Expand Down
24 changes: 12 additions & 12 deletions charts/kamu-api-server/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ data:
fetch-db-secret.sh: |
#!/bin/bash
if [ $# -ne 5 ]; then
echo "Usage: $0 <secret-name> <region> <db-host> <db-port> <db-name>"
if [ $$# -ne 5 ]; then
echo "Usage: $$0 <secret-name> <region> <db-host> <db-port> <db-name>"
exit 1
fi
SECRET_NAME="$1"
REGION="$2"
DB_HOST="$3"
DB_PORT="$4"
DB_NAME="$5"
SECRET_NAME="$$1"
REGION="$$2"
DB_HOST="$$3"
DB_PORT="$$4"
DB_NAME="$$5"
SECRET_STRING=$(aws secretsmanager get-secret-value --secret-id $SECRET_NAME --region $REGION --query SecretString --output text)
USERNAME=$(echo $SECRET_STRING | jq -r .username)
PASSWORD=$(echo $SECRET_STRING | jq -r .password)
SECRET_STRING=$$(aws secretsmanager get-secret-value --secret-id $$SECRET_NAME --region $$REGION --query SecretString --output text)
USERNAME=$$(echo $$SECRET_STRING | jq -r .username)
PASSWORD=$$(echo $$SECRET_STRING | jq -r .password)
export DB_CONNECTION_STRING="postgresql://${USERNAME}:${PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}"
export DB_CONNECTION_STRING="postgresql://$${USERNAME}:$${PASSWORD}@$${DB_HOST}:$${DB_PORT}/$${DB_NAME}"
exec "$@"
exec "$$@"

0 comments on commit 1e0182e

Please sign in to comment.