Skip to content

Commit d735aaa

Browse files
committed
fix shellcheck failures of zookeeper-installer/install.sh zookeeper-installer/on-start.sh
1 parent 46ba211 commit d735aaa

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

hack/.shellcheck_failures

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@
8585
./test/e2e_node/environment/setup_host.sh
8686
./test/e2e_node/gubernator.sh
8787
./test/images/image-util.sh
88-
./test/images/pets/zookeeper-installer/install.sh
89-
./test/images/pets/zookeeper-installer/on-start.sh
9088
./test/images/volume/gluster/run_gluster.sh
9189
./test/images/volume/iscsi/create_block.sh
9290
./test/images/volume/nfs/run_nfs.sh

test/images/pets/zookeeper-installer/install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ cp "${INSTALL_VOLUME}"/zookeeper/conf/zoo_sample.cfg "${INSTALL_VOLUME}"/zookeep
5555

5656
# TODO: Should dynamic config be tied to the version?
5757
IFS="." read -ra RELEASE <<< "${VERSION}"
58-
if [ $(expr "${RELEASE[1]}") -gt 4 ]; then
58+
if [ "$(("${RELEASE[1]}"))" -gt 4 ]; then
5959
echo zookeeper-"${VERSION}" supports dynamic reconfiguration, enabling it
6060
echo "standaloneEnabled=false" >> "${INSTALL_VOLUME}"/zookeeper/conf/zoo.cfg
61-
echo "dynamicConfigFile="${INSTALL_VOLUME}"/zookeeper/conf/zoo.cfg.dynamic" >> "${INSTALL_VOLUME}"/zookeeper/conf/zoo.cfg
61+
echo "dynamicConfigFile=${INSTALL_VOLUME}/zookeeper/conf/zoo.cfg.dynamic" >> "${INSTALL_VOLUME}"/zookeeper/conf/zoo.cfg
6262
fi
6363

6464
# TODO: This is a hack, netcat is convenient to have in the zookeeper container

test/images/pets/zookeeper-installer/on-start.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ MY_ID_FILE=/tmp/zookeeper/myid
3636
HOSTNAME=$(hostname)
3737

3838
while read -ra LINE; do
39-
PEERS=("${PEERS[@]}" $LINE)
39+
PEERS=("${PEERS[@]}" "$LINE")
4040
done
4141

4242
# Don't add the first member as an observer
@@ -56,7 +56,7 @@ echo "" > "${CFG_BAK}"
5656
i=0
5757
LEADER=$HOSTNAME
5858
for peer in "${PEERS[@]}"; do
59-
let i=i+1
59+
(( i=i+1 ))
6060
if [[ "${peer}" == *"${HOSTNAME}"* ]]; then
6161
MY_ID=$i
6262
MY_NAME=${peer}
@@ -94,10 +94,10 @@ ADD_SERVER="server.$MY_ID=$MY_NAME:2888:3888:participant;0.0.0.0:2181"
9494

9595
# Prove that we've actually joined the running cluster
9696
ITERATION=0
97-
until $(echo config | /opt/nc localhost 2181 | grep "${ADD_SERVER}" > /dev/null); do
97+
until echo config | /opt/nc localhost 2181 | grep "${ADD_SERVER}" > /dev/null; do
9898
echo $ITERATION] waiting for updated config to sync back to localhost
9999
sleep 1
100-
let ITERATION=ITERATION+1
100+
(( ITERATION=ITERATION+1 ))
101101
if [ $ITERATION -eq 20 ]; then
102102
exit 1
103103
fi

0 commit comments

Comments
 (0)