summary |
shortlog | log |
commit |
commitdiff |
tree
first ⋅ prev ⋅ next
Gabe Rosenhouse [Mon, 18 Apr 2016 03:27:02 +0000 (20:27 -0700)]
Document use of goroutine and lockosthread in test helpers
Gabe Rosenhouse [Mon, 18 Apr 2016 02:44:00 +0000 (19:44 -0700)]
Fix issues with MakeNetworkNS test helper
Gabe Rosenhouse [Mon, 18 Apr 2016 01:48:50 +0000 (18:48 -0700)]
Add basic unit tests of testhelpers
Gabe Rosenhouse [Mon, 18 Apr 2016 01:35:49 +0000 (18:35 -0700)]
Extract inode inspection functions into testhelpers
Gabe Rosenhouse [Mon, 18 Apr 2016 01:28:10 +0000 (18:28 -0700)]
Extract testhelpers from loopback test suite
Jonathan Boulle [Fri, 1 Apr 2016 13:35:21 +0000 (15:35 +0200)]
*: add missing license headers + check
Stefan Junker [Thu, 31 Mar 2016 15:11:11 +0000 (17:11 +0200)]
pkg/utils: correct the test's expected chain names
Stefan Junker [Thu, 31 Mar 2016 13:44:54 +0000 (15:44 +0200)]
*: add comment to iptables rules for ipmasq
Stefan Junker [Thu, 31 Mar 2016 09:55:46 +0000 (11:55 +0200)]
pkg/utils: remove unneeded condition in tests
Stefan Junker [Thu, 31 Mar 2016 09:50:18 +0000 (11:50 +0200)]
pkg/utils: fix docstring
Stefan Junker [Thu, 31 Mar 2016 08:08:52 +0000 (10:08 +0200)]
pkg/utils: split and unexport constants
Stefan Junker [Wed, 30 Mar 2016 17:40:31 +0000 (19:40 +0200)]
pkg/utils: fix docstring
Stefan Junker [Wed, 30 Mar 2016 17:40:20 +0000 (19:40 +0200)]
pkg/utils: use constant for chain prefix
Stefan Junker [Wed, 30 Mar 2016 17:17:37 +0000 (19:17 +0200)]
pkg/utils: use name+id for hash and extend tests
Abhishek Chanda [Wed, 23 Mar 2016 00:16:59 +0000 (17:16 -0700)]
pkg: add a function to generate chain names
Adds a function to generate chain names for use in iptables and
ports all drivers to use that function. Also adds tests for the
said function.
Stefan Junker [Thu, 17 Mar 2016 13:09:54 +0000 (14:09 +0100)]
pkg/types: add tests for args
Stefan Junker [Thu, 17 Mar 2016 13:08:29 +0000 (14:08 +0100)]
pkg/types: add IgnoreUnknown arg and logic
This commit adds a struct type CommonArgs that is to be embedded in
every plugin's argument struct. It contains a field named
"IgnoreUnknown" which will be parsed as a boolean and can be provided to
ignore unknown arguments passed to the plugin.
Stefan Junker [Fri, 18 Mar 2016 21:28:14 +0000 (22:28 +0100)]
pkg/skel: add rudimentary unit tests
This is an attempt to testing the PluginMain() function of the skel pkg.
We should be able to do better by using a mockable interface for the
plugins, but this is a start.
Gabe Rosenhouse [Tue, 15 Mar 2016 15:37:00 +0000 (08:37 -0700)]
Update docstring on WithNetNS
Gabe Rosenhouse [Tue, 15 Mar 2016 01:57:16 +0000 (18:57 -0700)]
WithNetNS restores original namespace when callback errors
- adds test coverage of WithNetNS in BDD-style
Michael Bridgen [Wed, 2 Mar 2016 17:02:52 +0000 (17:02 +0000)]
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.
Stefan Junker [Wed, 2 Mar 2016 10:14:50 +0000 (11:14 +0100)]
Merge pull request #120 from zachgersh/find-better-error
Better error messages when plugin is not found
André Martins [Sun, 31 Jan 2016 03:18:33 +0000 (03:18 +0000)]
added the String method to Result type
Signed-off-by: André Martins <aanm90@gmail.com>
Zachary Gershman [Wed, 10 Feb 2016 21:42:10 +0000 (13:42 -0800)]
Better error message when plugin cannot be found
Stefan Junker [Wed, 27 Jan 2016 11:12:16 +0000 (12:12 +0100)]
*: reflect SPEC's DNS changes in implementation
* DNS is now a type which will result in a JSON dictionary in
configurations and results
* Minor refactoring, making use of type embedding
Alban Crequy [Tue, 26 Jan 2016 17:54:56 +0000 (18:54 +0100)]
*: add "dns" field to the configuration
appc/cni#76 added a "dns" field in the result JSON. But before this
patch, the plugins had no way of knowing which name server to return.
There could be two ways of knowing which name server to return:
1. add it as an extra argument ("CNI_ARGS")
2. add it in the network configuration as a convenience (received via
stdin)
I chose the second way because it is easier. In the case of rkt, it
means the user could just add the DNS name servers in
/etc/rkt/net.d/mynetwork.conf.
Derek Gonyeo [Wed, 16 Dec 2015 21:20:19 +0000 (13:20 -0800)]
pkg/ip: fix typo in error message, s/iptabes/iptables/
Eugene Yakubovich [Tue, 29 Sep 2015 18:51:33 +0000 (11:51 -0700)]
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).
Stefan Junker [Thu, 24 Sep 2015 16:27:41 +0000 (18:27 +0200)]
link: switch to host netns to set up host veth end
Stefan Junker [Thu, 24 Sep 2015 16:28:14 +0000 (18:28 +0200)]
Revert "plugins/ptp: allow host veth to be UP"
This reverts commit
231d2d5a27f3ba54219c3f0b1c8ef2c5dab4faaf.
Stefan Junker [Wed, 23 Sep 2015 09:03:22 +0000 (11:03 +0200)]
plugins/ptp: allow host veth to be UP
Eugene Yakubovich [Fri, 18 Sep 2015 17:30:10 +0000 (10:30 -0700)]
bug fix: exec of DEL cmd caused JSON decode error
When plugin is executed with a DEL command, it does not
print result to stdout unless there is an error. Therefore
it stdout bytes should not be passed to json.Unmarshal.
Michael Bridgen [Fri, 7 Aug 2015 15:27:52 +0000 (16:27 +0100)]
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).
Neil Wilson [Tue, 8 Sep 2015 03:20:11 +0000 (03:20 +0000)]
plugin/ipam: correct formatting of error message
Neil Wilson [Mon, 7 Sep 2015 15:15:23 +0000 (15:15 +0000)]
IPAM plugin: improve error messages
Make it more clear that we failed to find an IPAM plugin.
Check for a missing plugin name and issue a more helpful error.
Jonathan Boulle [Mon, 7 Sep 2015 22:43:34 +0000 (15:43 -0700)]
plugin/ipam: fix typo in error message
Stefan Junker [Sat, 5 Sep 2015 16:58:58 +0000 (18:58 +0200)]
CNI_ARGS: use ';' to split args as documented
Stefan Junker [Sun, 16 Aug 2015 00:30:04 +0000 (02:30 +0200)]
host-local: allow ip request via CNI_ARGS
A specific IP can now be requested via the environment variable CNI_ARGS, e.g.
`CNI_ARGS=ip=1.2.3.4`.
The plugin will try to reserve the specified IP.
If this is not successful the execution will fail.
Eugene Yakubovich [Mon, 13 Jul 2015 22:41:02 +0000 (15:41 -0700)]
enable net.ipv4.ip_forward in plugins that need it
Eugene Yakubovich [Fri, 12 Jun 2015 19:15:11 +0000 (12:15 -0700)]
No more path rewriting
Path rewriting causes too many problems when vendoring
vendored code. When CNI code is vendored into rkt,
godep has problems code already vendored by CNI.
Eugene Yakubovich [Tue, 2 Jun 2015 00:34:00 +0000 (17:34 -0700)]
Propagate json error object to the caller
When plugin errors out, it prints out a JSON object to stdout
describing the failure. This object needs to be propagated out
through the plugins and to the container runtime. This change
also adds Print method to both the result and error structs
for easy serialization to stdout.
Eugene Yakubovich [Tue, 19 May 2015 19:02:41 +0000 (12:02 -0700)]
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.
Eugene Yakubovich [Fri, 8 May 2015 22:08:03 +0000 (15:08 -0700)]
Merge pull request #9 from eyakubovich/errors
report errors via JSON
Eugene Yakubovich [Thu, 30 Apr 2015 00:52:41 +0000 (17:52 -0700)]
report errors via JSON
This reflects the latest SPEC draft.
Eugene Yakubovich [Tue, 5 May 2015 20:35:20 +0000 (13:35 -0700)]
Do not use netns as ID or for entropy
ContainerID is now required so use that
or generate random bytes.
Fixes #5
Eugene Yakubovich [Wed, 15 Apr 2015 22:35:02 +0000 (15:35 -0700)]
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.