111 Commits

Author SHA1 Message Date
Dan Williams
a686cc4bd8
Merge pull request #248 from JoeWrightss/patch-1
Fix some spelling errors
2019-01-09 09:50:38 -06:00
JoeWrightss
f0208611ad Fix some spelling errors
Signed-off-by: JoeWrightss <zhoulin.xie@daocloud.io>
2018-12-29 21:26:28 +08:00
bingshen.wbs
59a746bd52 remove gateway check
Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
2018-11-29 12:59:38 +08:00
Michael Cambria
0af31fc4d0 Change dhcp plugin to send ClientID allowing container to have multiple CNI
interfaces using dhcp ipam.

Vendor latest dhcp4server, dhcp4client, dhcp4

Added additional tests for new functionality in dhcp2_test.go

Wrap d2g dhcp4client calls with our own which add clientID to packet.
2018-11-15 11:31:56 -05:00
Michael Cambria
227a4c15fa Add container ifName to the dhcp clientID, making the clientID value
now equal to: ContainerID / Host Network / ifname inside container

Use clientID as a key for the lease
2018-11-09 17:27:05 -05:00
Michael Cambria
d2ebd0a4c2 Merge branch 'master' of github.com:containernetworking/plugins into issue164 2018-10-10 12:28:43 -04:00
Michael Cambria
22b11bb367 Keep defaultSocketPath the same as before 2018-10-10 11:35:57 -04:00
Michael Cambria
73106f0ece Remove unused pidfilePath const
Moved global var's to BeforeEach()
2018-10-09 16:57:58 -04:00
Michael Cambria
75e35b6c01 Added new test cases.
Add two interfaces (e.g. eth0, eth1) to the same container.
Ensure each file now has ContainerID and ifname.
Delete one, ensure that the right file was deleted.

Add an interface using just ContainerID in the file.
Delete to verify we are still backwards compatible with any
files created using earlier verison of host-local plugin.
2018-10-09 13:13:36 -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
Michael Cambria
ef913eadd5 Took out os.Remove() for socketPath and pidfilePath now that os.RemoveAll() is used 2018-10-08 16:01:31 -04:00
Michael Cambria
3d349e4645 Ensure /run/cni exists in the filesystem before running dhcp tests 2018-10-08 14:08:37 -04:00
Michael Cambria
5fd849ac6d Use tempDir in socket path for ginkgo parallelization 2018-10-08 11:31:03 -04:00
Michael Cambria
6d3215a256 Allow socket path used by dhcp plugin to be supplied via dhcp ipam configuration
Allow socket path to be supplied as flag when starting dhcp daemon
2018-10-08 11:30:01 -04:00
Dan Williams
646dbbace1
Merge pull request #165 from s1061123/dev/static-args
Support CNI_ARGS in static IPAM plugin
2018-09-24 21:00:09 -05:00
Michal Rostecki
1a3f49c7ae plugins/ipam: Add missing error check
Signed-off-by: Michal Rostecki <mrostecki@suse.de>
2018-09-20 11:05:58 +02:00
Tomofumi Hayashi
094c903932 Incorporate Dan's comments. 2018-09-13 01:46:11 +09:00
Tomofumi Hayashi
61a412ea77 Align test suite name with others 2018-09-06 15:56:40 +09:00
Tomofumi Hayashi
61c136126f Support multiple IP addresses in CNI_ARGS 2018-09-06 15:50:18 +09:00
Tomofumi Hayashi
321467bf1b Merge remote-tracking branch 'upstream/master' into dev/static-args 2018-09-05 14:39:16 +09:00
Tomofumi Hayashi
60a99ca331 Incorporate Dan's comments. 2018-09-05 14:37:31 +09:00
Bryan Boreham
75d3585862
Merge pull request #174 from jellonek/updatecomment
plugins/ipam/static: Update docstring
2018-08-01 16:28:45 +01:00
Tomofumi Hayashi
cc3ad26691 Incorporate Casey's comments 2018-07-27 12:47:28 +09:00
Piotr Skamruk
6dc16b9132 plugins/ipam/static: Update docstring 2018-07-19 14:35:10 +02:00
Tomofumi Hayashi
3b3622db67 Incorporate jellonek's comments. 2018-07-06 13:17:22 +09:00
CuiHaozhi
dc899ac0e0 remove duplicated assginment.
Signed-off-by: CuiHaozhi <61755280@qq.com>
2018-07-05 09:21:09 +08:00
Neil Wilson
b2fc336833 plugins/host-local: ensure subnet is a network address
Allocation code assumes the specified subnet is a clean network address
prefix, so check that is the case and throw an error otherwise

