* fix overlay IPAM not reporting version
* revert file and var naming, add correct path to makefile
* proposal design for multitenant IPAM flow
* change podipinfo + linter issue
* pointer issues for printf
* update IPAM branching
* remove comments
* pod client placeholder
* address lint issue for httpservicefake
* getting pod info in validator
* linter issue
* update network container contract
* renaming
* mtpnc changes
* rebase
* revert file and var naming, add correct path to makefile
* add default route
* add unit tests
* update unit tests for ipam
* go get to fix linter
* go mod tidy
* update routes
* update routes
* remove stale comments + remove redundant method
* add contexts + change address type
* addressed review
* embedded client to mock + enum for address type
* fix error
* change addressType to NICType
* change isDefaultRoute to SkipDefaultRoutes
* address comments
* refractor: make changes according to cni/cns contract
* refractor: make adding route its own func + move swift v2 ipam branching to after normal ipam flow
* refractor: change vars naming
* refractor: more var naming
* test: add test for podv6cidr
* refractor: make the returning podIpInfo init cleaner in swiftv2.go
* refractor + tests: add contexts to ipconfigs req validators + set route tests
* refractor: change labels for swift v2 pods
* fix: fix swift v2 UT
* refractor: add v4/v6 distinction for service cidr
* rebase
* revert file and var naming, add correct path to makefile
* rebase
* revert file and var naming, add correct path to makefile
* change podipinfo + linter issue
* update IPAM branching
* pod client placeholder
* getting pod info in validator
* linter issue
* rebase
* revert file and var naming, add correct path to makefile
* refractor: fix conflicts
* refractor: revert podwatcher code changes
* docs: change comment
* refractor: change CIDR to CDIRs
* refractor: parse CIDRs as semicolons separated string from env in SetRoutes
* docs: add minor comment
* refractor: change separator for parsing CIDRs
* feat: add rbac roles
* fix: gofumpt
* fix: update clusterrole
* fix: add namespace to clusterrolebinding
* fix: UT
* fix: add labels toswift v2 clusterrole
* fix: release default ipconfig early if getting swiftv2 ipconfig failed
* test: add more UT
* fix: parsing MTPNC as CIDR instead
* fix: toggle skipDefaultRoutes for infraNic to true
* fix: add route for node cidr in ipv4 podipconfig
* feat: add node cidrs route
* fix: linter
* address comments
* fix: minor logs formatting
* feat: move cns yaml for swiftv2 scenario to a diff file + more logging for swiftv2middleware
* fix: log debugf to printf
* fix: add testmain to avoid nil pointer error for loggers
* Update azure-cns.yaml
Signed-off-by: Quang Nguyen <nguyenquang@microsoft.com>
* fix: move parseCIDRs to a common package, use net/netip instead of net
* fix: exhaustive all switch case for nic type
* fix: exhaustive all switch case for nic type
* refractor: change fmt.Errorf to errors.Wrapf
* fix: add mtpnc status check in validator + use netip package
* fix: minor
* revert: azure-cns.yaml
---------
Signed-off-by: Quang Nguyen <nddangquang@gmail.com>
Signed-off-by: Quang Nguyen <nguyenquang@microsoft.com>
* feat: added logger package and replaced old log initialization for the new one
* feat: changed all log lines to new zap logger
* fix: typo
* Update azure-ipam/logger/logger.go
Co-authored-by: Timothy J. Raymond <timraymond@users.noreply.github.com>
* fix: adding constants to describe logger rotations constraints
* Renamed logger New method
* Replaced logAndSend method by log 1st and send then so we can use zap fields
* minor fixes
* added logger init for tests
* replaced Any by Error
* gci ipam_test
* fixed govet errors
* moved component to a zap field
* fixed linit issues
* added log mock
* fix: gci
* fix: added context for logger teardown
* Update cni/log/logger.go
Co-authored-by: Evan Baker <rbtr@users.noreply.github.com>
* moved logger init mock function
* fix: lint findings
---------
Co-authored-by: Esteban Capillo <estebancams@microsoft.com>
Co-authored-by: Timothy J. Raymond <timraymond@users.noreply.github.com>
Co-authored-by: Evan Baker <rbtr@users.noreply.github.com>
* fix: reconcile initial state from CRD regardless of existing podInfo
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
* fix: add test for no state and pending release in NNC
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
* fix: add test for restoring state and pending release in NNC
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
---------
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
* add retry to nnc update during scaledown
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
* test for panic in pool monitor
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
---------
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
* rebase
* rebase
* rebase
* adding snat iptables rules using coreos lib
* fix iptables cmd not running
* docs
* added conflist back
* change chain name from SWIFT to SWIFT-POSTROUTING
* update go.mod
* split internalapi into linux and windows
* add imports
* fix iptables programming login
* fix iptables programming logic
* change program iptables rules logic
* Native Endpoint Client Add Endpoints
* AddEndpointRules, ConfigureContainerInterfacesAndRoutes
* Changed interface names, log statements
nw.extIf.Name > eth0 (eth0)
eth0.vlanid > eth0.X (eth0.1)
%s%s hostIfName > vnet (A1veth0)
%s%s-2 contIfName > container (B1veth0)
* Renaming, using lib to set ns
* Namespace "path" is /var/run/netns/<NS>
* Loopback set up, Remove auto kernel subnet route
* Cannot set link to up if it's in another NS
* Multiple containers on same VNET NS
* Delete Endpoint routes on Delete
* Minimizing netns usage
* Moving NS Exec Code
* Further minimized netns.Set usage
* Moved helper methods down, drafted tests
* Removed DevName from Route Info, more tests
* Test existing vnet ns, delete endpoint
* NetNS interface for testing
* Separated tests by namespace
* Endpoints delete if they cannot be moved into NS
* Namespace netns tests
* Added Native Client to deleteEndpointImpl
* Deletion of Endpoints Impl and Tests
* Cleaned code (Tests ok)
* Moved mock/netns to package (Tests ok)
* Fixing Netns (wip)
Moved netnsinterface to consumer package (network).
Removed "Netns" from "NewNetns" and "NewMockNetns" as it is unambiguous.
Changed uintptr to int and casted the int to uintptr when needed later.
* Using errors.Wrap for error context (wip)
* Removed sentence case (wip)
* Removing variable predeclaration
* Removed NewNativeEndpointClient
Directly instantiating struct because nothing special happens in NewNativeEndpointClient
* Removed generics from ExecuteInNS
* Removed uintptr from mocknetns, tests compile
Forgot to remove uintptr from mocknetns
* Fix tests, lint
* Fixes from linter
Works on VMSS
* Replacing references to ethX with vlan veth
* Removed unnecessary log
* Removed unnecessary mac, fix tests
* Mockns method name enum
* Unable to use GetNetworkInterfaceByName due to NS
If I use GetNetworkInterface, I need to be in the vnet NS, but that means I will need to call ExecuteInNS, which causes tests to fail.
* Fixes from linter
* Assume if NS exists, vlan veth exists
Tests ok
* Fixes for Linter
* Fix delete tests
* Fix delete tests bug
* Go mod tidy for linting
Hopefully this fixes the windows lint error
* No lint on vishvananda netns
Maybe this will fix the windows linter?
* Build linux only for netns package
Maybe this fixes the linter error?
* Remove nolint to see if linter fails
* Moved netns interface to caller, generalized tests
Tests ok, Native ok
* Typos
* Reordered if statement, unwrapped arp
Tests ok, ping ok, wget ok
* Renamed veth, fixed logs
* Made deleteEndpoints logic clearer, renamed error
* Renamed eth0 to primaryHostIfName, vlanEth to vlanIf
* adding az sdk dependencies and tidying mod file
* adding keyvault shim
* example usage application for kv shim
* adding tests, cleaning up
* fixing linter errors
* updating go mod