Merge pull request #76115 from SataQiu/fix-shell-20190404

Fix shellcheck failures of zookeeper-installer/install.sh, etc
k3s-v1.15.3
Kubernetes Prow Robot 2019-04-13 21:20:01 -07:00 committed by GitHub
commit 56817f2543
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 8 deletions

View File

@ -85,8 +85,6 @@
./test/e2e_node/environment/setup_host.sh
./test/e2e_node/gubernator.sh
./test/images/image-util.sh
./test/images/pets/zookeeper-installer/install.sh
./test/images/pets/zookeeper-installer/on-start.sh
./test/images/volume/gluster/run_gluster.sh
./test/images/volume/iscsi/create_block.sh
./test/images/volume/nfs/run_nfs.sh

View File

@ -55,10 +55,10 @@ cp "${INSTALL_VOLUME}"/zookeeper/conf/zoo_sample.cfg "${INSTALL_VOLUME}"/zookeep
# TODO: Should dynamic config be tied to the version?
IFS="." read -ra RELEASE <<< "${VERSION}"
if [ $(expr "${RELEASE[1]}") -gt 4 ]; then
if [ "$(("${RELEASE[1]}"))" -gt 4 ]; then
echo zookeeper-"${VERSION}" supports dynamic reconfiguration, enabling it
echo "standaloneEnabled=false" >> "${INSTALL_VOLUME}"/zookeeper/conf/zoo.cfg
echo "dynamicConfigFile="${INSTALL_VOLUME}"/zookeeper/conf/zoo.cfg.dynamic" >> "${INSTALL_VOLUME}"/zookeeper/conf/zoo.cfg
echo "dynamicConfigFile=${INSTALL_VOLUME}/zookeeper/conf/zoo.cfg.dynamic" >> "${INSTALL_VOLUME}"/zookeeper/conf/zoo.cfg
fi
# TODO: This is a hack, netcat is convenient to have in the zookeeper container

View File

@ -36,7 +36,7 @@ MY_ID_FILE=/tmp/zookeeper/myid
HOSTNAME=$(hostname)
while read -ra LINE; do
PEERS=("${PEERS[@]}" $LINE)
PEERS=("${PEERS[@]}" "$LINE")
done
# Don't add the first member as an observer
@ -56,7 +56,7 @@ echo "" > "${CFG_BAK}"
i=0
LEADER=$HOSTNAME
for peer in "${PEERS[@]}"; do
let i=i+1
(( i=i+1 ))
if [[ "${peer}" == *"${HOSTNAME}"* ]]; then
MY_ID=$i
MY_NAME=${peer}
@ -94,10 +94,10 @@ ADD_SERVER="server.$MY_ID=$MY_NAME:2888:3888:participant;0.0.0.0:2181"
# Prove that we've actually joined the running cluster
ITERATION=0
until $(echo config | /opt/nc localhost 2181 | grep "${ADD_SERVER}" > /dev/null); do
until echo config | /opt/nc localhost 2181 | grep "${ADD_SERVER}" > /dev/null; do
echo $ITERATION] waiting for updated config to sync back to localhost
sleep 1
let ITERATION=ITERATION+1
(( ITERATION=ITERATION+1 ))
if [ $ITERATION -eq 20 ]; then
exit 1
fi