mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Fix shellcheck failures SC2128
This commit is contained in:
parent
cce1f32ea5
commit
d467b8ea14
@ -10,12 +10,3 @@
|
||||
./cluster/gce/util.sh
|
||||
./cluster/log-dump/log-dump.sh
|
||||
./cluster/pre-existing/util.sh
|
||||
./test/cmd/apply.sh
|
||||
./test/cmd/apps.sh
|
||||
./test/cmd/core.sh
|
||||
./test/cmd/crd.sh
|
||||
./test/cmd/create.sh
|
||||
./test/cmd/generic-resources.sh
|
||||
./test/cmd/save-config.sh
|
||||
./test/images/pets/redis-installer/on-start.sh
|
||||
./test/images/pets/zookeeper-installer/on-start.sh
|
||||
|
@ -25,11 +25,11 @@ PORT=6379
|
||||
# Ping everyone but ourself to see if there's a master. Only one pet starts at
|
||||
# a time, so if we don't see a master we can assume the position is ours.
|
||||
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
|
||||
if [[ "${LINE[0]}" == *"${HOSTNAME}"* ]]; then
|
||||
sed -i -e "s|^bind.*$|bind ${LINE[0]}|" ${CFG}
|
||||
elif [ "$(/opt/redis/redis-cli -h "${LINE[0]}" info | grep role | sed 's,\r$,,')" = "role:master" ]; then
|
||||
# TODO: More restrictive regex?
|
||||
sed -i -e "s|^# slaveof.*$|slaveof ${LINE} ${PORT}|" ${CFG}
|
||||
sed -i -e "s|^# slaveof.*$|slaveof ${LINE[0]} ${PORT}|" ${CFG}
|
||||
fi
|
||||
done
|
||||
|
||||
|
@ -36,7 +36,7 @@ MY_ID_FILE=/tmp/zookeeper/myid
|
||||
HOSTNAME=$(hostname)
|
||||
|
||||
while read -ra LINE; do
|
||||
PEERS=("${PEERS[@]}" "$LINE")
|
||||
PEERS=("${PEERS[@]}" "${LINE[0]}")
|
||||
done
|
||||
|
||||
# Don't add the first member as an observer
|
||||
|
Loading…
Reference in New Issue
Block a user