Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Fix to use 10-weave.conflist instead of 10-weave.conf with support fo…
Browse files Browse the repository at this point in the history
…r portmap

as additional plugin along with weave-net

Fixes #3016
  • Loading branch information
murali-reddy committed Jul 27, 2018
1 parent 90a81ce commit d4ad7c1
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions weave
Original file line number Diff line number Diff line change
Expand Up @@ -728,9 +728,20 @@ upgrade_cni_plugin() {
create_cni_config() {
cat >"$1" <<EOF
{
"cniVersion": "0.3.0",
"name": "weave",
"type": "weave-net",
"hairpinMode": $2
"plugins": [
{
"name": "weave",
"type": "weave-net",
"hairpinMode": $2
},
{
"type": "portmap",
"capabilities": {"portMappings": true},
"snat": true
}
]
}
EOF
}
Expand All @@ -741,8 +752,11 @@ setup_cni() {
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 $HAIRPIN_MODE
if [ -f $HOST_ROOT/etc/cni/net.d/10-weave.conf ] ; then
rm $HOST_ROOT/etc/cni/net.d/10-weave.conf
fi
if [ ! -f $HOST_ROOT/etc/cni/net.d/10-weave.conflist ] ; then
create_cni_config $HOST_ROOT/etc/cni/net.d/10-weave.conflist $HAIRPIN_MODE
fi
}

Expand Down

0 comments on commit d4ad7c1

Please sign in to comment.