Commit Graph

913 Commits

Author SHA1 Message Date
fd150a4c97 skel: Plugins require a cniVersion in the NetConf 2016-09-18 21:30:57 -07:00
56032390fe Merge pull request #287 from rosenhouse/multi-version
Plugins report a list of supported versions
2016-09-12 13:44:14 -07:00
3f4011b3ec Merge pull request #295 from rosenhouse/update-readme-cloudfoundry-link
readme: update link to CloudFoundry usage of CNI
2016-09-08 00:47:04 -04:00
d32ccb1899 readme: update link to CloudFoundry usage of CNI 2016-09-06 23:48:48 -04:00
de91f31ae7 versioning: revert spec version to 0.2.0 2016-09-06 15:37:42 -04:00
7958b9f0cc versioning: revert spec version to 0.2.0 2016-09-06 15:37:42 -04:00
bf6948da19 versioning: misc cleanups
highlights:
 - NetConf struct finally includes cniVersion field
 - improve test coverage of current version report behavior
 - godoc a few key functions
 - allow tests to control version list reported by no-op plugin
2016-09-06 15:35:58 -04:00
d5e2e375d4 versioning: misc cleanups
highlights:
 - NetConf struct finally includes cniVersion field
 - improve test coverage of current version report behavior
 - godoc a few key functions
 - allow tests to control version list reported by no-op plugin
2016-09-06 15:35:58 -04:00
07a8a28637 Merge pull request #294 from dcbw/host-local-ranges
Fix handling of host-local IP address ranges
2016-09-05 23:24:42 -04:00
95a9ea0bd2 host-local: don't allocate the broadcast address or allow invalid networks
There aren't any IPs to allocate in /32 or /31 networks, so don't allow them.
2016-09-02 17:20:09 -05:00
959af1e6ab host-local: ensure requested IPs are within the given range
And also make sure that RangeStart and RangeEnd are sane.
2016-09-02 16:52:29 -05:00
dfc4f7cd2a host-local: don't allocate past RangeEnd
When RangeEnd is given, a.end = RangeEnd+1.

If when getSearchRange() is called and lastReservedIP equals
RangeEnd, a.nextIP() only compares lastReservedIP (which in this
example is RangeEnd) against a.end (which in this example is
RangeEnd+1) and they clearly don't match, so a.nextIP() returns
start=RangeEnd+1 and end=RangeEnd.

Get() happily allocates RangeEnd+1 because it only compares 'cur'
to the end returned by getSearchRange(), not to a.end, and thus
allocates past RangeEnd.

Since a.end is inclusive (eg, host-local will allocate a.end) the
fix is to simply set a.end equal to RangeEnd.
2016-09-02 16:37:34 -05:00
2f97407396 invoke: better name and unit test coverage for GetVersionInfo 2016-09-02 16:39:01 -04:00
bf31ed1591 invoke: better name and unit test coverage for GetVersionInfo 2016-09-02 16:39:01 -04:00
f467134838 invoke: correctly infer version for 0.1.0-vintage plugins
Older plugins return a known error when issued the VERSION command.
Capture this error and report it as a 0.1.0 version plugin.
2016-09-02 16:02:07 -04:00
97192fc979 invoke: correctly infer version for 0.1.0-vintage plugins
Older plugins return a known error when issued the VERSION command.
Capture this error and report it as a 0.1.0 version plugin.
2016-09-02 16:02:07 -04:00
2142c076ab versioning: adds tooling to compile a program against a given old CNI version
Allows us to write tests that cover interactions between components of
differing versions
2016-09-02 16:02:02 -04:00
deb4466041 versioning: adds tooling to compile a program against a given old CNI version
Allows us to write tests that cover interactions between components of
differing versions
2016-09-02 16:02:02 -04:00
bd3ade0c54 pkg/invoke: refactor plugin exec and backfill unit tests 2016-09-02 15:59:25 -04:00
dea1c6e44d pkg/invoke: refactor plugin exec and backfill unit tests 2016-09-02 15:59:25 -04:00
383c84031e versioning: document meaning of 'Legacy' version support 2016-09-02 11:26:17 -04:00
adf28a84c6 versioning: document meaning of 'Legacy' version support 2016-09-02 11:26:17 -04:00
b1e254d901 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
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
c5e39a87f7 Merge pull request #293 from rosenhouse/backfill-invoke-exec-tests
Backfill tests for plugin execution
2016-08-31 20:49:08 -04:00
63ace9e496 Merge pull request #293 from rosenhouse/backfill-invoke-exec-tests
Backfill tests for plugin execution
2016-08-31 20:49:08 -04:00
e0ea82b229 Merge pull request #290 from asridharan/dcos
Fixed the check for network namespace path.
2016-08-31 18:19:02 -05:00
26241a517a Merge pull request #290 from asridharan/dcos
Fixed the check for network namespace path.
2016-08-31 18:19:02 -05:00
7281d5792a pkg/ns: fixed the check for network namespace path.
The expectation on older kernels (< 3.19) was to have the network
namespace always be a directory. This is not true if the network
namespace is bind mounted to a file, and will make the plugin fail
erroneously in such cases. The fix is to remove this assumption
completely and just do a basic check on the file system types being
returned.

