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

33 Коммитов

Автор SHA1 Сообщение Дата
Paul Yu 49431986ee
[CNI] zap logger migration for store package (#2231)
* zap logger migration for store package
2023-09-25 15:59:56 +00:00
Behzad Mirkhanzadeh 9a3c50cac7
perf: 🚀 Increase CNI Lock Timeout to 30 seconds for Linux AKS. (#2101)
* Increase Linux Lock Timout to 30 seconds.

* addressing the comment by adding a new lock constant for Linux.
2023-08-17 00:16:55 +00:00
Behzad Mirkhanzadeh 3ad4c65bb1
perf: Store Lock timeout for CNI in Windows is increased to 1 minute. (#1924)
* fix: Store Lock timeout for CNI in Windows is increased to 1 minute.

* rollback the telemtry lock timeout to 10 sec.
2023-06-29 10:04:59 -07:00
Quang Nguyen 60e5a26565
feat: CNS manages endpoints state for delegate IPAM use case (#1500)
* rebase

* linting

* rebase

* missing if condition for releaseIPConfig

* update azure-cns.yaml and add UTs

* rebase

* update program iptables changes

* linting

* fix broken tests

* fix podinfoprovider returns error when key is not found

* log when no endpoint state exist when reconcilling

* not remove endpoint state file on failure to read in restserver.restoreState()

* addressed comments

* update acn tag

* go get on acn

* addressed comments

Co-authored-by: Evan Baker <rbtr@users.noreply.github.com>
2022-08-23 16:42:40 -07:00
Keith Nguyen 08b07d885e
return early if CNI state exist and add some style fixes (#1412)
* style: format issues

* style: lint issues

* style: lint issues

* style: moved to new block

Co-authored-by: Keith Nguyen <keithnguyen@microsoft.com>
2022-06-06 10:52:38 -05:00
Keith Nguyen 81b84f6eea
Bugfix/14337706/remove state file (#1392)
* fix: remove state file to let CNI autorecover if CNI state file not present and RefCount not 0

* fix: move to invoker_azure.go

* fix: move to invoker_azure.go

* fix: revert error to private

* fix: unit test

* fix: move into delegate add/delete

Co-authored-by: Keith Nguyen <keithnguyen@microsoft.com>
2022-05-20 17:43:34 -05:00
Paul Johnston 6d208e9762
Cns windows aks (#1059)
* chore: add in some functionality for CNS on windows host process pods
2021-11-22 09:23:01 -08:00
Eng Zer Jun e812bc82b8
refactor: move from io/ioutil to io and os packages (#1096)
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-11-17 16:31:42 -06:00
tamilmani1989 cdab7d0241
Use Lockedfile api to acquire lock (#1070)
* added lockedfileapi support for CNI

* fixed interface changes

* addressed comments
fixed ut

* addressed comments

* fixed copy to buffer part in writer api

* fixed copy to buffer part in writer api

* keeping old code not changing it.
2021-11-09 08:19:44 -08:00
tamilmani1989 3510ac4977
no need to remove lock files on reboot (#1041) 2021-10-01 11:22:53 -07:00
tamilmani1989 58827523c7
Reduce lock timeout and check pid same before cleaning up (#1035)
* lock fix changes

* added test files

* removing unused file

* lint fixes

* Update cni/plugin.go

Co-authored-by: Evan Baker <rbtr@users.noreply.github.com>

* addressed comments

* nit fix

Co-authored-by: Evan Baker <rbtr@users.noreply.github.com>
2021-09-30 15:48:51 -07:00
Evan Baker 96bec09d41
chore: appease the linter (3/?), the big gofumpt (#987)
* gofumpt -w -s .

* small addtl cleanups after gofumpt

* rerun after rebase
2021-09-02 16:33:18 -05:00
tamilmani1989 0bab55c31c
updated lockdir to /var/run/azure-vnet (#934) 2021-07-14 13:46:24 -07:00
tamilmani1989 a53c2f85bc
Revert "removed lock for version command (#929)" (#932)
This reverts commit 6079bf3868.
2021-07-14 12:16:01 -07:00
tamilmani1989 6079bf3868
removed lock for version command (#929)
* removed lock for version command

* updated variable name

* catch and return error on lock

* added log for release lock file

* separated out lock and store initialization

* addressed comments
2021-07-12 16:02:40 -07:00
tamilmani1989 bac354aadf
updated lock directory for cni and ipam (#919)
manually triggered pipeline succeeded, so merging it
2021-07-02 09:15:16 -07:00
Mathew Merrick f2e763050d
fix: [CNI] handle getting endpoints when state file is empty (#916)
* handle empty state file

* update tests

* restore

* fix: add custom unmarshaller for struct with embedded custom interface type

* mkdir images

Co-authored-by: Evan Baker <rbtr@users.noreply.github.com>
2021-06-30 17:54:43 -07:00
Mathew Merrick 1fa243e5f5
CI: Add golint-ci (#888)
* add golint-ci

* add gofmt

* enable linters

* uncap count

* fix linting/fmt issues
2021-06-01 16:58:56 -07:00
Ashvin Deodhar 4c4e5f5d6d
fix: Remove unreadable CNS state file upon CNS service start (#782)
This change removes unreadable state file ( azure-cns.json ) while starting the CNS service
2021-02-11 09:10:13 -08:00
tamilmani1989 98f838ef1b
Write to intermediate file before moving to state file (#755)
* write to temp file and move to state file

* fixed memleak and other issues

* call windows replace function with MOVEFILE_WRITE_THROUGH flag

* moved few functions to platform package

* moved test files to correct dir

* addressed comments
2021-01-07 17:43:33 -08:00
tamilmani1989 6ca873ce05
Remove Orphan lock file (#445)
* added removeorphanlockfile function

* remove lock file if process holding that exited

* addressed comments

* addressed comments and added a condition to check get process cmd is supported

* Addressed comments
fixed trim line ending

* updated log
2019-12-03 17:15:45 -08:00
Ashvin Deodhar 6a330d76a0 Reset lock retry count if lock file timestamp changes (#290) 2019-01-16 14:48:30 -08:00
Ashvin Deodhar e98936c622 Cleanup old networks and lock files after detecting reboot (#285) 2019-01-07 17:04:39 -08:00
John Howard a386846345 Store fixes; Windows compile
Signed-off-by: John Howard <jhoward@microsoft.com>

- First, the store timeout is woefully low. Bumped to 20 seconds from 2 seconds.
  This may fix https://github.com/Azure/azure-container-networking/issues/242#issuecomment-422701838
  IMO, as only test code calls it non-blocked, why even have a block parameter to Lock()?
  IMO also, why a timeout at all? They're always fraught with error and machine timing.

- Presence of a key should be checked using `raw, ok := hvs.data[key]`, not the current nil checked

- ErrKeyNotFound should be returned if the store file does not exist. It shouldn't ignore that error.

- Actually now reports if a timeout occurred correctly, along with non-block lock attempt when already locked.

- Serial pattern abuse in not always closing the lock file.

- Some golang correctness (errors should be lower case)

- go build ./... actually passes on Windows now - various compile errors previously.

- golang pattern conformance `if err:=<test>; err!=nil {....`

- Simplified timeout duration (no need for time.Duration(...))
2018-09-19 15:30:36 -07:00
tamilmani1989 700a25714a Fix wait timeout issue for getting file lock (#193)
* fixed a potential timeout issue for getting file lock
2018-07-11 14:52:23 -07:00
tamilmani1989 40237b7444
Convert time to UTC (#162)
* convert time to utc

* Added a fix in getting last reboot time.

* moved logpath from platform to log package to prevent cycle
2018-06-04 16:47:21 -07:00
Onur Filiz 437f7876d7 Added license notice to all source files 2017-02-12 02:03:39 -08:00
Onur Filiz f17e20ac90 Updated network and address managers to ignore stale persisted state from previous boots 2016-12-16 18:03:03 -08:00
Onur Filiz 9f1ffeb9ae Added lock timeouts to JSON store 2016-11-21 13:48:03 -08:00
Onur Filiz e49a9ec606 Added locking capability to JSON store 2016-11-14 18:21:37 -08:00
Onur Filiz 747b522bcd Updated JSON store to return error if key is not found 2016-07-27 18:24:26 -07:00
Onur Filiz ead69a578a Updated JSON key value store to indent output 2016-07-26 15:27:08 -07:00
Onur Filiz e5912f0de1 Implemented JSON key value store 2016-07-25 18:33:43 -07:00