Riccardo Ravaioli
33ccedc66f
Create IPAM files with 0600 permissions
...
Conform to CIS Benchmarks "1.1.9 Ensure that the Container Network Interface file permissions are set to 600 or more restrictive"
https://www.tenable.com/audits/items/CIS_Kubernetes_v1.20_v1.0.1_Level_1_Master.audit:f1717a5dd65d498074dd41c4a639e47d
Signed-off-by: Riccardo Ravaioli <rravaiol@redhat.com>
2023-10-02 11:59:31 +02:00
Marcelo Guerrero Viveros
6c0d73ecc0
Fix wastedassign linter errors
...
Signed-off-by: Marcelo Guerrero Viveros <marguerr@redhat.com>
2023-03-27 18:42:49 +02:00
Marcelo Guerrero Viveros
d71d0f2da1
Fix revive linter errors
...
Golangci-lint is now running version 1.52.1. This introduced some errors.
Signed-off-by: Marcelo Guerrero Viveros <marguerr@redhat.com>
2023-03-24 21:04:39 +01:00
Matthieu MOREL
79f524689c
enable gocritic linter
...
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2023-03-13 17:59:33 +01:00
Matthieu MOREL
177e0bf2d9
enable staticcheck linter
...
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2023-03-02 11:06:22 +01:00
Matthieu MOREL
d12b81dec5
ci(lint): setup golangci-lint
...
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2023-03-01 06:55:40 +00:00
Austin Vazquez
1a6f478913
Remove references to io/ioutil package
...
Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2022-12-01 22:27:05 +00:00
Jingyuan Liang
87c3643d3c
host-local: remove unused Release(ip) from type Store interface
...
Signed-off-by: Jingyuan Liang <jingyuanliang@google.com>
2022-09-06 21:39:54 +00:00
Bruce Ma
7f8ea631e5
host-local: make Store interface support to get ip list by id
...
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
2019-07-06 09:39:56 +08:00
Michael Cambria
74a2596573
Add check support for: bridge, ipvlan, macvlan, p2p, vlan and host-device main plugins
...
host-local and static ipam plugins
tuning, bandwidth and portmap meta plugins
Utility functions created for common PrevResult checking
Fix windows build
2019-04-03 13:08:07 -04:00
Michael Cambria
37715a0f87
Moved directory walk, compare file code to it's own function
2018-10-09 13:13:36 -04:00
Michael Cambria
a17cadda88
Handle the case of a Delete for a reservation stored with just ContainerID without the interface
2018-10-09 13:13:36 -04:00
Michael Cambria
1e8f9525a6
Obtain ifname from CmdArgs and pass to backend Add ifname to second line of file tracking the IP address used by ContainerID
...
Update host-local tests to use ifname along with ContainerID
in store file
Signed-off-by: Michael Cambria <mcambria@redhat.com>
2018-10-09 13:13:36 -04:00
Rakesh Kelkar
47668f6d64
host-local: Update host-local IPAM to support Windows
2017-11-11 15:17:45 -08:00
Gabe Rosenhouse
2f957864ea
host-local disk backend store uses FileLock by reference
...
- this change fixes go vet warnings for the package
2017-08-30 06:52:29 -07:00
Casey Callendrello
2e9e87732f
ipam/host-local: support multiple IP ranges
...
This change allows the host-local allocator to allocate multiple IPs.
This is intended to enable dual-stack, but is not limited to only two
subnets or separate address families.
2017-06-12 21:14:44 +02:00
Dan Williams
d2792f264e
plugins: add plugins from containernetworking/cni
...
Plugins prepared from the containernetworking/cni repo as follows:
1) git reset --hard 1a9288c3c09cea4e580fdb1a636f1c5e185a391f
2) git remove everything not in plugins/
3) git remove plugins/test
4) git merge into containernetworking/plugins repo
5) adjust import paths for containernetworking/cni -> containernetworking/plugins
2017-05-14 23:12:45 -05:00
Evan Hazlett
474ba16901
do not error if last_reserved_ip is missing for host local ipam
...
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2017-03-02 13:59:21 -05:00
Gabe Rosenhouse
1c1cf2faf7
Merge branch 'master' into interface-checks
2016-12-15 18:20:34 -08:00
Dan Williams
5852c60bc4
all: assert internal objects implement interfaces
2016-12-14 17:09:01 -06:00
Dan Williams
76028d7f8c
host-local: trim whitespace from container IDs and disk file contents
...
It doesn't seem like container IDs should really have whitespace or
newlines in them. As a complete edge-case, manipulating the host-local
store's IP reservations with 'echo' puts a newline at the end, which
caused matching to fail in ReleaseByID(). Don't ask...
2016-12-09 18:16:38 -06:00
Dan Williams
e085226f82
host-local: add DataDir IPAM conf option and use it for testcases
...
Add an e2e host-local plugin testcase, which requires being able
to pass the datadir into the plugin so we can erase it later.
We're not always guaranteed to have access to the default data
dir location, plus it should probably be configurable anyway.
2016-11-10 12:12:16 -06:00
Minhan Xia
2445a960a9
plugins/ipam: round robin ip allocation for host-local ipam
...
This changes the ip allocation logic to round robin. Before this, host-local IPAM searched for available IPs from start of subnet. Hence it tends to allocate IPs that had been used recently. This is not ideal since it may cause collisions.
2016-06-02 20:37:05 +02:00
Eugene Yakubovich
0becca2e96
Change copyright from CoreOS to CNI authors
...
CNI is developed by more than just CoreOS, Inc
and the copyright is retained by all CNI
contributors (for their respective contributed code).
2015-09-29 11:51:33 -07:00
Eugene Yakubovich
88377fa346
Add plugin code
...
This adds basic plugins.
"main" types: veth, bridge, macvlan
"ipam" type: host-local
The code has been ported over from github.com/coreos/rkt project
and adapted to fit the CNI spec.
2015-04-27 14:14:29 -07:00