aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docker/octavia/octavia-api/Dockerfile.j23
-rw-r--r--docker/octavia/octavia-api/extend_start.sh8
-rw-r--r--docker/octavia/octavia-base/Dockerfile.j27
-rw-r--r--docker/octavia/octavia-base/extend_start.sh14
4 files changed, 32 insertions, 0 deletions
diff --git a/docker/octavia/octavia-api/Dockerfile.j2 b/docker/octavia/octavia-api/Dockerfile.j2
index 053d355a6..5968aeefb 100644
--- a/docker/octavia/octavia-api/Dockerfile.j2
+++ b/docker/octavia/octavia-api/Dockerfile.j2
@@ -19,6 +19,9 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
{% endif %}
+COPY extend_start.sh /usr/local/bin/kolla_octavia_extend_start
+RUN chmod 755 /usr/local/bin/kolla_octavia_extend_start
+
{% block octavia_api_footer %}{% endblock %}
{% block footer %}{% endblock %}
diff --git a/docker/octavia/octavia-api/extend_start.sh b/docker/octavia/octavia-api/extend_start.sh
new file mode 100644
index 000000000..2692046c9
--- /dev/null
+++ b/docker/octavia/octavia-api/extend_start.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
+# of the KOLLA_BOOTSTRAP variable being set, including empty.
+if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
+ octavia-db-manage upgrade head
+ exit 0
+fi
diff --git a/docker/octavia/octavia-base/Dockerfile.j2 b/docker/octavia/octavia-base/Dockerfile.j2
index 2287b859c..4aed75d44 100644
--- a/docker/octavia/octavia-base/Dockerfile.j2
+++ b/docker/octavia/octavia-base/Dockerfile.j2
@@ -27,4 +27,11 @@ RUN ln -s /octavia-base-source/* octavia \
&& chown -R octavia: /etc/octavia
{% endif %}
+
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+
+RUN touch /usr/local/bin/kolla_octavia_extend_start \
+ && chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_octavia_extend_start \
+ && usermod -a -G kolla octavia
+
{% block octavia_base_footer %}{% endblock %}
diff --git a/docker/octavia/octavia-base/extend_start.sh b/docker/octavia/octavia-base/extend_start.sh
new file mode 100644
index 000000000..dfdaafe8c
--- /dev/null
+++ b/docker/octavia/octavia-base/extend_start.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+set -o errexit
+
+OCTAVIA_LOG_DIR=/var/log/kolla/octavia
+
+if [[ ! -d "${OCTAVIA_LOG_DIR}" ]]; then
+ mkdir -p ${OCTAVIA_LOG_DIR}
+fi
+if [[ $(stat -c %a ${OCTAVIA_LOG_DIR}) != "755" ]]; then
+ chmod 755 ${OCTAVIA_LOG_DIR}
+fi
+
+. /usr/local/bin/kolla_octavia_extend_start