From cddf665c168770169ff1d8918f0db98ed383936c Mon Sep 17 00:00:00 2001 From: Gage Hugo Date: Thu, 15 Oct 2020 16:32:04 -0500 Subject: [PATCH] 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 --- helm-toolkit/Chart.yaml | 2 +- helm-toolkit/templates/scripts/_ks-user.sh.tpl | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/helm-toolkit/Chart.yaml b/helm-toolkit/Chart.yaml index 90c0380948..71c2a35fa8 100644 --- a/helm-toolkit/Chart.yaml +++ b/helm-toolkit/Chart.yaml @@ -15,7 +15,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Helm-Toolkit name: helm-toolkit -version: 0.1.2 +version: 0.1.3 home: https://docs.openstack.org/openstack-helm icon: https://www.openstack.org/themes/openstack/images/project-mascots/OpenStack-Helm/OpenStack_Project_OpenStackHelm_vertical.png sources: diff --git a/helm-toolkit/templates/scripts/_ks-user.sh.tpl b/helm-toolkit/templates/scripts/_ks-user.sh.tpl index 668ef3dadf..b45f798340 100644 --- a/helm-toolkit/templates/scripts/_ks-user.sh.tpl +++ b/helm-toolkit/templates/scripts/_ks-user.sh.tpl @@ -31,6 +31,8 @@ limitations under the License. set -ex +shopt -s nocasematch + if [[ "${SERVICE_OS_PROJECT_DOMAIN_NAME}" == "Default" ]] then PROJECT_DOMAIN_ID="default" @@ -51,6 +53,8 @@ else "${SERVICE_OS_USER_DOMAIN_NAME}") fi +shopt -u nocasematch + # Manage user project 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 \