Skip to content

Commit

Permalink
fix: 在没有创建集群context下运行easzctl add-node 成功,结果却显示失败
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmzj committed May 8, 2019
1 parent 6b7d34c commit c7606db
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tools/easzctl
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ function add-node() {

# save current cluster context if needed
[ -f "$BASEPATH/.cluster/current_cluster" ] && save_context
return 0
}

function add-master() {
Expand All @@ -102,6 +103,7 @@ function add-master() {

# save current cluster context if needed
[ -f "$BASEPATH/.cluster/current_cluster" ] && save_context
return 0
}

function add-etcd() {
Expand All @@ -127,6 +129,7 @@ function add-etcd() {

# save current cluster context if needed
[ -f "$BASEPATH/.cluster/current_cluster" ] && save_context
return 0
}

function del-etcd() {
Expand All @@ -141,6 +144,7 @@ function del-etcd() {

# save current cluster context if needed
[ -f "$BASEPATH/.cluster/current_cluster" ] && save_context
return 0
}

function clean-node() {
Expand All @@ -152,6 +156,7 @@ function clean-node() {

# save current cluster context if needed
[ -f "$BASEPATH/.cluster/current_cluster" ] && save_context
return 0
}

function upgrade() {
Expand All @@ -160,6 +165,7 @@ function upgrade() {
! (read -t5 -n1 ANS) || { echo "[WARN] upgrade aborted"; return 1; }
ansible-playbook -t upgrade_k8s $BASEPATH/22.upgrade.yml || return 1
[ -f "$BASEPATH/.cluster/current_cluster" ] && save_context
return 0
}
### cluster-wide operation functions ############################

Expand Down Expand Up @@ -348,6 +354,9 @@ function basic-auth(){
elif [[ $ENABLED == no ]];then
echo -e "\n[INFO]basic-auth for apiserver is disabled!\n"
fi
# save current cluster context if needed
[ -f "$BASEPATH/.cluster/current_cluster" ] && save_context
return 0
}

### Main Lines ##################################################
Expand Down

0 comments on commit c7606db

Please sign in to comment.