Allow openstack service list to retry in event of keystone connection issues
We've seen a few cases where the openstack service list is unable to establish a connection with keystone thus causing the check to fail. When this happens, an additional service is created unnecessarily. When the addtional service is created, it tends to cause issues since there are no endpoints asscociated with the new service. Allow this check to retry several times. Change-Id: I5a1985c680e90de71549177ffc3faf848a831bfa
This commit is contained in:
parent
6090e8243d
commit
ff3b0aa9e0
@ -15,7 +15,7 @@ apiVersion: v1
|
|||||||
appVersion: v1.0.0
|
appVersion: v1.0.0
|
||||||
description: OpenStack-Helm Helm-Toolkit
|
description: OpenStack-Helm Helm-Toolkit
|
||||||
name: helm-toolkit
|
name: helm-toolkit
|
||||||
version: 0.2.2
|
version: 0.2.3
|
||||||
home: https://docs.openstack.org/openstack-helm
|
home: https://docs.openstack.org/openstack-helm
|
||||||
icon: https://www.openstack.org/themes/openstack/images/project-mascots/OpenStack-Helm/OpenStack_Project_OpenStackHelm_vertical.png
|
icon: https://www.openstack.org/themes/openstack/images/project-mascots/OpenStack-Helm/OpenStack_Project_OpenStackHelm_vertical.png
|
||||||
sources:
|
sources:
|
||||||
|
@ -36,16 +36,29 @@ OS_SERVICE_DESC="${OS_REGION_NAME}: ${OS_SERVICE_NAME} (${OS_SERVICE_TYPE}) serv
|
|||||||
|
|
||||||
# Get Service ID if it exists
|
# Get Service ID if it exists
|
||||||
unset OS_SERVICE_ID
|
unset OS_SERVICE_ID
|
||||||
OS_SERVICE_ID=$( openstack service list -f csv --quote none | \
|
|
||||||
grep ",${OS_SERVICE_NAME},${OS_SERVICE_TYPE}$" | \
|
|
||||||
sed -e "s/,${OS_SERVICE_NAME},${OS_SERVICE_TYPE}//g" )
|
|
||||||
|
|
||||||
# If a Service ID was not found, then create the service
|
# If OS_SERVICE_ID is blank (due to the service not being ready yet)
|
||||||
if [[ -z ${OS_SERVICE_ID} ]]; then
|
# then wait a few seconds to give it additional time to be ready
|
||||||
OS_SERVICE_ID=$(openstack service create -f value -c id \
|
# and try again
|
||||||
--name="${OS_SERVICE_NAME}" \
|
for i in {1...3}
|
||||||
--description "${OS_SERVICE_DESC}" \
|
do
|
||||||
--enable \
|
OS_SERVICE_ID=$( openstack service list -f csv --quote none | \
|
||||||
"${OS_SERVICE_TYPE}")
|
grep ",${OS_SERVICE_NAME},${OS_SERVICE_TYPE}$" | \
|
||||||
fi
|
sed -e "s/,${OS_SERVICE_NAME},${OS_SERVICE_TYPE}//g" )
|
||||||
|
|
||||||
|
# If the service was found, go ahead and exit successfully.
|
||||||
|
if [[ -n "${OS_SERVICE_ID}" ]]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
|
||||||
|
# If we've reached this point and a Service ID was not found,
|
||||||
|
# then create the service
|
||||||
|
OS_SERVICE_ID=$(openstack service create -f value -c id \
|
||||||
|
--name="${OS_SERVICE_NAME}" \
|
||||||
|
--description "${OS_SERVICE_DESC}" \
|
||||||
|
--enable \
|
||||||
|
"${OS_SERVICE_TYPE}")
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
Loading…
Reference in New Issue
Block a user