Fix ks-user script case matching for domain

Some services attempt to recreate the default domain
with both the values of "default" and "Default". Since this
domain already exists when keystone is deployed, this
creates redundant API calls that only result in conflicts.

This change enables nocasematch for string checking in order
to avoid making multiple unnecessary calls to keystone.

Change-Id: I698fd420dc41eae211a511269cb021d4ab7a5bfc
This commit is contained in:
Gage Hugo 2020-10-15 16:32:04 -05:00
parent af712da863
commit cddf665c16
2 changed files with 5 additions and 1 deletions

View File

@ -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.1.2 version: 0.1.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:

View File

@ -31,6 +31,8 @@ limitations under the License.
set -ex set -ex
shopt -s nocasematch
if [[ "${SERVICE_OS_PROJECT_DOMAIN_NAME}" == "Default" ]] if [[ "${SERVICE_OS_PROJECT_DOMAIN_NAME}" == "Default" ]]
then then
PROJECT_DOMAIN_ID="default" PROJECT_DOMAIN_ID="default"
@ -51,6 +53,8 @@ else
"${SERVICE_OS_USER_DOMAIN_NAME}") "${SERVICE_OS_USER_DOMAIN_NAME}")
fi fi
shopt -u nocasematch
# Manage user project # Manage user project
USER_PROJECT_DESC="Service Project for ${SERVICE_OS_REGION_NAME}/${SERVICE_OS_PROJECT_DOMAIN_NAME}" USER_PROJECT_DESC="Service Project for ${SERVICE_OS_REGION_NAME}/${SERVICE_OS_PROJECT_DOMAIN_NAME}"
USER_PROJECT_ID=$(openstack project create --or-show --enable -f value -c id \ USER_PROJECT_ID=$(openstack project create --or-show --enable -f value -c id \