Commit a1d05f6
fix: clear proxy vars from containers removed from inject-proxy annotation
The previous fix only cleaned up stale proxy env vars when the annotation
was entirely removed. If the annotation changed from "manager,sidecar" to
"manager", the sidecar container kept HTTP_PROXY/HTTPS_PROXY/NO_PROXY owned
by capi-operator-proxy indefinitely.
Now for each workload we split containers into two groups:
- Containers named in the annotation: proxy vars applied (or refreshed)
- Containers in the spec but NOT in the annotation: empty env applied,
removing our SSA field-manager ownership of any proxy vars we set before
This covers three cases cleanly:
- Annotation absent: all containers cleared (existing behaviour)
- Annotation present, unchanged: annotated get vars, non-annotated get
cleared (no-op if we never owned their env vars)
- Annotation shrinks: dropped containers get cleared, remaining get vars
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Todd Short <tshort@redhat.com>1 parent 228d14c commit a1d05f6
1 file changed
Lines changed: 30 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
| 177 | + | |
177 | 178 | | |
178 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
179 | 184 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
188 | 207 | | |
189 | 208 | | |
190 | | - | |
| 209 | + | |
191 | 210 | | |
192 | 211 | | |
193 | 212 | | |
| |||
0 commit comments