Handle "weave expose" in weaver

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.
This commit is contained in:
Martynas Pumputis authored and Bryan Boreham committed 2017-10-17 12:08:43 +01:00
1 parent ea0e3a14e0
commit ade6738789
12 files changed
+151 -131

No files matched your search

+2 -5
View File
@@ -443,10 +443,8 @@ EOF
expose_ip() {
ipam_cidrs allocate_no_check_alive weave:expose $CIDR_ARGS
for CIDR in $ALL_CIDRS ; do
if ! ip addr show dev $BRIDGE | grep -qF $CIDR ; then
ip addr add dev $BRIDGE $CIDR
arp_update $BRIDGE $CIDR || true
fi
call_weave "POST" "/expose/$CIDR"
[ -z "$FQDN" ] || when_weave_running put_dns_fqdn_no_check_alive weave:expose $FQDN $CIDR
done
}
@@ -1484,7 +1482,6 @@ case "$COMMAND" in
fi
create_bridge
expose_ip
util_op expose-nat $ALL_CIDRS
show_addrs $ALL_CIDRS
;;
hide)