diff --git a/templates/gitlab-ci-helm.yml b/templates/gitlab-ci-helm.yml index 52bf26a61018cd4cfd6183c42e5df1b51cf66f69..448bd86d8ab883a80c5e9c280d288b8b614bebcd 100644 --- a/templates/gitlab-ci-helm.yml +++ b/templates/gitlab-ci-helm.yml @@ -339,6 +339,11 @@ 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_warn "No \\e[32mKUBECONFIG\\e[0m configuration found!" fi