Enforce the use of the correct kubectl client version
Webhook integration with Openstack requires to match the same version as the server. This enhancement allows user to select a specific support version, or use the latest version, if desire to install. Change-Id: Ifdfb140b1c76216410bb64f648957a4fa25981fa
This commit is contained in:
parent
48bb08ff94
commit
a064ce4523
@ -5,7 +5,7 @@
|
|||||||
# settings to remotely connect to K8S cluster through Keystone authentication mechanism.
|
# settings to remotely connect to K8S cluster through Keystone authentication mechanism.
|
||||||
|
|
||||||
|
|
||||||
if [[ ${#} -lt 2 ]] ; then
|
if [[ ${#} -ne 3 ]] ; then
|
||||||
echo "Abort - Usage $0 <SITE NAME> <USER_ID> <NAMESPACE>"
|
echo "Abort - Usage $0 <SITE NAME> <USER_ID> <NAMESPACE>"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -27,11 +27,18 @@ function _addSourceList() {
|
|||||||
|
|
||||||
# Install dependencies once
|
# Install dependencies once
|
||||||
function _installDep () {
|
function _installDep () {
|
||||||
|
|
||||||
# kubectl
|
# kubectl
|
||||||
if [[ $1 == 'kubectl' ]] ; then
|
if [[ $1 == 'kubectl' ]] ; then
|
||||||
echo "Installing [${1}] dependency required..."
|
echo "Installing [${1}] dependency required..."
|
||||||
apt-get install -y kubectl
|
read -p "Enter kubectl version in the form of vX.X.X or enter '1' to install latest:" KUBECTL_VERSION
|
||||||
|
|
||||||
|
if [ "$KUBECTL_VERSION" != "1" ]; then
|
||||||
|
curl -SL https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl \
|
||||||
|
-o /usr/bin/kubectl
|
||||||
|
chmod +x /usr/bin/kubectl
|
||||||
|
else
|
||||||
|
apt-get install -y kubectl
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user