Commit 620018c
fix: use targeted patch in calcSubnetStatusIP to prevent U2O status overwrite
calcSubnetStatusIP previously used subnet.Status.Bytes() which serialized
the entire SubnetStatus and patched all fields to etcd. This caused a race
condition where handleUpdateSubnetStatus could overwrite U2OInterconnectionVPC
with stale data from its informer cache, leading to flaky e2e test failures
in "should support underlay to overlay subnet interconnection".
The race condition occurs when:
1. handleAddOrUpdateSubnet sets U2OInterconnectionVPC and patches status
2. handleUpdateSubnetStatus retries (from IP inconsistency requeue), reads
stale cache without U2OInterconnectionVPC, and calcSubnetStatusIP
overwrites all status fields including U2OInterconnectionVPC=""
Fix by using a targeted JSON merge patch that only includes the 8 IP-related
fields, leaving non-IP fields like U2OInterconnectionVPC untouched.
Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 53b0946 commit 620018c
1 file changed
+24
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
246 | 269 | | |
247 | 270 | | |
248 | 271 | | |
| |||
0 commit comments