Skip to content

Commit

Permalink
fix: upgrade error.
Browse files Browse the repository at this point in the history
  • Loading branch information
lework committed Dec 17, 2020
1 parent 4168cc9 commit 3232b56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kainstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ function script::upgrage_kube() {
echo '[upgrade]'
if [[ "$role" == "init" ]]; then
local plan_info; plan_info=$(kubeadm upgrade plan)
local v; v=$(printf "%s" "$plan_info" | grep 'kubeadm upgrade apply ' | awk '{print $4}')
local v; v=$(printf "%s" "$plan_info" | grep 'kubeadm upgrade apply ' | awk '{print $4}'| tail -1 )
printf "%s\n" "${plan_info}"
kubeadm upgrade apply "${v}" -y
else
Expand All @@ -849,7 +849,7 @@ function script::upgrage_kube() {

echo '[install] kubelet kubectl'
kubectl version --client=true
yum install -y "kubelet${version} kubectl${version}" --disableexcludes=kubernetes
yum install -y "kubelet${version}" "kubectl${version}" --disableexcludes=kubernetes
kubectl version --client=true

[ -f /usr/lib/systemd/system/kubelet.service.d/10-kubeadm.conf ] && \
Expand Down

0 comments on commit 3232b56

Please sign in to comment.