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

Commit

Permalink
Move CNI config file to the end of launch script
Browse files Browse the repository at this point in the history
So something waiting for the config (e.g. Kubernetes) doesn't try to
talk to Weave before then (this only helps on first install, but that
tends to be when things are busiest).
  • Loading branch information
bboreham committed Nov 14, 2016
1 parent 49f5c02 commit 0f0a74c
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions prog/weave-kube/launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,6 @@ fi

echo 1 > /proc/sys/net/bridge/bridge-nf-call-iptables

# Create CNI config, if not already there
if [ ! -f /etc/cni/net.d/10-weave.conf ] ; then
mkdir -p /etc/cni/net.d
cat > /etc/cni/net.d/10-weave.conf <<EOF
{
"name": "weave",
"type": "weave-net"
}
EOF
fi

SOURCE_BINARY=/usr/bin/weaveutil
VERSION=$(/home/weave/weaver $EXTRA_ARGS --version | sed -E 's/weave router (.*?)/\1/')
PLUGIN="weave-plugin-$VERSION"
Expand Down Expand Up @@ -152,4 +141,15 @@ done
reclaim_ips "_" $IPS
done

# Create CNI config, if not already there
if [ ! -f /etc/cni/net.d/10-weave.conf ] ; then
mkdir -p /etc/cni/net.d
cat > /etc/cni/net.d/10-weave.conf <<EOF
{
"name": "weave",
"type": "weave-net"
}
EOF
fi

wait $WEAVE_PID

0 comments on commit 0f0a74c

Please sign in to comment.