Commit 16cc959
committed
fix(py3-kubernetes): cherry-pick v36 incluster auth fix + regression test
v36.0.0 rewrote Configuration.auth_settings() to look up the bearer
credential under api_key['BearerToken'], but left the hand-written
loaders in kubernetes/base/config/ and kubernetes_asyncio/config/
writing api_key['authorization']. Net effect: every load_incluster_config()
on v36 produces a Configuration with no bearer credential, requests go
out unauthenticated, and the apiserver rejects them as system:anonymous.
Cherry-pick the two upstream commits from PR #2585 to write 'BearerToken'
in all three loaders, and bump epoch to 1. Drop the cherry-picks once a
v36.0.1 upstream release ships with the fix applied.
Also add a subpackage test that drives InClusterConfigLoader._set_config
and asserts api_key['BearerToken'] is populated, so the fix can't be
silently dropped on a future bump.
Refs:
- Upstream PR: kubernetes-client/python#2585
- Upstream issue: kubernetes-client/python#2591
Signed-off-by: Francesco Bartolini <francesco.bartolini@chainguard.dev>
Export: 6f0eda5c49c32b1ea5cb945c2c36e44ec0c20d351 parent df4f246 commit 16cc959
1 file changed
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| |||
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
77 | 97 | | |
78 | 98 | | |
79 | 99 | | |
| |||
0 commit comments