From 91ca8d4b00c632bcf7a2a9903aa4cf584fee27e9 Mon Sep 17 00:00:00 2001 From: Martin André Date: Mon, 1 Dec 2014 14:50:58 +0900 Subject: Cleanup required variables checks for all containers This allows Kubernetes to reschedule containers in case a required variable is missing, for example when the Kubernetes pod is started before the service. The checks were cleaned using the following method: * remove duplicates * remove check for variables that get a default value in the same file * check for all variables used in the file * check for required services when it is obvious. Change-Id: Ib7e0530c410c61f828d36efe8925a20dc9781eab --- docker/cinder/start.sh | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'docker/cinder') diff --git a/docker/cinder/start.sh b/docker/cinder/start.sh index 12dcf3dc1..4508d96f4 100755 --- a/docker/cinder/start.sh +++ b/docker/cinder/start.sh @@ -1,29 +1,21 @@ #!/bin/bash -e -: ${CINDER_DB_USER%:=cinder} +: ${CINDER_DB_USER:=cinder} : ${CINDER_DB_NAME:=cinder} : ${KEYSTONE_AUTH_PROTOCOL:=http} : ${CINDER_KEYSTONE_USER:=cinder} : ${ADMIN_TENANT_NAME:=admin} -if ! [ "$KEYSTONE_ADMIN_TOKEN" ]; then - echo "*** Missing KEYSTONE_ADMIN_TOKEN" >&2 - exit 1 -fi - -if ! [ "$DB_ROOT_PASSWORD" ]; then - echo "*** Missing DB_ROOT_PASSWORD" >&2 - exit 1 -fi - if ! [ "$CINDER_DB_PASSWORD" ]; then CINDER_DB_PASSWORD=$(openssl rand -hex 15) export CINDER_DB_PASSWORD fi -mysql -h ${MARIADB_PORT_3306_TCP_ADDR} -u root \ - -p${DB_ROOT_PASSWORD} mysql <