The change makes "weave expose" to call the "/expose" HTTP
endpoint implemented in router which exposes the bridge.
Such architectural change required as we need to know whether NPC is
enabled when exposing the bridge and weaver knows this fact the best.
Unfortunately, this change makes impossible to "weave expose"
when weaver is not running.
"docker.sock" is used to access Docker API which is required to:
1. subscribe to Docker events to configure-arp,
2. query Docker network info to detect whether multicast should be
enabled.
3. get list of Swarm peers before starting the plugin.
(1) is currently not implemented.
(2) is replaced by WEAVE_MULTICAST env var which
can enable multicast for all Weave networks created by
the plugin (not ideal, but better than nothing).
(3) is fixed by not removing "restart.sentinel".
Fixes#2921, as all errors are now ignored, including `ENOENT`.
This command typically attempts to delete the network interface `eth0` of a container being destroyed by Kubernetes.
If this interface has already been destroyed or is missing for whatever reason, we still want to remove this container's entry from IPAM in order to free associated resources.
Docker Plugin V2 does not expose a plugin name to the plugin, so we
check for "net-plugin" within driver name of a network to detect
whether network is ours.
- "noDNS" controls whether upon ContainerStarted event a container
should be registered within the Weave DNS.
- "isPluginV2" will be used to determine a path to host's /proc.
NetworkAllocate is called on Swarm master node which creates a network.
The return option map is used to describe the network, and is passed
to CreateNetwork which is called on all nodes when a service is
created.
Returning nil instead the actual options made Docker to omit
the "works.weave.multicast" flag, thus no multicast could be used
in Swarm.
This simplifies the following:
- plugin-v2 does not need to start "plugin" as a separate process, thus
Docker is able to properly restart plugin-v2 in a case of any child
process failing.
- No need for weaveplugin container.
plugin is enabled by default when running "weave launch". when starting
only the router, you should pass "--plugin" parameter to enable it.
The env var WEAVE_NO_PLUGIN is no more.