Граф коммитов

10 Коммитов

Автор SHA1 Сообщение Дата
Mathew Merrick 1b57030f10
npm: enable debug feature parity for v2 (#1324)
* cache interface

* retrieve cache common interface
2022-06-14 18:58:17 +00:00
Mathew Merrick 60820006e1
refactor: move existing npm controllers to v1 (#1040)
* put v2 behind toggle
2021-10-20 13:03:12 -07:00
JungukCho c74c49745f
[NPM] refactor: npmcache json marshaling (#993)
* wip

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
Co-authored-by: JungukCho <jungukcho@microsoft.com>

* wip

Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
Co-authored-by: JungukCho <jungukcho@microsoft.com>

* Add unit tests

* Use correct parameters

* Check nil value of ipsMgr before calling marshal function and add UT

* Resolve lint errors

* Resolve all lint errors

* Define error

* Use a right file for UT and resolve lint error

* Use better directory name for managing testfiles
2021-09-17 16:19:51 -07:00
Vamsi Kalapala 01c12d8f40
[NPM] Generic Dataplane interface for windows and linux (#984)
* adding initial dataplane interface

* adding some skeleton code for crud functions

* adding dirty cache initial support for ipset manager

* correcting some go lints

* Adding some skeleton around os specific files

* removing interface and adding some network logic

* adding apply ipsets logic

* Addressing some comments and also adding comments to code

* Fixing some golints

* addressing some comments

* adding some golint checks

* Adding a new field setProperty and also adding structure for policies

* applying some comments

* correcting a condition

* Adding some comments

* Adding some test cases

* Addressing some comments

* Addressing more comments

* resolving some comments

* resolving some comments

* fixing some comments

* removing lock on policymap

* fixing some golints

* merging with master

* fixingsome wrap checks

* fixing lints
2021-09-12 19:43:31 -07:00
JungukCho 83b6240933
[NPM] Make each controller in npm independent (#949)
* Locate key data structure in each controller and remove locks in each controller if possible and lower lock location into ipset manager

* Create npmNameSpaceCache to manage shared namespace objects and mutex

* Encapsulate listMap and setMap in ipset manager struct not to expose them to other packages.
Remove unnecessary codes and clean-up initialization codes.

* Encapsulate methods and members to avoid unintentional access to variables and manage better shared resource. Correct UTs and Clean-up codes

* Update expected values in UTs according to architectural change and clean-up code (remove unnecessary comment and duplicated logging)

* Add comments and clean-up codes (removing redundant codes, etc)

* Remove threadness variable to avoid unintentional increase in the number of workers in each controller without safe synchronization

* Handle errors and return values in right ways based on lint hints

* Remove error handling codes in initializing iptables and ipset when NPM starts

* Call a correct function to avoid UT failure

* Resolve comments

* Locate key data structure in each controller and remove locks in each controller if possible and lower lock location into ipset manager

* Create npmNameSpaceCache to manage shared namespace objects and mutex

* Encapsulate listMap and setMap in ipset manager struct not to expose them to other packages.
Remove unnecessary codes and clean-up initialization codes.

* Encapsulate methods and members to avoid unintentional access to variables and manage better shared resource. Correct UTs and Clean-up codes

* Update expected values in UTs according to architectural change and clean-up code (remove unnecessary comment and duplicated logging)

* Add comments and clean-up codes (removing redundant codes, etc)

* Remove threadness variable to avoid unintentional increase in the number of workers in each controller without safe synchronization

* Handle errors and return values in right ways based on lint hints

* Remove error handling codes in initializing iptables and ipset when NPM starts

* Call a correct function to avoid UT failure

* Resolve comments

* Correct lint's complaint

* Correct chain order

* resolved llc lint warnings and renamed variables

* Resolved lint warnings if possible

* Removed unnecessary variables and codes

* Locate key data structure in each controller and remove locks in each controller if possible and lower lock location into ipset manager

Encapsulate listMap and setMap in ipset manager struct not to expose them to other packages.
Remove unnecessary codes and clean-up initialization codes.

Encapsulate methods and members to avoid unintentional access to variables and manage better shared resource. Correct UTs and Clean-up codes

Update expected values in UTs according to architectural change and clean-up code (remove unnecessary comment and duplicated logging)

Add comments and clean-up codes (removing redundant codes, etc)

Handle errors and return values in right ways based on lint hints

Remove error handling codes in initializing iptables and ipset when NPM starts

Call a correct function to avoid UT failure

Resolve comments

Correct lint's complaint

Correct chain order

* Add custom encoding and decoding logic for NPMCache

* Revise UT case in server_test.go and resolve lint warning

* Add npm cache file which was revised based on custom encoding and revise corresponding UTs

* Add unit test for npmCache (need to remove redundancy in server_test.go)

* Resolve lint warnings
2021-08-27 16:05:40 -07:00
Mathew Merrick 9b24dbd95a
test: [NPM] Use fakeexec for ipsm and iptm tests (#868)
* iptmgr

* more iptm testing

* grep call

* progress

* progress

* ipsm

* ioshim

* update tests

* package restructure

* fix broken test and delint

* reduce scope of ioshim

* reduce scope of ioshim

* ioshim scope

* require no error, retrigger ci

* ut return multiple results

* fix tests from master changes

* unexport ioshim

* update ut

* fix tests

* vendor

* test fix

* go version

* go version

* pipeline fixes

* fix tests
2021-07-14 12:53:45 -07:00
Mathew Merrick 6312309d61
[NPM] Use utilexec for IPSet calls and fakeexec in podcontroller tests (#861)
* use utilexec for IPSet syscalls
2021-05-06 12:08:26 -07:00
JungukCho da7f2c7e6d
fix management of deletefinalstateUnknown object on deletion event in each controller. Add Unit test for them. Correct log messages. (#856) 2021-04-23 11:51:45 -07:00
Vamsi Kalapala 0b1086b5ca
Fixing a regression with integration of two controllers (#842) 2021-03-31 18:41:49 -07:00
Vamsi Kalapala 45c2fca54c
[NPM] NameSpace resource controller changes (#839)
* Upgrading Namespace to use NSController

* Unit tests for namespace controller

* correcting testcases

* correcting testcases

* correcting testcases

* Adding in more testcases

* adding threadness to NS

* minor imporvements wrt RV

* minor imporvements wrt RV

* minor imporvements wrt RV

* Cleaning up some stale code

* resolving comments

* Addressing some comments

* Addressing some comments

* Adding missing newcontroller

* Addressing more comments

* Addressing more comments
2021-03-31 16:16:34 -07:00