summaryrefslogtreecommitdiffstats
path: root/kubernetes/common/cassandra/resources
diff options
context:
space:
mode:
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>2021-06-21 13:41:19 +0000
committerGerrit Code Review <gerrit@onap.org>2021-06-21 13:41:19 +0000
commit8e032164e936cd0d1ee22737eebeabfe9fda58c7 (patch)
tree67a249c57abed30adcb46aaba5fae8f8250aa5e5 /kubernetes/common/cassandra/resources
parent2f48550414136d6b638d7c05307d17b5361c9757 (diff)
parentf3454863133c2979f5091e6881cde3a496b2e12d (diff)
Merge "[COMMON] Fix ${!name} bashisms"
Diffstat (limited to 'kubernetes/common/cassandra/resources')
-rw-r--r--kubernetes/common/cassandra/resources/config/docker-entrypoint.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/kubernetes/common/cassandra/resources/config/docker-entrypoint.sh b/kubernetes/common/cassandra/resources/config/docker-entrypoint.sh
index 64c7daacbf..5f23a89867 100644
--- a/kubernetes/common/cassandra/resources/config/docker-entrypoint.sh
+++ b/kubernetes/common/cassandra/resources/config/docker-entrypoint.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+
set -e
# first arg is `-f` or `--some-option`
@@ -71,7 +72,8 @@ if [ "$1" = 'cassandra' ]; then
authenticator \
; do
var="CASSANDRA_${yaml^^}"
- val="${!var}"
+ # eval presents no security issue here because of limited possible values of var
+ eval val=\$$var
if [ "$val" ]; then
_sed-in-place "$CASSANDRA_CONFIG/cassandra.yaml" \
-r 's/^(# )?('"$yaml"':).*/\2 '"$val"'/'
@@ -80,7 +82,8 @@ if [ "$1" = 'cassandra' ]; then
for rackdc in dc rack; do
var="CASSANDRA_${rackdc^^}"
- val="${!var}"
+ # eval presents no security issue here because of limited possible values of var
+ eval val=\$$var
if [ "$val" ]; then
_sed-in-place "$CASSANDRA_CONFIG/cassandra-rackdc.properties" \
-r 's/^('"$rackdc"'=).*/\1 '"$val"'/'