summaryrefslogtreecommitdiffstats
path: root/kubernetes/common
diff options
context:
space:
mode:
authorKrzysztof Opasiak <k.opasiak@samsung.com>2021-08-31 12:47:38 +0000
committerGerrit Code Review <gerrit@onap.org>2021-08-31 12:47:38 +0000
commit80bafb66fc08fc0dafe063eb14f12d9063491a9f (patch)
tree2561fd256f1fde257ccf6454d74317a15bb17323 /kubernetes/common
parenta816817257ca0445b80bb0f3ebd74ea6f60716ea (diff)
parent05c791d5db91bef0cc62ec4393e3ceca5bff4755 (diff)
Merge "[COMMON] Fix ${p^^} bashisms"
Diffstat (limited to 'kubernetes/common')
-rw-r--r--kubernetes/common/cassandra/resources/config/docker-entrypoint.sh4
-rwxr-xr-xkubernetes/common/mariadb-init/resources/config/db_init.sh4
2 files changed, 4 insertions, 4 deletions
diff --git a/kubernetes/common/cassandra/resources/config/docker-entrypoint.sh b/kubernetes/common/cassandra/resources/config/docker-entrypoint.sh
index c01d7c6d57..2d30f2e068 100644
--- a/kubernetes/common/cassandra/resources/config/docker-entrypoint.sh
+++ b/kubernetes/common/cassandra/resources/config/docker-entrypoint.sh
@@ -71,7 +71,7 @@ if [ "$1" = 'cassandra' ]; then
start_rpc \
authenticator \
; do
- var="CASSANDRA_${yaml^^}"
+ var="CASSANDRA_$(echo $yaml | tr '[:lower:]' '[:upper:]')"
# eval presents no security issue here because of limited possible values of var
eval val=\$$var
if [ "$val" ]; then
@@ -81,7 +81,7 @@ if [ "$1" = 'cassandra' ]; then
done
for rackdc in dc rack; do
- var="CASSANDRA_${rackdc^^}"
+ var="CASSANDRA_$(echo $rackdc | tr '[:lower:]' '[:upper:]')"
# eval presents no security issue here because of limited possible values of var
eval val=\$$var
if [ "$val" ]; then
diff --git a/kubernetes/common/mariadb-init/resources/config/db_init.sh b/kubernetes/common/mariadb-init/resources/config/db_init.sh
index f130bb5118..df7c336405 100755
--- a/kubernetes/common/mariadb-init/resources/config/db_init.sh
+++ b/kubernetes/common/mariadb-init/resources/config/db_init.sh
@@ -21,8 +21,8 @@
set -e
while read DB ; do
- USER_VAR="MYSQL_USER_${DB^^}"
- PASS_VAR="MYSQL_PASSWORD_${DB^^}"
+ USER_VAR="MYSQL_USER_$(echo $DB | tr '[:lower:]' '[:upper:]')"
+ PASS_VAR="MYSQL_PASSWORD_$(echo $DB | tr '[:lower:]' '[:upper:]')"
{{/*
# USER=${!USER_VAR}
# PASS=`echo -n ${!PASS_VAR} | sed -e "s/'/''/g"`