Skip to content
Snippets Groups Projects
Commit c31371c7 authored by P.-A. RIVIERE's avatar P.-A. RIVIERE
Browse files

fix(KUBECONFIG): select to the given KUBE_CONTEXT if provided

parent c28ad61a
No related branches found
No related tags found
No related merge requests found
......@@ -303,6 +303,12 @@ stages:
elif [[ -n "$KUBECONFIG" ]]
then
log_info "--- using \\e[32mKUBECONFIG\\e[0m provided by GitLab"
if [[ -n "$KUBE_CONTEXT" ]]
then
kubectl config use-context "$KUBE_CONTEXT"
log_info "--- switch to the given \\e[32mKUBE_CONTEXT\\e[0m: ${KUBE_CONTEXT}"
fi
else
log_info "--- using exploded \\e[32mKUBECONFIG\\e[0m parameters (env: \\e[33;1m${environment_type}\\e[0m, url: \\e[33;1m${url}\\e[0m, namespace: \\e[33;1m${namespace}\\e[0m)"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment