kube-rs / kube

Rust Kubernetes client and controller runtime
https://kube.rs
Apache License 2.0
3.03k stars 314 forks source link

inconsistency with kubectl with invalid user #1593

Open aviramha opened 1 month ago

aviramha commented 1 month ago

Current and expected behavior

When using kube-rs over kubectl proxy kube-rs client doesn't work while kubectl does

kubectl config set-cluster testt --server=http://localhost:8001 --insecure-skip-tls-verify=true
kubectl config set-context testt --cluster=testt
kubectl config use-context testt

add in ~/.kube/config

users:
- name: testt
  user: 
    password: a
    username: a

and in the testt context:

- context:
    cluster: testt
    user: testt
  name: testt

then run kubectl get pods (using kube-rs' kubectl example) and it will fail, while official binary works.

Found this while trying to work around https://github.com/metalbear-co/mirrord/issues/2803

Possible solution

No response

Additional context

No response

Environment

doesn't matter

Configuration and features

No response

Affected crates

kube-client

Would you like to work on fixing this bug?

No, since https://github.com/kube-rs/kube/issues/1594 is more important to me, but decided to log this issue for common knowledge.

aviramha commented 1 month ago

https://github.com/kube-rs/kube/issues/1594

clux commented 1 month ago

presumably duplicate of #1594 ?

clux commented 1 month ago

looks like it, closing. please reopen if there's something missing

aviramha commented 1 month ago

Hey, it's not a duplicate - in this case it would still fail by supplying wrong auth while kubectl works somehow