summaryrefslogtreecommitdiff
path: root/docker/openvswitch/openvswitch-vswitchd
diff options
context:
space:
mode:
authorSam Yaple <sam@yaple.net>2015-09-28 11:10:17 +0000
committerSam Yaple <sam@yaple.net>2015-09-28 11:10:17 +0000
commit76920be5fad2bb58680fd21681713b236bea7edf (patch)
tree39ff059f796f1151fa9e0275ba825c751de9a5d4 /docker/openvswitch/openvswitch-vswitchd
parenta0ac8764948f2dba28f648d053cd0a68d8c3e78d (diff)
downloadkolla-76920be5fad2bb58680fd21681713b236bea7edf.tar.gz
kolla-76920be5fad2bb58680fd21681713b236bea7edf.zip
Rename ovs to openvswitch
Our openvswitch image does not follow the naming convention of any of our other containers and it should. Change-Id: If1b815117bb39df74061218e48778479b8d674bc Closes-Bug: #1500392
Diffstat (limited to 'docker/openvswitch/openvswitch-vswitchd')
-rw-r--r--docker/openvswitch/openvswitch-vswitchd/Dockerfile.j29
-rwxr-xr-xdocker/openvswitch/openvswitch-vswitchd/ovs_ensure_configured.sh17
-rwxr-xr-xdocker/openvswitch/openvswitch-vswitchd/start.sh9
3 files changed, 35 insertions, 0 deletions
diff --git a/docker/openvswitch/openvswitch-vswitchd/Dockerfile.j2 b/docker/openvswitch/openvswitch-vswitchd/Dockerfile.j2
new file mode 100644
index 000000000..8dbd6548a
--- /dev/null
+++ b/docker/openvswitch/openvswitch-vswitchd/Dockerfile.j2
@@ -0,0 +1,9 @@
+FROM {{ namespace }}/{{ image_prefix }}openvswitch-base:{{ tag }}
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+COPY start.sh /
+COPY ovs_ensure_configured.sh /opt/kolla/
+
+CMD ["/start.sh"]
+
+{{ include_footer }}
diff --git a/docker/openvswitch/openvswitch-vswitchd/ovs_ensure_configured.sh b/docker/openvswitch/openvswitch-vswitchd/ovs_ensure_configured.sh
new file mode 100755
index 000000000..c39d64ff7
--- /dev/null
+++ b/docker/openvswitch/openvswitch-vswitchd/ovs_ensure_configured.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+bridge=$1
+port=$2
+
+ovs-vsctl br-exists $bridge; rc=$?
+if [[ $rc == 2 ]]; then
+ changed=changed
+ ovs-vsctl add-br $bridge
+fi
+
+if [[ ! $(ovs-vsctl list-ports $bridge) =~ $(echo "\<$port\>") ]]; then
+ changed=changed
+ ovs-vsctl add-port $bridge $port
+fi
+
+echo $changed
diff --git a/docker/openvswitch/openvswitch-vswitchd/start.sh b/docker/openvswitch/openvswitch-vswitchd/start.sh
new file mode 100755
index 000000000..b72ba5a2e
--- /dev/null
+++ b/docker/openvswitch/openvswitch-vswitchd/start.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+set -o errexit
+
+# Loading common functions.
+source /opt/kolla/kolla-common.sh
+
+modprobe openvswitch
+
+exec $CMD