Fixes #161
2018-06-18 10:13:34 +01:00
Tomofumi Hayashi
6da1cb7876 Support CNI_ARGS in static IPAM plugin
This change is to add CNI_ARGS support in static IPAM plugin.
When IP/SUBNET/GATEWAY are given in CNI_ARGS, static IPAM adds
these info in addition to config files.

To configure ip address only from CNI_ARGS, 'address' field in config
is changed to optional from required.
2018-06-18 16:18:47 +09:00
Casey Callendrello
68b4efb405 plugins/* stub-out GET functions so plugins build with v0.7 2018-06-15 15:28:53 +02:00
Luca Bruno
475fdb8a0a
plugins/dhcp: update to new go-systemd 2018-05-28 12:35:04 +00:00
Dan Williams
731298003c plugins/testutils: pass CNI_CONTAINERID to plugins in testcases
Recent CNI specification changes require the container ID on ADD/DEL,
which the testcases were not providing.  Fix that up so things work
when this repo gets CNI revendored.
2018-04-26 11:24:30 -05:00
Dan Williams
1df359a210
Merge pull request #144 from squeed/build-fixes
build: some small improvements; bump to go1.10
2018-04-25 10:41:32 -05:00
Casey Callendrello
aade7b93ee build: some small improvements; bump to go1.10
- bump to go 1.10
- Add a linker tag with the build version
- Remove fastbuild, go builds are cached now
- Use better ginkgo suite names
2018-04-12 16:59:51 +02:00
Dan Williams
0dba9daee0
Merge pull request #136 from s1061123/add_static
plugins: add static CNI plugin
2018-04-12 06:34:52 -05:00
Casey Callendrello
a0eac8d7d9 pkg/ns: remove namespace creation (and move to testutils)
Namespace creation had an unergonomic interface and isn't used, except
for testing code. Remove it; downstream users should really be creating
their own namespaces
2018-04-03 18:56:25 +02:00
Tomofumi Hayashi
263ff063a6 Add static CNI plugin
This changes to add 'static' CNI plugin, which provides to assign
IPv4/v6 address statically from given config file. See README.md
for the details.
2018-03-29 14:10:04 +09:00
Dan Williams
372bb5e826
Merge pull request #119 from jzwlqx/master
dhcp: clean duplicated error message
2018-02-21 11:09:15 -06:00
Jizhong Jiang
fdc602c0f0 clean duplicated error message 2018-02-12 16:47:53 +08:00
Dan Williams
596480eadc dhcp: remove leases when they are released
Don't lock around the Stop() operation though, as that may take
a while and block other operations.  That may mean we call Stop()
multiple times, but the Lease object should handle that correctly
itself.
2018-02-08 11:17:38 -06:00
Dan Williams
61c3c42107 dhcp: don't try to close the lease stop channel multiple times
Fixes: https://github.com/containernetworking/plugins/issues/105
2018-02-08 11:17:38 -06:00
Dan Williams
b522ed6aae plugins/dhcp: add testcase 2018-02-08 11:17:38 -06:00
Casey Callendrello
9e5836047c
Merge pull request #104 from mzahorik/master
Append default route and process route options in compliance with RFC 3442
2018-01-31 15:08:57 +01:00
Matt Zahorik
808d4e20ae Append a default route to the CNI reply if there's a gateway advertised.
Classless static routes (DHCP option 121) are now processed first.
If CSRs exist, static routes (DHCP option 33) and the gateway default
route are ignored as per RFC 3442.
2018-01-26 10:06:26 -05:00
Casey Callendrello
412b6d3128
Merge pull request #111 from s1061123/add_procfsprefx
Add -hostprefix in DHCP daemon to run the daemon as container
2018-01-25 12:00:51 +01:00
Tomofumi Hayashi
9604565b22 Add -hostprefix in DHCP daemon to run the daemon as container
This diff adds -hostprefix option in dhcp daemon. This option
could be used to run dhcp daemon as container because container
cannot touch host's netns directly. The diff changes dhcp daemon
to touch procfs mounted to another path, like '/hostfs/proc'.
2018-01-25 02:00:43 +09:00
Casey Callendrello
b03d23a4fa ipam/host-local: Accept ip ranges as a runtime argument
This allows for the runtime to dynamically request IP ranges.

Fixes: #95
2017-12-11 13:51:01 +01:00
Rakesh Kelkar
47668f6d64 host-local: Update host-local IPAM to support Windows 2017-11-11 15:17:45 -08:00
Gabriel Rosenhouse
99f6be0319 Enable Windows CI (Appveyor)
- start list of linux_only plugins; ignore them when testing on Windows
- Isolate linux-only code by filename suffix
- Remove stub (NotImplemented) functions
- other misc. fixes for Windows compatibility
2017-11-10 08:09:29 -08:00