Commit ee39f51
committed
Wait for CSINode removal to register CSI plugin
When a CSI plugin attempts to register on a node, the node checks if the CSINode object exists. If it does but the ownerReference of the CSINode does not match the UID of the current node, possibly because the node object was recreated with the same name, we end up in a race condition where the CSINode object will be updated but subsequently deleted by the GC controller.
In this situation, the CSINode object will be gone and won't be recreated unless the CSI plugin is restarted.
This commit fixes this race by checking that the CSINode object belong to the current node before updating it. Failing the plugin registration otherwise.1 parent 3d07014 commit ee39f51
2 files changed
Lines changed: 49 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
381 | 386 | | |
382 | 387 | | |
383 | | - | |
| 388 | + | |
384 | 389 | | |
| 390 | + | |
385 | 391 | | |
386 | 392 | | |
387 | 393 | | |
388 | 394 | | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
389 | 399 | | |
390 | 400 | | |
391 | 401 | | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
392 | 411 | | |
393 | 412 | | |
394 | 413 | | |
| |||
411 | 430 | | |
412 | 431 | | |
413 | 432 | | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
414 | 438 | | |
415 | 439 | | |
416 | 440 | | |
417 | | - | |
| 441 | + | |
418 | 442 | | |
419 | 443 | | |
420 | 444 | | |
421 | 445 | | |
422 | 446 | | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
423 | 451 | | |
424 | 452 | | |
425 | 453 | | |
| |||
430 | 458 | | |
431 | 459 | | |
432 | 460 | | |
433 | | - | |
| 461 | + | |
434 | 462 | | |
435 | 463 | | |
436 | 464 | | |
437 | 465 | | |
438 | 466 | | |
439 | 467 | | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | 468 | | |
446 | 469 | | |
447 | 470 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
310 | 325 | | |
311 | 326 | | |
312 | 327 | | |
| |||
972 | 987 | | |
973 | 988 | | |
974 | 989 | | |
975 | | - | |
| 990 | + | |
976 | 991 | | |
977 | 992 | | |
978 | 993 | | |
| |||
1032 | 1047 | | |
1033 | 1048 | | |
1034 | 1049 | | |
1035 | | - | |
| 1050 | + | |
1036 | 1051 | | |
1037 | 1052 | | |
1038 | 1053 | | |
| |||
0 commit comments