Skip to content

Commit 5b434f6

Browse files
authored
DB Password JSON Encoding (#400)
* Update apply.sh * Update apply.sh
1 parent b4b1e60 commit 5b434f6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

infra/db/atp/apply.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ fi
6060
if ! test -f $MY_STATE/state_password_set; then
6161
DB_PASSWORD=$(get_secret $DB_PASSWORD_SECRET)
6262
umask 177
63-
echo '{"adminPassword": "'"$DB_PASSWORD"'"}' > temp_params
63+
echo '{"adminPassword": '`echo -n "$DB_PASSWORD" | jq -aRs .`'}' > temp_params
6464
umask 22
6565
oci db autonomous-database update --autonomous-database-id "$DB_OCID" --from-json "file://temp_params" >/dev/null
6666
rm temp_params

workshops/dcms-oci/config/threads/db/apply.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ if test "$(state_get RUN_TYPE)" == 'LL'; then
6464
if ! state_done ${db_upper}_PASSWORD_SET; then
6565
DB_PASSWORD=$(get_secret $(state_get DB_PASSWORD_SECRET))
6666
umask 177
67-
echo '{"adminPassword": "'"$DB_PASSWORD"'"}' > temp_params
67+
echo '{"adminPassword": '`echo -n "$DB_PASSWORD" | jq -aRs .`'}' > temp_params
6868
umask 22
6969
oci db autonomous-database update --autonomous-database-id "$(state_get ${db_upper}_OCID)" --from-json "file://temp_params" >/dev/null
7070
rm temp_params

0 commit comments

Comments
 (0)