-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confusing error message when no kubeconfig is provided #918
Comments
Similarly, I received this error when I had neglected to set automountServiceAccountToken to true with the bitnami/kubectl container running in an existing cluster (all the environment variables were set correctly). I even wrote it up on serverfault to hopefully stop someone else from wasting hours over a cryptic error message: https://serverfault.com/q/1050696/108132 If a valid config exists, it would be very helpful if the error message carped about the lack of credentials or at least in some way indicated that the connection to localhost:8080 is a failure after a fallback to defaults |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
/remove-lifecycle stale It's kind of weird to me that client go executes |
do you have more details of what you are observing? client-go does not invoke kubectl. it's possible some of the error messages when misconfigured reference command line flags that are typically associated with kubectl, but there's no runtime dependency on a kubectl binary. |
Turns out in my case it was expected behavior. client-go was invoking users:
- name: kubernetes-admin
user:
exec:
apiVersion: client.authentication.k8s.io/v1beta1
command: kubectl
args: |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I observed this issue when using the latest
kubectl
, but I believe it is relevant toclient-go
(and maybecli-runtime
).When running
kubectl
commands without a config file (no--kubeconfig
flag, noKUBECONFIG
environment variable, no~/.kube/config
), I get the following error message:Since I didn't provide any configuration, I would expect to see the following error message, defined in
cli-runtime/pkg/genericclioptions/client_config.go
:I did some digging, and it looks like because of the following code in
client-go/pkg/tools/clientcmd/client_config.go
...... the server defaults to
http://localhost:8080
when creating the config, which prevents the config from being identified as empty later on.Judging by the
DEPRECATED
in the comments, it looks like this behavior is going to change soon? Is there an ETA on this?In any case, if this is indeed an issue and not WAI, I would be interested in helping with the fix.
The text was updated successfully, but these errors were encountered: