Fix logic for Cert usage
This commit is contained in:
parent
dae5ad67d9
commit
5c69e4ff09
10
update.sh
10
update.sh
|
@ -6,7 +6,6 @@ fi
|
||||||
|
|
||||||
if [ ! -z ${PLUGIN_KUBERNETES_TOKEN} ]; then
|
if [ ! -z ${PLUGIN_KUBERNETES_TOKEN} ]; then
|
||||||
KUBERNETES_TOKEN=$PLUGIN_KUBERNETES_TOKEN
|
KUBERNETES_TOKEN=$PLUGIN_KUBERNETES_TOKEN
|
||||||
kubectl config set-credentials default --token=${KUBERNETES_TOKEN}
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z ${PLUGIN_KUBERNETES_SERVER} ]; then
|
if [ ! -z ${PLUGIN_KUBERNETES_SERVER} ]; then
|
||||||
|
@ -14,7 +13,12 @@ if [ ! -z ${PLUGIN_KUBERNETES_SERVER} ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z ${PLUGIN_KUBERNETES_CERT} ]; then
|
if [ ! -z ${PLUGIN_KUBERNETES_CERT} ]; then
|
||||||
echo ${PLUGIN_KUBERNETES_CERT} | base64 -d > ca.crt
|
KUBERNETES_CERT=${PLUGIN_KUBERNETES_CERT}
|
||||||
|
fi
|
||||||
|
|
||||||
|
kubectl config set-credentials default --token=${KUBERNETES_TOKEN}
|
||||||
|
if [ ! -z ${KUBERNETES_CERT} ]; then
|
||||||
|
echo ${KUBERNETES_CERT}} | base64 -d > ca.crt
|
||||||
kubectl config set-cluster default --server=${KUBERNETES_SERVER} --certificate-authority=ca.crt
|
kubectl config set-cluster default --server=${KUBERNETES_SERVER} --certificate-authority=ca.crt
|
||||||
else
|
else
|
||||||
kubectl config set-cluster default --server=${KUBERNETES_SERVER} --insecure-skip-tls-verify=true
|
kubectl config set-cluster default --server=${KUBERNETES_SERVER} --insecure-skip-tls-verify=true
|
||||||
|
@ -22,7 +26,7 @@ fi
|
||||||
|
|
||||||
kubectl config set-context default --cluster=default --user=default
|
kubectl config set-context default --cluster=default --user=default
|
||||||
kubectl config use-context default
|
kubectl config use-context default
|
||||||
|
|
||||||
IFS=',' read -r -a DEPLOYMENTS <<< "$PLUGIN_DEPLOYMENT"
|
IFS=',' read -r -a DEPLOYMENTS <<< "$PLUGIN_DEPLOYMENT"
|
||||||
for DEPLOY in ${DEPLOYMENTS[@]}; do
|
for DEPLOY in ${DEPLOYMENTS[@]}; do
|
||||||
echo Deploying to $KUBERNETES_SERVER
|
echo Deploying to $KUBERNETES_SERVER
|
||||||
|
|
Loading…
Reference in New Issue