Commit a7b5202
authored
[NPM] Support pod controller and unit test to improve reliability (#836)
* Junguk cho pod controller support (#1)
* code layout to support pod controller in npm
* filter events if they do not need to handle and clean up business logic
* put lock when it needs to access shared resource
use namespace/name as key
clean up functions
* - use pod key instead of uid.
- remove unnecessary error check
* use namespace prefix in pod namespace. add log messages to know what events happens.
* move event logs with more contexts in needsync func
* Put returning an error in a right place
* Return if the RV of both pod obj are the same. Proactively start cleaning up pod when the pod is deleted.
* first version of podController UT
* add ipset management in pod controller unit test
* Make methods flexible for ipset store and restore operation
* clean up functions and variables
Co-authored-by: Junguk Cho <[email protected]>
* correct and clean functions and error messages. Return errors from appendNamedPortIpsets function to retry syncPod operation
* Check npmPod exists in cleanUpDeletedPod function. Use GetIPSetListFromLabels in syncAddedPod and cleanUpDeletedPod functions. Correct error messages, functions, etc
* Clean up podController code. Make podController UT more flexible.
* clean up appendNamedPortIpsets to improve readibility
* minor update (v1 -> corev1) for consistency
* clean up syncPod code to compare last applied states and new pod's states
* add validation for casting old pod. correct log message
* delete unneeded codes
* minor fix: correct comments and removed unneeded variables
* add pre-filter codes to avoid unnecessary reconcile process in updatePod event
* correct a comment
* check workqueue length to validate case where it does not need to reconcile in unit test1 parent 45c2fca commit a7b5202
File tree
6 files changed
+1059
-1114
lines changed- npm
- ipsm
6 files changed
+1059
-1114
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | | - | |
| 300 | + | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
354 | | - | |
355 | | - | |
| 354 | + | |
| 355 | + | |
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
| |||
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
364 | | - | |
| 364 | + | |
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
56 | | - | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| |||
186 | 188 | | |
187 | 189 | | |
188 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
189 | 194 | | |
190 | 195 | | |
191 | 196 | | |
| |||
261 | 266 | | |
262 | 267 | | |
263 | 268 | | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
| 269 | + | |
| 270 | + | |
310 | 271 | | |
311 | 272 | | |
312 | 273 | | |
| |||
0 commit comments