When plugins exit with non-zero code, they now
print a JSON with the error info to stdout. This
will parse this output and report that error.
Partly fixes#953
As discovered in #851 - some of the CNI plugins (for example, veth)
relies on the supplied `CNI_NETNS` as a source of uniqueness for things
like entropy. In theory this is reasonable because network namespace
paths should be unique per-pod. However, in rkt, the stage1 init (which
executes the plugins) was passing a relative path from its cwd, rather
than an absolute path - for example, "netns" rather than
"/var/lib/rkt/pods/<uuid>/netns".
As a consequence of this, every network plugin was executed with the
same value for `CNI_NETNS`. This results in conflicts when e.g. every
veth plugin attempts to create an interface by the same name, since they
do a straightforward hash of `CNI_NETNS` to generate interface names.
This should be considered an interim solution until this is definitively
answered in the upstream CNI specification.
https://github.com/appc/cni/issues/5
rktRoot is misleading as the directory is really the root of a specific
pod. Also add a TODO note that this is currently only ever set to cwd
(i.e. "."), and hence necessitates relative paths.
Since the spec requires AC_METADATA_URL env var,
well known IP is no longer needed. This removes
the iptables manipulation. Instead the IP address of the
host is passed in the AC_METADATA_URL. This host IP
is the address of the host end of the default veth.