1775 Commits

Author SHA1 Message Date
Gabe Rosenhouse
f85ac247e6 Merge pull request #361 from ofiliz/issue-360
invoke: Enable plugin file names with extensions
2017-02-08 10:15:49 -08:00
Onur Filiz
a35f8ae914 invoke: Enable plugin file names with extensions
A CNI network configuration file contains the plugin's executable file name.
Some platforms like Windows require a file name extension for executables.
This causes unnecessary burden on admins as they now have to maintain two
versions of each type of netconfig file, which differ only by the ".exe"
extension. A much simpler design is for invoke package to also look for
well-known extensions on platforms that require it. Existing tests are
improved and new tests are added to cover the new behavior.

Fixes #360
2017-02-04 12:01:47 -08:00
Onur Filiz
271be6c8df invoke: Enable plugin file names with extensions
A CNI network configuration file contains the plugin's executable file name.
Some platforms like Windows require a file name extension for executables.
This causes unnecessary burden on admins as they now have to maintain two
versions of each type of netconfig file, which differ only by the ".exe"
extension. A much simpler design is for invoke package to also look for
well-known extensions on platforms that require it. Existing tests are
improved and new tests are added to cover the new behavior.

Fixes #360
2017-02-04 12:01:47 -08:00
Gabe Rosenhouse
fc7de21fe2 Merge pull request #364 from pires/build_tag
pkg/utils/sysctl/sysctl_linux.go: couple fixes
2017-02-03 14:18:39 -05:00
Paulo Pires
2e90a8cc33 pkg/utils/sysctl/sysctl_linux.go: fix typo. 2017-02-03 05:39:04 +00:00
Paulo Pires
4c0b8f7054 pkg/utils/sysctl/sysctl_linux.go: fix typo. 2017-02-03 05:39:04 +00:00
Paulo Pires
162b73e44f pkg/utils/sysctl/sysctl_linux.go: fix build tag. 2017-02-03 05:38:53 +00:00
Paulo Pires
246300ccfe
pkg/utils/sysctl/sysctl_linux.go: fix build tag. 2017-02-03 05:38:53 +00:00
Tom Denham
e663e98444 Merge pull request #359 from ofiliz/issue-355
libcni, pkg\invoke: Use OS-specific list separator when parsing CNI_PATH
2017-02-02 12:35:07 -08:00
Onur
46e17b26ff spec, libcni, pkg/invoke: Use OS-agnostic separator when parsing CNI_PATH
Hardcoding the list separator character as ":" causes CNI to fail when parsing
CNI_PATH on other operating systems. For example, Windows uses ";" as list
separator because ":" can legally appear in paths such as "C:\path\to\file".
This change replaces use of ":" with OS-agnostic APIs or os.PathListSeparator.

Fixes #358
2017-01-28 16:47:58 -08:00
Onur
0d9a1d70f8 spec, libcni, pkg/invoke: Use OS-agnostic separator when parsing CNI_PATH
Hardcoding the list separator character as ":" causes CNI to fail when parsing
CNI_PATH on other operating systems. For example, Windows uses ";" as list
separator because ":" can legally appear in paths such as "C:\path\to\file".
This change replaces use of ":" with OS-agnostic APIs or os.PathListSeparator.

