-
-
Notifications
You must be signed in to change notification settings - Fork 314
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
Config::infer
can return in-cluster config outside cluster with rustls
feature
#623
Comments
Ugh, I did a workaround but found that my kubeconfig file has the server address as |
Closing as duplicate of #153. We keep track of |
Well, this might be a new issue. |
OK, but are you aware that the rustls workaround linked to in this issue prevents a KUBECONFIG from ever being used. So, if my KUBECONFIG specifies Edit: just saw you re-opened this. Thank you. |
Config::infer
always returns in-cluster with rustls
feature
Looks like it was overlooked because it should fall back to
Failing to find these files should fall back to |
Config::infer
always returns in-cluster with rustls
featureConfig::infer
can return in-cluster config outside cluster with rustls
feature
@webern Do you have the files listed above when you're outside the cluster? |
No I don't have those files outside of the cluster. Outside of the cluster I'm running on a mac. I think the check for rustls happens too early in the code... before the check for those files.
|
Hmm, then it should fall back to I'm assuming you're using |
|
You're correct about |
Oh I see. This issue might be in error. I'll double check through my breakpoints again. |
I think I was wrong about the failure mode. Perhaps it was getting my kubeconfig and failing because it had the server address 127.0.0.1. Closing. |
I think there is a problem with this code branch:
https://github.com/kube-rs/kube-rs/blob/master/kube/src/config/mod.rs#L94...L97
This takes us to:
https://github.com/kube-rs/kube-rs/blob/b7fe7485a5661bdec398377109801e675db8aaee/kube/src/config/incluster_config.rs#L22...L29
Where we always return an on-cluster URL even if we are not running on a cluster.
So the issue is, if I want to use a
KUBECONFIG
, off-cluster with Rustls, I never make it to theKUBECONFIG
code branches.One simple fix would be to check for the absence of
KUBECONFIG
at https://github.com/kube-rs/kube-rs/blob/master/kube/src/config/mod.rs#L94 but that might be a slightly different behavior than advertised in the documentation.The text was updated successfully, but these errors were encountered: