Merge pull request #76084 from SataQiu/fix-shell-20190403

Fix shellcheck failures of test/images/pets/redis-installer/on-start.sh
k3s-v1.15.3
Kubernetes Prow Robot 2019-04-12 15:56:32 -07:00 committed by GitHub
commit 969c1106f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 2 deletions

View File

@ -88,7 +88,6 @@
./test/e2e_node/environment/setup_host.sh
./test/e2e_node/gubernator.sh
./test/images/image-util.sh
./test/images/pets/redis-installer/on-start.sh
./test/images/pets/zookeeper-installer/install.sh
./test/images/pets/zookeeper-installer/on-start.sh
./test/images/volume/gluster/run_gluster.sh

View File

@ -27,7 +27,7 @@ PORT=6379
while read -ra LINE; do
if [[ "${LINE}" == *"${HOSTNAME}"* ]]; then
sed -i -e "s|^bind.*$|bind ${LINE}|" ${CFG}
elif [ "$(/opt/redis/redis-cli -h $LINE info | grep role | sed 's,\r$,,')" = "role:master" ]; then
elif [ "$(/opt/redis/redis-cli -h "${LINE}" info | grep role | sed 's,\r$,,')" = "role:master" ]; then
# TODO: More restrictive regex?
sed -i -e "s|^# slaveof.*$|slaveof ${LINE} ${PORT}|" ${CFG}
fi