8 Commits

Author SHA1 Message Date
Gabe Rosenhouse
536cb5b99b versioning: plugins report a list of supported versions
Further progress on versioning support (Issue #266).
Bump CNI spec version to 0.3.0
2016-09-02 11:26:17 -04:00
Stefan Junker
ed5f8dfeb2 *: appc/cni -> containernetworking/cni
The project has been moved so internally we simply rename everything.
Consumers are recommended to update their vendored version of cni.
2016-05-06 16:40:27 +02:00
Michael Bridgen
719a1db54b Add invoke.Delegate{Add,Del} for use by meta-plugins
The 'flannel' meta plugin delegates to other plugins to do the actual
OS-level work. It used the ipam.Exec{Add,Del} procedures for this
delegation, since those do precisely what's needed.

However this is a bit misleading, since the flannel plugin _isn't_
doing this for IPAM, and the ipam.Exec* procedures aren't doing
something specific to IPAM plugins.

So: anticipating that there may be more meta plugins that want to
delegate in the same way, this commit moves generic delegation
procedures to `pkg/invoke`, and makes the `pkg/ipam` procedures (still
used, accurately, in the non-meta plugins) shims.
2016-03-04 11:01:22 +00:00
Eugene Yakubovich
20f1b8694f flannel: doc fix and check for missing subnet.env fields
- Document that flannel outputs FLANNEL_NETWORK b/c we use it
- Check and error out if expecited fields are missing in subnetEnv file

Fixes #72
2015-10-07 15:38:12 -07: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
Michael Bridgen
b88f173c43 Factor an API out into a module
This takes some of the machinery from CNI and from the rkt networking
code, and turns it into a library that can be linked into go apps.

Included is an example command-line application that uses the library,
called `cnitool`.

Other headline changes:

 * Plugin exec'ing is factored out

The motivation here is to factor out the protocol for invoking
plugins. To that end, a generalisation of the code from api.go and
pkg/plugin/ipam.go goes into pkg/invoke/exec.go.

 * Move argument-handling and conf-loading into public API

The fact that the arguments get turned into an environment for the
plugin is incidental to the API; so, provide a way of supplying them
as a struct or saying "just use the same arguments as I got" (the
latter is for IPAM plugins).
2015-09-16 10:14:39 +01:00
Eugene Yakubovich
e38572b967 flannel: set up route for the entire flannel network
Without it, packets leave via default route iface
and come back via interface added by flannel plugin.
If rp_filter=1, the packets are dropped.
2015-08-10 14:13:06 -07:00
Eugene Yakubovich
78daffc479 add flannel plugin
This introduces a notion of a "meta" plugin. A meta plugin
is one that delegates the actual work of setting up the interface
to the main plugin. The meta plugin is used to select and dynamically
configure the main plugin. The sequence of events, is as follows:

Given netconf like:

    {
	"name": "mynet",
	"type": "flannel",
	"delegate": {
	    "type": "bridge"
	}
    }

flannel fills in values like "mtu", "ipam.subnet" and delegates to
"bridge" main plugin. "bridge" plugin will operate as usual, calling
into ipam module for IP assignment.

Delegate dictionary should not contain "name" field as it will be
filled in by the flannel plugin.
2015-06-11 15:37:58 -07:00