Skip to content

Make KUBECONFIG nil if KUBE_TOKEN is nil

Dylan Griffith requested to merge set-kubeconfig-nil-when-token-nil into master

What does this MR do?

EE MR: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/8655

Having an invalid KUBECONFIG without a token in it is not helpful. This only became possible recently now that we are creating a separate namespace and service account (and hence token) to send to the runners. This led to somewhat surprising results when troubleshooting https://gitlab.com/gitlab-org/gitlab-ce/issues/53879 as I found that the KUBECONFIG was still being passed but KUBE_TOKEN was not. These things really should have been linked.

Furthermore now that we are also using the presence of KUBECONFIG to decide whether or not to run build steps in Auto DevOps I think it makes even more sense to ensure that KUBECONFIG is a complete config if passed to a job.

WIP Pending https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23414#note_121061764

What are the relevant issue numbers?

Does this MR meet the acceptance criteria?

Edited by 🤖 GitLab Bot 🤖

Merge request reports