Commit e3e6989
committed
Key cache on cluster server URL + user name when available
kcc-injector now sets provideClusterInfo on injected exec configs, so
kubectl passes the target API server URL to kcc-cache via
KUBERNETES_EXEC_INFO. kcc-cache uses that server URL together with the
kubeconfig user name (KUBE_CREDENTIAL_CACHE_USER) as the cache key.
This makes the key stable against cosmetic argv changes (avoiding
needless re-auth) while still discriminating both the target cluster and
the identity, so one user's credentials are never served for another on
the same cluster. When the server URL is unavailable (provideClusterInfo
not set, or a manual setup) it falls back to the previous argv + env key.
Re-running `kcc-injector -i ~/.kube/config` once enables it; no other
manual setup is required.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DHL4n3s3iBGwQR34JxpDn91 parent 4aab249 commit e3e6989
2 files changed
Lines changed: 44 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
61 | 71 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
67 | 83 | | |
68 | | - | |
69 | 84 | | |
70 | | - | |
71 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
72 | 101 | | |
73 | 102 | | |
74 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
106 | 112 | | |
107 | 113 | | |
108 | 114 | | |
| |||
0 commit comments