First cut of adding hairpin functionality to weave

This commit is contained in:
Avi Deitcher authored and Bryan Boreham committed 2017-05-30 10:30:49 +00:00
1 parent ca64ab54e7
commit c05955d598
5 files changed
+27 -11

No files matched your search

+5 -2
View File
@@ -1070,17 +1070,20 @@ create_cni_config() {
cat >"$1" <<EOF
{
"name": "weave",
"type": "weave-net"
"type": "weave-net",
"hairpinMode": $2
}
EOF
}
setup_cni() {
# if env var HAIRPIN_MODE is not set, default it to true
HAIRPIN_MODE=${HAIRPIN_MODE:-true}
if install_cni_plugin $CNI_PLUGIN_DIR ; then
upgrade_cni_plugin $CNI_PLUGIN_DIR
fi
if [ -d $HOST_ROOT/etc/cni/net.d -a ! -f $HOST_ROOT/etc/cni/net.d/10-weave.conf ] ; then
create_cni_config $HOST_ROOT/etc/cni/net.d/10-weave.conf
create_cni_config $HOST_ROOT/etc/cni/net.d/10-weave.conf $HAIRPIN_MODE
fi
}