Skip to content

Commit f5ea71a

Browse files
committed
fix v2plugin startcontiv.sh for netplugin updates
run startcontiv.sh with bash start netplugin after netmaster set network and forward modes for v2plugin netplugin will not start without setting the network and forward modes Signed-off-by: Chris Plock <[email protected]>
1 parent 0b5fd56 commit f5ea71a

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

install/v2plugin/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ LABEL maintainer "Cisco Contiv (https://contiv.github.io)"
55

66
RUN mkdir -p /run/docker/plugins /etc/openvswitch /var/run/contiv/log \
77
&& echo 'http://dl-cdn.alpinelinux.org/alpine/v3.4/main' >> /etc/apk/repositories \
8-
&& apk --no-cache add openvswitch=2.5.0-r0 iptables ca-certificates openssl curl \
8+
&& apk --no-cache add \
9+
openvswitch=2.5.0-r0 iptables ca-certificates openssl curl bash \
910
&& wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/andyshinn/alpine-pkg-glibc/master/sgerrand.rsa.pub \
1011
&& wget https://github.com/andyshinn/alpine-pkg-glibc/releases/download/2.23-r1/glibc-2.23-r1.apk \
1112
&& apk --no-cache add glibc-2.23-r1.apk

install/v2plugin/startcontiv.sh

+20-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
### Pre-requisite on the host
44
# run a cluster store like etcd or consul
@@ -71,16 +71,6 @@ echo "Started OVS, logs in $log_dir" >> $BOOTUP_LOGFILE
7171

7272
set +e
7373

74-
echo "Starting Netplugin " >> $BOOTUP_LOGFILE
75-
while true ; do
76-
echo "/netplugin $dbg_flag --plugin-mode=$plugin_mode $vxlan_port_cfg --vlan-if=$iflist $store_arg $ctrl_ip_cfg $vtep_ip_cfg" >> $BOOTUP_LOGFILE
77-
/netplugin $dbg_flag --plugin-mode=$plugin_mode $vxlan_port_cfg --vlan-if=$iflist $store_arg $ctrl_ip_cfg $vtep_ip_cfg &> $log_dir/netplugin.log
78-
echo "CRITICAL : Net Plugin has exited, Respawn in 5" >> $BOOTUP_LOGFILE
79-
mv $log_dir/netplugin.log $log_dir/netplugin.log.lastrun
80-
sleep 5
81-
echo "Restarting Netplugin " >> $BOOTUP_LOGFILE
82-
done &
83-
8474
if [ $plugin_role == "master" ]; then
8575
if [ -z "$fwd_mode" ]; then
8676
echo "fwd_mode is not set, plugin cannot be enabled"
@@ -116,4 +106,23 @@ else
116106
echo "Not starting netmaster as plugin role is" $plugin_role >> $BOOTUP_LOGFILE
117107
fi
118108

109+
if [[ "$fwd_mode" == "bridge" ]]; then
110+
network_mode=vlan
111+
else
112+
network_mode=vxlan
113+
fi
114+
115+
echo "Starting Netplugin"
116+
while true ; do
117+
set -x
118+
/netplugin $dbg_flag --plugin-mode=$plugin_mode $vxlan_port_cfg \
119+
--vlan-if=$iflist $store_arg $ctrl_ip_cfg $vtep_ip_cfg \
120+
--netmode $network_mode --fwdmode $fwd_mode &> $log_dir/netplugin.log
121+
set +x
122+
echo "CRITICAL : Net Plugin has exited, Respawn in 5"
123+
mv $log_dir/netplugin.log $log_dir/netplugin.log.lastrun
124+
sleep 5
125+
echo "Restarting Netplugin"
126+
done &
127+
119128
while true; do sleep 1; done

0 commit comments

Comments
 (0)