Make KUBECONFIG nil if KUBE_TOKEN is nil
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?
-
Changelog entry added, if necessary -
Documentation created/updated -
Tests added for this feature/bug -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides - [-] Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process.