Commit d816931
authored
[NPM] support network policy controller and its unit tests (#849)
* first version of network policy controller and its unit tests
* update reconcile and deleteNetworkPolicy function to correctly install and uninstall default Azure NPM chain.
* To explicitly manage default Azure NPM chain in deleteNetworkPolicy function
* correct comments and delete unused variable
* fix missed returing errors in codes
* Correct to check DeletionTimestamp and DeletionGracePeriodSeconds variables
* removed placeholder functions in network policy controoler and added more test cases (e.g., update and adding multiple network policies)
* - applied comments (use explict names, locating lock in a better place)
* add two methods to save and restore iptables in unit test
* comment out unused function
* early filter in updateNetworkPolicy function if they are the same network policies. Update unit tests to test more network policies events
* - start using klog package instead of log package
* remove unneeded defer for lock
* Locate of adding and deleting network policy object from our network policy cache in a right place. Correct prometheus metric code.
* use cached network policy key instead of network policy object as method parameter in cleanUpNetworkPolicy
* remove redundant check
* Remove ns- prefix as key in RawNpMap. Update UT to check prometheus metrics. Applied better naming and removed redundancy codes.
* minor update for varialbe names
* remove dependency between UT by re-initializing metrics. Correct message.1 parent d929d1a commit d816931
File tree
8 files changed
+894
-733
lines changed- npm
- metrics
8 files changed
+894
-733
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
64 | 69 | | |
65 | 70 | | |
66 | 71 | | |
| |||
0 commit comments