Merge pull request #2659 from weaveworks/issues/2581-optional-bridge-nf

Optional bridge-nf detection
This commit is contained in:
Bryan Boreham authored and GitHub committed 2016-11-28 18:09:40 -08:00
commit d501c78795
1 file changed
+6 -5
+6 -5
View File
@@ -14,13 +14,14 @@ STATUS_ADDR=${WEAVE_STATUS_ADDR:-0.0.0.0:6782}
EXPECT_NPC=${EXPECT_NPC:-1}
# kube-proxy requires that bridged traffic passes through netfilter
if [ ! -f /proc/sys/net/bridge/bridge-nf-call-iptables ] ; then
echo /proc/sys/net/bridge/bridge-nf-call-iptables not found >&2
exit 1
if ! BRIDGE_NF_ENABLED=$(cat /proc/sys/net/bridge/bridge-nf-call-iptables); then
echo "Cannot detect bridge-nf support - network policy and iptables mode kubeproxy may not work reliably" >&2
else
if [ "$BRIDGE_NF_ENABLED" != "1" ]; then
echo 1 > /proc/sys/net/bridge/bridge-nf-call-iptables
fi
fi
echo 1 > /proc/sys/net/bridge/bridge-nf-call-iptables
SOURCE_BINARY=/usr/bin/weaveutil
VERSION=$(/home/weave/weaver $EXTRA_ARGS --version | sed -e 's/weave router //')
PLUGIN="weave-plugin-$VERSION"