Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix v2plugin startcontiv.sh for netplugin updates #1086

Merged
merged 2 commits into from
Nov 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion install/v2plugin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ LABEL maintainer "Cisco Contiv (https://contiv.github.io)"

RUN mkdir -p /run/docker/plugins /etc/openvswitch /var/run/contiv/log \
&& echo 'http://dl-cdn.alpinelinux.org/alpine/v3.4/main' >> /etc/apk/repositories \
&& apk --no-cache add openvswitch=2.5.0-r0 iptables ca-certificates openssl curl
&& apk --no-cache add \
openvswitch=2.5.0-r0 iptables ca-certificates openssl curl bash

# copy in binaries and scripts
ARG TAR_FILE
Expand Down
31 changes: 20 additions & 11 deletions install/v2plugin/startcontiv.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

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

set +e

echo "Starting Netplugin " >> $BOOTUP_LOGFILE
while true ; do
echo "/netplugin $dbg_flag --plugin-mode=$plugin_mode $vxlan_port_cfg --vlan-if=$iflist $store_arg $ctrl_ip_cfg $vtep_ip_cfg" >> $BOOTUP_LOGFILE
/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
echo "CRITICAL : Net Plugin has exited, Respawn in 5" >> $BOOTUP_LOGFILE
mv $log_dir/netplugin.log $log_dir/netplugin.log.lastrun
sleep 5
echo "Restarting Netplugin " >> $BOOTUP_LOGFILE
done &

if [ $plugin_role == "master" ]; then
if [ -z "$fwd_mode" ]; then
echo "fwd_mode is not set, plugin cannot be enabled"
Expand Down Expand Up @@ -116,4 +106,23 @@ else
echo "Not starting netmaster as plugin role is" $plugin_role >> $BOOTUP_LOGFILE
fi

if [[ "$fwd_mode" == "bridge" ]]; then
network_mode=vlan
else
network_mode=vxlan
fi

echo "Starting Netplugin"
while true ; do
set -x
/netplugin $dbg_flag --plugin-mode=$plugin_mode $vxlan_port_cfg \
--vlan-if=$iflist $store_arg $ctrl_ip_cfg $vtep_ip_cfg \
--netmode $network_mode --fwdmode $fwd_mode &> $log_dir/netplugin.log
set +x
echo "CRITICAL : Net Plugin has exited, Respawn in 5"
mv $log_dir/netplugin.log $log_dir/netplugin.log.lastrun
sleep 5
echo "Restarting Netplugin"
done &

while true; do sleep 1; done