Fixes #358
2017-01-28 16:47:58 -08:00
Gabe Rosenhouse
c4271dba67 Merge pull request #145 from dcbw/pass-ifname-back
Pass interface name and MAC back to runtime
2017-01-25 11:20:57 -08:00
Dan Williams
06b397912b 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
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
b89b56dc97 pkg/ipam: add testcases 2017-01-25 11:31:18 -06:00
Dan Williams
befad17174 pkg/ipam: add testcases 2017-01-25 11:31:18 -06:00
Dan Williams
e6adfe939a macvlan/ipvlan: use common RenameLink method 2017-01-25 11:31:18 -06:00
Dan Williams
b0b896f79a plugins/flannel: organize test JSON alphabetically
Otherwise the test fails, since Go's JSON marshaller prints
dict items alphabetically in its String() call.
2017-01-25 11:31:18 -06:00
Dan Williams
0d19b79260 types: make Result an interface and move existing Result to separate package 2017-01-25 11:31:18 -06:00
Dan Williams
ad2a5ccb61 macvlan/ipvlan: use common RenameLink method 2017-01-25 11:31:18 -06:00
Dan Williams
dae1177b53 testutils: pass netConf in for version operations; pass raw result out for tests 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
Gabe Rosenhouse
dcadf4f9b5 Merge pull request #355 from rosenhouse/skel-main-errors
skel: adds PluginMainWithError which returns a *types.Error
2017-01-23 07:42:57 -08:00
Gabe Rosenhouse
2515b8c712 skel: adds PluginMainWithError which returns a *types.Error
Enables plugins to do their own error-handling and cleanup logic
2017-01-22 16:57:42 -08:00
Gabe Rosenhouse
af5c2f303a skel: adds PluginMainWithError which returns a *types.Error
Enables plugins to do their own error-handling and cleanup logic
2017-01-22 16:57:42 -08:00
Gabe Rosenhouse
1acc927ab0 Merge pull request #352 from containernetworking/conventions
Documentation: Add conventions doc
2017-01-20 13:50:24 -08:00
Tom Denham
04f357344d Update CONVENTIONS.md 2017-01-20 12:49:00 -08:00
Gabe Rosenhouse
e476ab7189 Merge pull request #346 from dcbw/ordered-chaining
api/plugins: implement ordered plugin chaining
2017-01-20 08:35:37 -08:00
Dan Williams
13534e505c api,libcni: add network config list-based plugin chaining
Using a new ".configlist" file format that allows specifying
a list of CNI network configurations to run, add new libcni
helper functions to call each plugin in the list, injecting
the overall name, CNI version, and previous plugin's Result
structure into the configuration of the next plugin.
2017-01-19 22:28:21 -06:00
Dan Williams
0c2a034f01 api,libcni: add network config list-based plugin chaining
Using a new ".configlist" file format that allows specifying
a list of CNI network configurations to run, add new libcni
helper functions to call each plugin in the list, injecting
the overall name, CNI version, and previous plugin's Result
structure into the configuration of the next plugin.
2017-01-19 22:28:21 -06:00
Dan Williams
7e16c86a52 spec: add network configuration list specification 2017-01-19 22:28:20 -06:00
Tom Denham
947b79e334
Spec/Conventions: Update to include plugin config 2017-01-19 18:05:28 -08:00
Dan Williams
0a1b48f520 noop: allow specifying debug file in config JSON
Chaining sends different config JSON to each plugin, but the same
environment, and if we want to test multiple noop plugin runs in
the same chain we need a way of telling each run to use a different
debug file.
2017-01-19 09:56:42 -06:00
Tom Denham
d716d73444 Documentation: Add conventions doc 2017-01-17 15:53:24 -08:00
Tom Denham
530dd71e19 Merge pull request #334 from squeed/host-local-dns
ipam/host-local: add ResolvConf argument for DNS configuration
2017-01-12 17:06:04 -08:00
Tom Denham
fa58dd8889 Merge pull request #350 from rosenhouse/spec-version
spec: notice of version
2017-01-12 13:42:25 -08:00
Gabe Rosenhouse
20fde00ea6 spec: notice of version 2017-01-11 18:49:10 -08:00
Casey Callendrello
cd16252299 ipam/host-local: add ResolvConf argument for DNS configuration
This adds the option `resolvConf` to the host-local IPAM configuration.
If specified, the plugin will try to parse the file as a resolv.conf(5)
type file and return it in the DNS response.
2017-01-11 18:48:35 +01:00
Casey Callendrello
5cde14cd7b ipam/host-local: add ResolvConf argument for DNS configuration
This adds the option `resolvConf` to the host-local IPAM configuration.
If specified, the plugin will try to parse the file as a resolv.conf(5)
type file and return it in the DNS response.
2017-01-11 18:48:35 +01:00
Tom Denham
4406607649 Merge pull request #115 from aanm/implementing-ipam-as-lib
ipam/host-local: Move allocator and config to backend
2017-01-10 13:06:46 -08:00
André Martins
f60111b093 ipam/host-local: Move allocator and config to backend
Signed-off-by: André Martins <aanm90@gmail.com>
2016-12-21 04:43:21 +00:00
Gabe Rosenhouse
98ff61aac3 Merge pull request #325 from squeed/update-maintainer
MAINTAINERS: hi CaseyC!
2016-12-19 11:02:20 -08:00
Casey Callendrello
6dc01a772b MAINTAINERS: hi CaseyC! 2016-12-19 12:38:29 -05:00
Gabe Rosenhouse
e3bcc3e41b Merge pull request #345 from rosenhouse/travis-go-versions
travis: roll forward the versions of Go that we test
2016-12-16 08:06:17 -08:00
Gabe Rosenhouse
bc1d61e3db travis: roll forward the versions of Go that we test 2016-12-15 18:41:07 -08:00
Gabe Rosenhouse
652bae1deb Merge pull request #314 from rosenhouse/noop-helpful-message
plugins/noop: return a helpful message for test authors
2016-12-15 18:35:43 -08:00
Gabe Rosenhouse
47f6604b5a Merge pull request #344 from dcbw/interface-checks
all: assert internal objects implement interfaces
2016-12-15 18:34:57 -08:00
Gabe Rosenhouse
1c1cf2faf7 Merge branch 'master' into interface-checks 2016-12-15 18:20:34 -08:00
Gabe Rosenhouse
ef00f717a6 Merge pull request #341 from dcbw/host-local-trim
host-local: trim whitespace from container IDs and disk file contents
2016-12-15 18:18:25 -08:00