Skip to content

Return error for absent bearer token for web terminal

Sladyn requested to merge sladyn981/gitlab-runner:kubernetes_token_recovery into main

What does this MR do?

This MR thows an error when the kubeapi bearer token in empty

Why was this MR needed?

For interactive web temrinals with the kubernetes executor we always require the user to set the bearer_token, even though we don't require it to talk to the kubeapi because we read the KUBECONFIG from the machine. We try to get the bearer_token form the config from the config but if not bearer_token is used to authenticate with the API it is empty. This results in a connectin failure when the user tries to load the terminal.

Are there points in the code the reviewer needs to double check?

Just an alternative way to obtain the token if its absent.

Does this MR meet the acceptance criteria?

  • Documentation created/updated
  • Added tests for this feature/bug
  • In case of conflicts with master - branch was rebased

What are the relevant issue numbers?

#25173 (closed)

Edited by Steve Xuereb

Merge request reports