You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
config: write api_key['BearerToken'] so v36+ SDK auth works
v36 rewrote Configuration.auth_settings() to look up the bearer-token
credential under api_key['BearerToken'], matching the OpenAPI security
scheme name. The in-cluster and kubeconfig loaders were not updated -
they still write api_key['authorization'], the v35 lookup key. The
same gap exists in kubernetes_asyncio/config/incluster_config.py.
As a result, on v36 every call to load_incluster_config() (and
load_kube_config() with a static token, including the async equivalents)
produces a Configuration whose auth_settings() yields no bearer
credential, so outgoing API requests are sent without an Authorization
header and the apiserver treats them as system:anonymous.
Write the token under both 'authorization' (v35) and 'BearerToken'
(v36+) in all three affected loaders so requests carry the expected
header. The old key is preserved as a backward-compatibility hedge for
any third-party code introspecting api_key['authorization'] directly.
Add a regression test in incluster_config_test that drives a real
ApiClient.update_params_for_auth() against a freshly-loaded
Configuration and asserts the resulting headers contain an Authorization
entry - the end-to-end invariant that v36 quietly broke.
0 commit comments