328 Commits

Author SHA1 Message Date
Gabe Rosenhouse
bacdc3668d libcni: add integration test coverage 2016-07-15 13:01:08 -07:00
Gabe Rosenhouse
5835c2bbb1 plugins: adds new no-op plugin that may be used as a test-double
Plugin can be configured to record all inputs and to respond with
arbitrary stdout or error message.  Will support upcoming integration
testing.
2016-07-15 12:48:02 -07:00
Gabe Rosenhouse
7f098f7c4a Merge pull request #269 from rosenhouse/skel-dependency-injection
Refactor skel with dependency injection
2016-07-15 12:45:18 -07:00
Gabe Rosenhouse
a2aff8c6a8 misc: fix up copyright dates 2016-07-14 16:09:27 -07:00
Tom Denham
f484990a00 Merge pull request #263 from feiskyer/ptp-test
plugins/main/ptp: add functional tests
2016-07-14 14:32:05 -06:00
Gabe Rosenhouse
f436418525 pkg/skel: improve error message for missing CNI_COMMAND env var
This makes the error message for missing CNI_COMMAND consistent with
that of other required environment variables.
2016-07-14 00:24:32 -04:00
Gabe Rosenhouse
c17e700759 pkg/skel: missing env var log lines appear in stderr
Previously, the log lines appeared in stdout before the JSON encoding of
the error message.  That would break JSON parsing of stdout.  Instead, we use
stderr for these unstructured logs, consistent with the CNI spec.
2016-07-14 00:24:27 -04:00
Gabe Rosenhouse
791d259e55 pkg/skel: refactor to use dependency injection
Extract dependencies on os to enable more complete unit test coverage
2016-07-14 00:06:58 -04:00
Pengfei Ni
cd14fc0e06 plugins/main/ptp: add functional tests 2016-07-11 09:25:36 +08:00
Gabe Rosenhouse
8a93673209 Merge pull request #264 from rosenhouse/test-with-vagrant
Add Vagrantfile, document how to run test suite in a vagrant VM
2016-07-06 11:33:32 -07:00
Gabe Rosenhouse
0c2b5f5139 Add Vagrantfile, document how to run test suite in a vagrant VM 2016-07-05 23:12:02 -07:00
Tom Denham
b8e92ed030 Merge pull request #247 from tomdee/spec-args-field
SPEC: introduce "args" field and new error code
2016-06-14 15:31:23 -07:00
Tom Denham
7b381a1af2 SPEC: introduce "args" field and new error code
Based on previous discussions on the CNI maintainers calls, the spec is
unclear on 1) when CNI_ARGS should be used and 2) the fact the dynamic
config can be passed in through the network JSON.

This PR makes it clear that per-container config can be passed in
through the network JSON, adding a top level `args` field into
which orchestrators can add additional metadata without worrying that
plugins might reject the additional data. It also allows for plugins to
reject unknown fields passed in at the top level.

Using JSON is preferable to CNI_ARGS since it allows namespaced and
structured data. CNI_ARGS is a flat list of KV pairs which has reserved
characters with no escaping rules defined.
CNI_ARGS may still be used by orchestrators that want the simplicity of
passing the network config JSON as specified by the user, unchanged
through to the CNI plugin. But for any kind of structured data, it's
recommended that the `args` field in the JSON is used instead.
2016-06-14 15:02:51 -07:00
Lee Calcote
4666a24b6d README: grammatical corrections 2016-06-14 09:54:15 -07:00
Pengfei Ni
0136a73037 pkg/ns: fix misspelling in comment 2016-06-14 09:52:58 -07:00
Stefan Junker
3bee295ba5 Merge pull request #240 from steveeJ/unmarshall-string
pkg/types: unmarshal string tests
2016-06-13 18:30:24 -07:00
Stefan Junker
3476000725 pkg/types: cover string for unmarshal tests 2016-06-13 18:18:36 -07:00
Stefan Junker
17dcf87589 Merge pull request #238 from tomdee/string-unmarshaller
pkg/types: Add UnmarshallableString type
2016-06-13 18:17:48 -07:00
Stefan Junker
c3c0803817 Merge pull request #243 from containernetworking/maintainers-update-email
MAINTAINERS: Update @tomdee email address
2016-06-10 01:41:42 +02:00
Tom Denham
0ffad38994 MAINTAINERS: Update @tomdee email address 2016-06-09 16:32:26 -07:00
Tom Denham
031567c216 pkg/types: Add UnmarshallableString type
Allow strings to be unmarshalled for CNI_ARGS

CNI_ARGS uses types.LoadArgs to populate a struct.
The fields in the struct must meet the TextUnmarshaler interface.

