.
This commit is contained in:
parent
9f987e5fdf
commit
0501fe3b2e
16
update.sh
16
update.sh
@ -142,6 +142,7 @@ function install_tools(){
|
|||||||
echo "- kubectl"
|
echo "- kubectl"
|
||||||
echo "- helm"
|
echo "- helm"
|
||||||
echo "- stern"
|
echo "- stern"
|
||||||
|
echo "- virtctl"
|
||||||
if asktobreak; then
|
if asktobreak; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
@ -200,6 +201,21 @@ function install_tools(){
|
|||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
echo "---- virtctl ----"
|
||||||
|
if [[ -f stern ]]; then
|
||||||
|
VIRTCTL_CURRENT="$(./virtctl version --client 2> /dev/null| sed -n 's/.*GitVersion:"\(v[0-9]*\.[0-9]*\.[0-9]*\)".*/\1/p')"
|
||||||
|
else
|
||||||
|
VIRTCTL_CURRENT="N/A"
|
||||||
|
fi
|
||||||
|
VIRTCTL_STABLE="$(curl -Ls https://github.com/kubevirt/kubevirt/releases | egrep 'href="/kubevirt/kubevirt/releases/tag/v[0-9]+.[0-9]+.[0-9]+*\"' | head -n 1 | sed -n 's/.*tag\/\(v.*\)" data.*/\1/p')"
|
||||||
|
echo "Installed version: $VIRTCTL_CURRENT"
|
||||||
|
echo "Latest stable version: $VIRTCTL_STABLE"
|
||||||
|
if [[ "$VIRTCTL_CURRENT" != "$VIRTCTL_STABLE" ]]; then
|
||||||
|
echo "updating to $VIRTCTL_STABLE"
|
||||||
|
curl -Lo virtctl https://github.com/kubevirt/kubevirt/releases/download/$VIRTCTL_STABLE/virtctl-$VIRTCTL_STABLE-linux-amd64
|
||||||
|
chmod +x ./virtctl
|
||||||
|
fi
|
||||||
|
echo ""
|
||||||
set -e
|
set -e
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user