Fixes #288
2016-08-31 21:41:00 +00:00
1ce5e54e99 pkg/ns: fixed the check for network namespace path.
The expectation on older kernels (< 3.19) was to have the network
namespace always be a directory. This is not true if the network
namespace is bind mounted to a file, and will make the plugin fail
erroneously in such cases. The fix is to remove this assumption
completely and just do a basic check on the file system types being
returned.

Fixes #288
2016-08-31 21:41:00 +00:00
4d77bc177c Merge pull request #291 from tomdee/SetupVeth
pkg/ip: Ensure that SetupVeth returns correct hostVeth
2016-08-31 16:32:09 -05:00
31ef82276a pkg/ip: Ensure that SetupVeth returns correct hostVeth
The veth is moved from the container NS to the host NS.
This is handled by the code that sets the link to UP but the wrong
hostVeth is returned to the calling code.
2016-08-31 14:17:25 -07:00
726c6b4578 pkg/ip: Ensure that SetupVeth returns correct hostVeth
The veth is moved from the container NS to the host NS.
This is handled by the code that sets the link to UP but the wrong
hostVeth is returned to the calling code.
2016-08-31 14:17:25 -07:00
d3ecadb860 invoke: backfill tests for plugin execution 2016-08-30 23:52:47 -04:00
0e675fa14f invoke: backfill tests for plugin execution 2016-08-30 23:52:47 -04:00
9d5e6e60e7 Merge pull request #241 from luxas/add_platforms
Add arm64 and ppc64le as new platforms
2016-08-13 15:11:28 -07:00
39f8436a8b release: Release binaries for arm, arm64 and ppc64le too
Modify the releasing script to cross-compile for the new architectures, but also keep backwards-compability

ref #209
2016-08-13 12:45:04 +03:00
21d25959ee travis: Cross-compile for arm, arm64 and ppc64le on every build
Cross-compile cni for arm, arm64 and ppc64le with go1.6 only
Allow go tip to fail
Set fast_finish to true, which means travis will instantly return build failure when any of the required builds fail

ref #209
2016-08-13 12:44:45 +03:00
fc58b79b45 build: Update the build script to make it possible to build for other architectures
This makes it possible to cross-compile cni like so:
$ GOARCH=arm ./build
$ GOARCH=arm64 ./build
$ GOARCH=ppc64le ./build

ref #209
2016-08-13 12:44:28 +03:00
488db88fd1 vendor: Bump golang.org/x/sys/unix to a newer version
The current vendor of sys/unix is really old, and doesn't work on arm64 and ppc64le
Updating to the latest version might also fix other issues

ref #209
2016-08-13 12:44:04 +03:00
787d59ab5d Merge pull request #267 from rosenhouse/version-cmd
Adds VERSION command
2016-08-12 15:06:22 -07:00
415d707faf Merge pull request #267 from rosenhouse/version-cmd
Adds VERSION command
2016-08-12 15:06:22 -07:00
349d66d51c Merge pull request #267 from rosenhouse/version-cmd
Adds VERSION command
2016-08-12 15:06:22 -07:00
5a67f5d6fb Merge pull request #273 from zreigz/reconfigure-bridge-ip
Reconfigure bridge IP address
2016-08-12 15:04:22 -07:00
60bb795c2e Merge pull request #274 from lukasredynk/update_netlink
Update of netlink version
2016-08-12 13:07:26 -07:00
113dfd61bd Merge pull request #280 from prateekgogia/bug-fix-155
pkg/ip: Return correct error if container name provided exists, and test cases
2016-08-12 13:04:49 -07:00
3c1d4581c4 pkg/ip: Return correct error if container name provided exists, and test cases
If interface name for a container provided by a user is already present,
Veth creation fails with incorrect error.
If os.IsExist error is returned by makeVethPair:
* Check for peer name, if exists generate another random peer name,
* else, IsExist error is due to container interface present, return error.

Fixes #155
2016-08-11 18:51:03 +00:00
ad8a052dd3 pkg/ip: Return correct error if container name provided exists, and test cases
If interface name for a container provided by a user is already present,
Veth creation fails with incorrect error.
If os.IsExist error is returned by makeVethPair:
* Check for peer name, if exists generate another random peer name,
* else, IsExist error is due to container interface present, return error.

Fixes #155
2016-08-11 18:51:03 +00:00
8cb3a9323a libcni: add util function InjectConf 2016-08-08 13:21:25 +02:00
7c579af789 Merge pull request #277 from steveeJ/test-allocator-reserveip
ipam/host-local/allocator tests: cover requested IP
2016-08-02 14:43:43 -07:00