This code adds a UnmarshallableString type to assist with this.
2016-06-09 14:45:58 -07:00
Stefan Junker
c6864e1060 Merge pull request #229 from steveeJ/cleanup-travis
travis: cleanup and bump go versions
2016-06-02 20:43:11 +02:00
Minhan Xia
2445a960a9 plugins/ipam: round robin ip allocation for host-local ipam
This changes the ip allocation logic to round robin. Before this, host-local IPAM searched for available IPs from start of subnet. Hence it tends to allocate IPs that had been used recently. This is not ideal since it may cause collisions.
2016-06-02 20:37:05 +02:00
Tom Denham
5c3c171642 Merge pull request #239 from steveeJ/master
MAINTAINERS: remove @zachgersh, add @dcbw
v0.3.0
2016-06-02 09:00:07 -07:00
Michael Bridgen
4a292cd451 Merge pull request #218 from steveeJ/roadmap
Add ROADMAP document
2016-06-02 16:51:57 +01:00
Stefan Junker
f82af22b10 ROADMAP: initial version 2016-06-02 17:50:14 +02:00
Stefan Junker
4f9faf60bb MAINTAINERS: remove @zachgersh, add @dcbw
Thank you Zach for all the great work done on CNI, farewell!
At the same time we are happy to welcome Dan amongst us who has already
contributed lots of valuable work!
2016-06-02 01:15:24 +02:00
Stefan Junker
f44f4cf953 Merge pull request #219 from squaremo/more-contrib
docs: details on PR acceptance policy
2016-06-01 16:03:17 +02:00
Michael Bridgen
ddc0ca4791 docs: details on PR acceptance policy 2016-06-01 12:23:21 +01:00
Michael Bridgen
e90d8c12b1 Merge pull request #228 from jieyu/add_mesos
Added Mesos to CNI users.
2016-05-30 11:13:34 +01:00
Stefan Junker
ffff8ac2fd Merge pull request #231 from steveeJ/ns-verifiy-errors
pkg/ns: introduce error types to indicate NS verification
2016-05-27 15:57:40 +02:00
Stefan Junker
35f3a090b2 pkg/ns: introduce error types indicate NS verification v0.3.0-rc3 2016-05-27 13:50:16 +02:00
Stefan Junker
131ecc4055 Merge pull request #230 from steveeJ/netns-optional-on-del
plugins: don't require CNI_NETNS for DEL command
2016-05-27 13:49:05 +02:00
Stefan Junker
d582c9ce8f skel/test: add case for empty NETNS 2016-05-27 12:26:42 +02:00
Stefan Junker
72337159c1 plugins: don't require CNI_NETNS for DEL command
This will allow to free up the IPAM allocations when the caller doesn't
have access to the network namespace anymore, e.g. due to a reboot.
2016-05-27 10:57:39 +02:00
Stefan Junker
7f90f9d559 pkg/skel: allow arg requriements specified by CMD 2016-05-27 10:56:24 +02:00
Jie Yu
d6674e0f49 README: add Mesos as CNI users 2016-05-26 09:42:10 -07:00
Stefan Junker
3b5d7a3bb0 travis: use go1.5.4 2016-05-26 15:33:58 +02:00
Stefan Junker
572fcc7076 travis: cleanup and bump go versions
* cleanup structure
* explicitly use go-{1.5.3,1.6.2}
2016-05-26 14:43:18 +02:00
Stefan Junker
6f63d9d707 Merge pull request #227 from steveeJ/ns-verify
pkg/ns: consider PROCFS during NS verification
v0.3.0-rc2
2016-05-26 13:22:29 +02:00
Stefan Junker
3bab8a2805 pkg/ns: consider PROCFS during NS verification
This is an attempt to bring compatibility with Kernel <3.19, where NSFS
where PROCFS was used for network namespaces.
2016-05-26 12:42:50 +02:00
Stefan Junker
6fb30a6700 Merge pull request #222 from steveeJ/ns-check-path
pkg/ns: verify netns when initialized with GetNS
v0.3.0-rc1
2016-05-25 08:54:10 +02:00
Stefan Junker
d6751cea24 pkg/ns: test IsNSFS() 2016-05-24 22:30:49 +02:00
Stefan Junker
c43ccc703a pkg/ns: test case for rejecting a non-ns nspath 2016-05-24 22:30:49 +02:00
Stefan Junker
76ea259ff9 pkg/ns: verify netns when initialized with GetNS 2016-05-24 22:30:49 +02:00
Stefan Junker
c29cd52628 Merge pull request #223 from steveeJ/ns-respect-close
pkg/ns: don't allow operations after Close()
2016-05-24 22:16:09 +02:00
Stefan Junker
2de97b7e98 pkg/ns: add tests cases for Close()'d NS 2016-05-24 21:15:51 +02:00
Stefan Junker
b23895a7c7 pkg/ns: don't allow operations after Close() 2016-05-24 20:52:00 +02:00
Stefan Junker
984ef8117a Merge pull request #217 from steveeJ/fix-go-tip
build: don't be verbose / test: fix bash variable escaping in sudo command
v0.3.0-rc0
2016-05-21 01:55:57 +02:00
Stefan Junker
54c0cd2cad build: remove -x bash flag 2016-05-21 01:48:26 +02:00