Added parameters 'force' and 'user'
'force' to update image even with the same tag 'user' to use custom account
This commit is contained in:
parent
36904ab9b6
commit
a139168649
10
update.sh
10
update.sh
|
@ -4,6 +4,10 @@ if [ -z ${PLUGIN_NAMESPACE} ]; then
|
|||
PLUGIN_NAMESPACE="default"
|
||||
fi
|
||||
|
||||
if [ -z ${PLUGIN_KUBERNETES_USER} ]; then
|
||||
PLUGIN_KUBERNETES_USER="default"
|
||||
fi
|
||||
|
||||
if [ ! -z ${PLUGIN_KUBERNETES_TOKEN} ]; then
|
||||
KUBERNETES_TOKEN=$PLUGIN_KUBERNETES_TOKEN
|
||||
fi
|
||||
|
@ -25,7 +29,7 @@ else
|
|||
kubectl config set-cluster default --server=${KUBERNETES_SERVER} --insecure-skip-tls-verify=true
|
||||
fi
|
||||
|
||||
kubectl config set-context default --cluster=default --user=default
|
||||
kubectl config set-context default --cluster=default --user=${PLUGIN_KUBERNETES_USER}
|
||||
kubectl config use-context default
|
||||
|
||||
# kubectl version
|
||||
|
@ -34,6 +38,10 @@ IFS=',' read -r -a CONTAINERS <<< "${PLUGIN_CONTAINER}"
|
|||
for DEPLOY in ${DEPLOYMENTS[@]}; do
|
||||
echo Deploying to $KUBERNETES_SERVER
|
||||
for CONTAINER in ${CONTAINERS[@]}; do
|
||||
if [[ ${PLUGIN_FORCE} == "true" ]]; then
|
||||
kubectl -n ${PLUGIN_NAMESPACE} set image deployment/${DEPLOY} \
|
||||
${CONTAINER}=${PLUGIN_REPO}:${PLUGIN_TAG}FORCE
|
||||
fi
|
||||
kubectl -n ${PLUGIN_NAMESPACE} set image deployment/${DEPLOY} \
|
||||
${CONTAINER}=${PLUGIN_REPO}:${PLUGIN_TAG} --record
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue