Rename prog/plugin-v2 to prog/net-plugin

Consensus was to call the plugin-v2 as weaveworks/net-plugin.
This commit is contained in:
Martynas Pumputis authored and Bryan Boreham committed 2017-04-12 13:05:40 +00:00
1 parent 735a7f9154
commit 4a708c2a82
5 files changed
+9 -9

No files matched your search

+75
View File
@@ -0,0 +1,75 @@
{
"description": "Weave Net plugin for Docker",
"documentation": "https://weave.works",
"entrypoint": [
"/home/weave/launch.sh"
],
"interface": {
"socket": "weave.sock",
"types": [
"docker.networkdriver/1.0"
]
},
"linux": {
"capabilities": [
"CAP_SYS_ADMIN",
"CAP_NET_ADMIN"
]
},
"mounts": [
{
"destination": "/host/proc/",
"type": "bind",
"source": "/proc/",
"options": ["rbind", "rw"]
},
{
"destination": "/var/run/docker.sock",
"source": "/var/run/docker.sock",
"type": "bind",
"options": ["rbind"]
},
{
"destination": "/host/var/lib/",
"source": "/var/lib/",
"type": "bind",
"options": ["rbind"]
},
{
"destination": "/host/etc/",
"source": "/etc/",
"type": "bind",
"options": ["rbind"]
}
],
"env": [
{
"description": "Extra args to `weaver` and `plugin`",
"name": "EXTRA_ARGS",
"settable": [
"value"
],
"value": ""
},
{
"description": "Encryption password",
"name": "WEAVE_PASSWORD",
"settable": [
"value"
],
"value": ""
},
{
"description": "MTU",
"name": "WEAVE_MTU",
"settable": [
"value"
],
"value": ""
}
],
"network": {
"type": "host"
},
"workdir": ""
}
+60
View File
@@ -0,0 +1,60 @@
#!/bin/sh
set -e
# Default if not supplied - same as weave net default
IPALLOC_RANGE=${IPALLOC_RANGE:-10.32.0.0/12}
HTTP_ADDR=${WEAVE_HTTP_ADDR:-127.0.0.1:6784}
STATUS_ADDR=${WEAVE_STATUS_ADDR:-0.0.0.0:6782}
HOST_ROOT=${HOST_ROOT:-/host}
WEAVE_DIR="/host/var/lib/weave"
mkdir $WEAVE_DIR || true
echo "Starting launch.sh"
# Check if the IP range overlaps anything existing on the host
/usr/bin/weaveutil netcheck $IPALLOC_RANGE weave
# TODO(mp) add wait for swarm
SWARM_MANAGER_PEERS=$(/usr/bin/weaveutil swarm-manager-peers)
! /usr/bin/weaveutil is-swarm-manager || IS_SWARM_MANAGER=1
# Prevent from restoring from a persisted peers list
rm -f "/restart.sentinel"
/home/weave/weave --local create-bridge \
--proc-path=/host/proc \
--weavedb-dir-path=$WEAVE_DIR \
--force
BRIDGE_OPTIONS="--datapath=datapath"
if [ "$(/home/weave/weave --local bridge-type)" = "bridge" ]; then
# TODO: Call into weave script to do this
if ! ip link show vethwe-pcap >/dev/null 2>&1; then
ip link add name vethwe-bridge type veth peer name vethwe-pcap
ip link set vethwe-bridge up
ip link set vethwe-pcap up
ip link set vethwe-bridge master weave
fi
BRIDGE_OPTIONS="--iface=vethwe-pcap"
fi
if [ -z "$IPALLOC_INIT" ]; then
IPALLOC_INIT="observer"
if [ "$IS_SWARM_MANAGER" == "1" ]; then
IPALLOC_INIT="consensus=$(echo $SWARM_MANAGER_PEERS | wc -l)"
fi
fi
exec /home/weave/weaver $EXTRA_ARGS --port=6783 $BRIDGE_OPTIONS \
--http-addr=$HTTP_ADDR --status-addr=$STATUS_ADDR \
--no-dns \
--ipalloc-range=$IPALLOC_RANGE \
--ipalloc-init $IPALLOC_INIT \
--nickname "$(hostname)" \
--log-level=debug \
--db-prefix="$WEAVE_DIR/weave" \
--plugin-v2 \
--plugin-mesh-socket='' \
$(echo $SWARM_MANAGER_PEERS | tr '\n' ' ')