Initialize global variable MINION_IPS in setClusterInfo function

Initialize global variable MINION_IPS in setClusterInfo function.
MINION_IPS is defined as a global variable, and is concatenated with other nodeIP.
When setClusterInfo is called for many times, this could cause potential problems.
Such as, you will have MINION_IPS=192.168.0.2,192.168.0.3,192.168.0.2,192.168.0.3 which is obviously wrong.

Update util.sh
pull/6/head
qiaolei 2015-07-31 21:13:28 +08:00 committed by root
parent d04fce045e
commit 2fd47194bd
1 changed files with 6 additions and 0 deletions

View File

@ -37,6 +37,12 @@ function test-build-release {
# From user input set the necessary k8s and etcd configuration infomation # From user input set the necessary k8s and etcd configuration infomation
function setClusterInfo() { function setClusterInfo() {
# Initialize MINION_IPS in setClusterInfo function
# MINION_IPS is defined as a global variable, and is concatenated with other nodeIP
# When setClusterInfo is called for many times, this could cause potential problems
# Such as, you will have MINION_IPS=192.168.0.2,192.168.0.3,192.168.0.2,192.168.0.3 which is obviously wrong
MINION_IPS=""
ii=0 ii=0
for i in $nodes for i in $nodes
do do