From 61708c74d324dbe1f04ad08442f78b9100fd2882 Mon Sep 17 00:00:00 2001 From: do-gyun Date: Wed, 11 Sep 2024 17:37:13 +0900 Subject: [PATCH] Decode url-encoded password for rabbit connection Resolve that access fails when the Rabbitmq password contains special characters by the changes below. https://pikachu.space/openstack/openstack-helm-infra/commit/6c5cc2fdf04d32fbf5fed2b90c6fdca60286d567 story: 2011222 task: 50999 Change-Id: I0cfc6e2228bc4b1327efb7da293849d6d1bbff19 --- helm-toolkit/Chart.yaml | 2 +- helm-toolkit/templates/scripts/_rabbit-init.sh.tpl | 8 ++++++-- releasenotes/notes/helm-toolkit.yaml | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/helm-toolkit/Chart.yaml b/helm-toolkit/Chart.yaml index d8b4ec368..b8027958c 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.2.69 +version: 0.2.70 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/_rabbit-init.sh.tpl b/helm-toolkit/templates/scripts/_rabbit-init.sh.tpl index 3739f9554..e6e9c6e8e 100644 --- a/helm-toolkit/templates/scripts/_rabbit-init.sh.tpl +++ b/helm-toolkit/templates/scripts/_rabbit-init.sh.tpl @@ -29,7 +29,9 @@ RABBITMQ_ADMIN_USERNAME=$(echo "${RABBITMQ_ADMIN_CONNECTION}" | \ awk -F'[//:]' '{print $4}') RABBITMQ_ADMIN_PASSWORD=$(echo "${RABBITMQ_ADMIN_CONNECTION}" | \ awk -F'[@]' '{print $1}' | \ - awk -F'[//:]' '{print $5}') + awk -F'[//:]' '{print $5}' | \ + sed 's/%/\\x/g' | \ + xargs -0 printf "%b") # Extract User creadential RABBITMQ_USERNAME=$(echo "${RABBITMQ_USER_CONNECTION}" | \ @@ -37,7 +39,9 @@ RABBITMQ_USERNAME=$(echo "${RABBITMQ_USER_CONNECTION}" | \ awk -F'[//:]' '{print $4}') RABBITMQ_PASSWORD=$(echo "${RABBITMQ_USER_CONNECTION}" | \ awk -F'[@]' '{print $1}' | \ - awk -F'[//:]' '{print $5}') + awk -F'[//:]' '{print $5}' | \ + sed 's/%/\\x/g' | \ + xargs -0 printf "%b") # Extract User vHost RABBITMQ_VHOST=$(echo "${RABBITMQ_USER_CONNECTION}" | \ diff --git a/releasenotes/notes/helm-toolkit.yaml b/releasenotes/notes/helm-toolkit.yaml index 9d1e985b5..b013261c7 100644 --- a/releasenotes/notes/helm-toolkit.yaml +++ b/releasenotes/notes/helm-toolkit.yaml @@ -76,4 +76,5 @@ helm-toolkit: - 0.2.67 Use quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_focal by default - 0.2.68 Use quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_focal by default - 0.2.69 Use quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_focal by default + - 0.2.70 Decode url-encoded password for rabbit connection ...