Michael Cambria
9959f787e8
Moved directory walk, compare file code to it's own function
2018-09-25 12:10:36 -04:00
Michael Cambria
7b72f2afd4
Handle the case of a Delete for a reservation stored with just ContainerID without the interface
2018-09-20 10:56:07 -04:00
Michael Cambria
f1ee2cc614
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-09-18 16:35:30 -04:00
Bryan Boreham
75d3585862
Merge pull request #174 from jellonek/updatecomment
...
plugins/ipam/static: Update docstring
2018-08-01 16:28:45 +01:00
Piotr Skamruk
6dc16b9132
plugins/ipam/static: Update docstring
2018-07-19 14:35:10 +02: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
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
Roman Mohr
cc71426592
Don't let DHCP delete fail on missing lease
...
There are at least two reasons why a lease is not present:
* The dhcp ipam daemon was restarted
* On add the IPAM plugin failed
Don't fail the IPAM invocation when the lease is not present, to allow
proper device cleanup on CNI delete invocations.
2017-10-11 14:29:16 +02: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
27d027a6d3
ipam/host-local: support sets of disjoint ranges
...
In real-world address allocations, disjoint address ranges are common.
Therefore, the host-local allocator should support them.
This change still allows for multiple IPs in a single configuration, but
also allows for a "set of subnets."
Fixes: #45
2017-08-09 19:02:08 +02:00
Dan Williams
0da6780449
pkg,plugins: update for Result struct Interface index changes
...
It's a pointer now, so we need to use the helper function to set
the field and also test for nil before accessing it.
2017-06-29 13:40:36 -05:00
Gabe Rosenhouse
494053dd98
Merge pull request #11 from dcbw/dhcp-pidfile
...
dhcp: add --pidfile option to DHCP client daemon
2017-06-15 22:48:42 -07:00
Dan Williams
a38dd5f7a0
dhcp: add --pidfile option to DHCP client daemon
2017-06-14 21:41:43 -05: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
Casey Callendrello
3c436520be
move most of cni/pkg to plugins/pkg: delete code staying in cni/pkg
...
This moves the following packages to this repository:
* ip
* ipam
* ns
* testutils
* utils
2017-05-23 16:12:49 +02:00
Casey Callendrello
9f52fc0374
Move documentation folder to individual READMEs
2017-05-16 16:46:15 +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
Dan Williams
21d96393ea
Merge pull request #391 from tangle329/master
...
Validate rangeStart and rangeEnd specified in conf
2017-04-24 22:00:07 -05:00
Dan Williams
9445711fa5
spec/plugins: fix 'ip'->'ips' in the spec, bump to 0.3.1
2017-04-05 12:46:24 -05:00
Tom Denham
13824487c6
plugins/*: Don't error if the device doesn't exist
...
I wasn't able to test or update the dhcp plugin but from a code read it
should be fine. All the other plugins are tested and fixed
2017-03-22 08:52:29 -07:00
Tang Le
1b65890795
Validate rangeStart and rangeEnd specified in conf
...
Signed-off-by: Tang Le <tangle3@wanda.cn>
2017-03-10 12:51:05 +08:00
Gabe Rosenhouse
4ce9b019aa
Merge pull request #366 from ehazlett/ipam-host-local-initial-reserved-ip
...
Do not error if last reserved not found after initial creation
2017-03-06 07:13:06 -08:00
Evan Hazlett
ac50624393
fix unrelated failing tests
...
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2017-03-02 15:37:43 -05:00
Evan Hazlett
2678be24d0
add test for ensuring initial subnet creation does not contain an error
...
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2017-03-02 15:16:09 -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
Tang Le
1003822e53
Check n.IPAM before use it in LoadIPAMConfig function
...
Signed-off-by: Tang Le <tangle3@wanda.cn>
2017-03-02 10:25:19 +08:00
Gabe Rosenhouse
eb2ff7fe57
docs: consolidate host-local documentation
...
- remove the README.md in the plugins/ipam/host-local (no other plugin
has this)
- merge that info into the main Documentation/host-local.md
2017-02-15 15:20:13 -08:00
Dan Williams
d5acb127b8
spec/plugins: return interface details and multiple IP addresses to runtime
...
Updates the spec and plugins to return an array of interfaces and IP details
to the runtime including:
- interface names and MAC addresses configured by the plugin
- whether the interfaces are sandboxed (container/VM) or host (bridge, veth, etc)
- multiple IP addresses configured by IPAM and which interface they
have been assigned to
Returning interface details is useful for runtimes, as well as allowing
more flexible chaining of CNI plugins themselves. For example, some
meta plugins may need to know the host-side interface to be able to
apply firewall or traffic shaping rules to the container.
2017-01-25 11:31:18 -06:00
Dan Williams
befb95977c
types: make Result an interface and move existing Result to separate package
2017-01-25 11:31:18 -06:00
Dan Williams
cb4cd0e12c
testutils: pass netConf in for version operations; pass raw result out for tests
2017-01-25 11:31:18 -06:00