1649 Commits

Author SHA1 Message Date
Stefan Junker
7d19c01818 pkg/ip: use iface name in SetHWAddrByIP 2016-07-22 15:34:53 -07:00
Stefan Junker
1a04d9abba pkg/ip tests: cover SetupVeth and DelLinkByName* 2016-07-22 15:34:53 -07:00
Stefan Junker
8e1c215116 pkg/ip tests: cover SetupVeth and DelLinkByName* 2016-07-22 15:34:53 -07:00
Stefan Junker
b6137de993 plugins: set MAC addresses based on IP
This will give deterministic MAC addresses for all interfaces CNI
creates and manages the IP for:
* bridge: container veth and host bridge
* macvlan: container veth
* ptp: container veth and host veth
2016-07-22 15:34:53 -07:00
Stefan Junker
924b30b57d plugins: set MAC addresses based on IP
This will give deterministic MAC addresses for all interfaces CNI
creates and manages the IP for:
* bridge: container veth and host bridge
* macvlan: container veth
* ptp: container veth and host veth
2016-07-22 15:34:53 -07:00
Stefan Junker
c3e8563e77 pkg/utils/hwaddr: migrate code from IPAM pkg 2016-07-22 15:18:38 -07:00
Stefan Junker
3a1354cff6 pkg/utils/hwaddr: migrate code from IPAM pkg 2016-07-22 15:18:38 -07:00
Stefan Junker
7ea07a6405 pkg/ipam{,test}: improve error handling and tests
* _suite.go and _test.go file should be in the same package, using the
  _test package for that, which requires some fields and methods to be
  exported
* Introduce error type for cleaner error handling
* test adaptions for error type checking
2016-07-22 15:17:22 -07:00
Stefan Junker
96867eae05 pkg/ipam{,test}: improve error handling and tests
* _suite.go and _test.go file should be in the same package, using the
  _test package for that, which requires some fields and methods to be
  exported
* Introduce error type for cleaner error handling
* test adaptions for error type checking
2016-07-22 15:17:22 -07:00
Minhan Xia
75f1fa2260 add tests for generateHardwardAddr 2016-07-22 15:01:57 -07:00
Minhan Xia
1c1424c472 add tests for generateHardwardAddr 2016-07-22 15:01:57 -07:00
Minhan Xia
c19b82efc2 configure mac address based on assigned ip 2016-07-22 14:57:52 -07:00
Minhan Xia
b2e53181d1 configure mac address based on assigned ip 2016-07-22 14:57:52 -07:00
Gabe Rosenhouse
39a8fe4766 Merge pull request #270 from rosenhouse/integration-tests
Add integration tests of libcni
2016-07-22 13:36:20 -07:00
Gabe Rosenhouse
c657c61767 plugins: cleanup tests of no-op plugin 2016-07-22 13:30:55 -07:00
Gabe Rosenhouse
424a8b38cf README: distinguish between runtimes and plugins
Adds a link to the 3rd party SR-IOV plugin.
2016-07-22 13:22:35 -07:00
Gabe Rosenhouse
04fbde4ce8 docs: fix tuning doc, correct the result json
it does not report the version, it never did
2016-07-21 13:06:05 -07:00
Gabe Rosenhouse
dfd2c142ae docs: fix tuning doc, correct the result json
it does not report the version, it never did
2016-07-21 13:06:05 -07:00
Gabe Rosenhouse
7bc96f05bb spec: add version command and increment version to 0.2.0 2016-07-21 12:59:08 -07:00
Gabe Rosenhouse
0506bae8fc spec: remove CNI_VERSION env var, was never been implemented
No one uses this, and it is causing confusion (see #150)
2016-07-20 13:39:51 -07:00
Gabe Rosenhouse
bacdc3668d libcni: add integration test coverage 2016-07-15 13:01:08 -07:00
Gabe Rosenhouse
6496749565 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
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
728071e7d1 misc: fix up copyright dates 2016-07-14 16:09:27 -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
30c99d17cc pkg/skel: plugins now respond to VERSION command
To support CNI spec versioning, plugins must be able to report version
information to container runtimes.
2016-07-14 00:24:32 -04:00
Gabe Rosenhouse
63755d7c57 pkg/skel: plugins now respond to VERSION command
To support CNI spec versioning, plugins must be able to report version
information to container runtimes.
2016-07-14 00:24:32 -04:00
Gabe Rosenhouse
eda79f7645 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
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
f2b6ec0375 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
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
3c43314926 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
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
bd341ab5d1 pkg/ns: fix misspelling in comment 2016-06-14 09:52:58 -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
d48cb53715 pkg/types: cover string for unmarshal tests 2016-06-13 18:18:36 -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
efc0f2987f 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