sourcing kubectl completion into shell inhibit login to desktop sessions #1716
Labels
kind/bug
Categorizes issue or PR as related to a bug.
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
What happened:
Sourcing
kubectl completion
into shell try to login to configured kubernetes cluster.What you expected to happen:
Loading completion commands into shells should only enable the completion feature without contacting the clusters nor parsing kubeconfig because it is not required or needed
How to reproduce it (as minimally and precisely as possible):
Scenario:
hash kubectl && source <(kubectl completion bash)
In the above scenario just after logging into my desktop session a browser pop up asking me to authorize the OIDC login into kubernetes. Session does not start until the login is authorized or cancelled. Same behaviour happen if I login via a console (tty), the shell does not start waiting for OIDC session to establish.
Workaround:
Sourcing completion commands with a null configuration allow logging into desktop session without any issues. Example:
kubectl --kubeconfig /dev/null completion bash
Anything else we need to know?:
Example configuration
Environment:
kubectl version
): Client Version:v1.30.9-dispatcher
The text was updated successfully, but these errors were encountered: