Commit 77b78c8
fix: avoid global Configuration singleton race in read_config_map
Each call to read_config_map was mutating the kubernetes_asyncio global
Configuration._default via load_incluster_config(). Concurrent async
requests could race each other, leaving the global transiently empty so
that CoreV1Api() would construct an ApiClient with no host/token → 401.
Fix by passing an explicit client_configuration object to
load_incluster_config/load_kube_config and binding ApiClient to it
directly, so no shared global state is touched.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 3a18aee commit 77b78c8
1 file changed
Lines changed: 15 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | | - | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
0 commit comments