Skip to content

Commit

Permalink
fix: cniserver wait ovs ready
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed Dec 22, 2019
1 parent a3e6c62 commit 182bb15
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions dist/images/start-cniserver.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
#!/usr/bin/env bash
set -euo pipefail

SOCK=/run/openvswitch/kube-ovn-daemon.sock
CNI_SOCK=/run/openvswitch/kube-ovn-daemon.sock
OVS_SOCK=/run/openvswitch/db.sock

if [[ -e "$SOCK" ]]
if [[ -e "$CNI_SOCK" ]]
then
echo "previous socket exists, remove and continue"
rm ${SOCK}
rm ${CNI_SOCK}
fi

./kube-ovn-daemon --ovs-socket=/run/openvswitch/db.sock --bind-socket=${SOCK} $@
while true
do
sleep 5
if [[ -e "$OVS_SOCK" ]]
then
break
else
echo "waiting for ovs ready"
fi
done

./kube-ovn-daemon --ovs-socket=${OVS_SOCK} --bind-socket=${CNI_SOCK} $@

0 comments on commit 182bb15

Please sign in to comment.