add DHCP IPAM plugin

The plugin binary actually functions in two modes. The first mode
is a regular CNI plugin. The second mode (when stared with "daemon" arg)
runs a DHCP client daemon. When executed as a CNI plugin, it issues
an RPC request to the daemon for actual processing. The daemon is
required since a DHCP lease needs to be maintained by periodically
renewing it. One instance of the daemon can server arbitrary number
of containers/leases.
This commit is contained in:
Eugene Yakubovich
2015-05-19 12:02:41 -07:00
parent 7a8ee49891
commit c70320b5ed
15 changed files with 791 additions and 838 deletions

View File

@ -2,7 +2,6 @@
# Run a command in a private network namespace
# set up by CNI plugins
contid=$(printf '%x%x%x%x' $RANDOM $RANDOM $RANDOM $RANDOM)
netnspath=/var/run/netns/$contid
@ -17,4 +16,4 @@ function cleanup() {
}
trap cleanup EXIT
ip netns exec $contid $@
ip netns exec $contid "$@"