From 6c5cc2fdf04d32fbf5fed2b90c6fdca60286d567 Mon Sep 17 00:00:00 2001 From: "Kabanov, Dmitrii" Date: Mon, 13 May 2024 13:29:49 -0700 Subject: [PATCH] Escape special characters in password for DB connection The passwords with special characters need to be URL encoded to be parsed correctly Change-Id: Ic7e0e55481d9ea5ce2621cf0d67e80b9ee43cde0 --- helm-toolkit/Chart.yaml | 2 +- .../templates/endpoints/_authenticated_endpoint_uri_lookup.tpl | 2 +- .../endpoints/_authenticated_transport_endpoint_uri_lookup.tpl | 2 +- releasenotes/notes/helm-toolkit.yaml | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/helm-toolkit/Chart.yaml b/helm-toolkit/Chart.yaml index a701e055a..082112450 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.64 +version: 0.2.65 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/endpoints/_authenticated_endpoint_uri_lookup.tpl b/helm-toolkit/templates/endpoints/_authenticated_endpoint_uri_lookup.tpl index 12b84dec1..d7390d8be 100644 --- a/helm-toolkit/templates/endpoints/_authenticated_endpoint_uri_lookup.tpl +++ b/helm-toolkit/templates/endpoints/_authenticated_endpoint_uri_lookup.tpl @@ -50,7 +50,7 @@ return: | {{- $endpointScheme := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" }} {{- $userMap := index $context.Values.endpoints ( $type | replace "-" "_" ) "auth" $userclass }} {{- $endpointUser := index $userMap "username" }} -{{- $endpointPass := index $userMap "password" }} +{{- $endpointPass := index $userMap "password" | urlquery }} {{- $endpointHost := tuple $type $endpoint $context | include "helm-toolkit.endpoints.endpoint_host_lookup" }} {{- $endpointPort := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.endpoint_port_lookup" }} {{- $endpointPath := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.keystone_endpoint_path_lookup" }} diff --git a/helm-toolkit/templates/endpoints/_authenticated_transport_endpoint_uri_lookup.tpl b/helm-toolkit/templates/endpoints/_authenticated_transport_endpoint_uri_lookup.tpl index b7cf28738..b9ac9d9ab 100644 --- a/helm-toolkit/templates/endpoints/_authenticated_transport_endpoint_uri_lookup.tpl +++ b/helm-toolkit/templates/endpoints/_authenticated_transport_endpoint_uri_lookup.tpl @@ -100,7 +100,7 @@ examples: {{- $ssMap := index $context.Values.endpoints ( $type | replace "-" "_" ) "statefulset" | default false}} {{- $hostFqdnOverride := index $context.Values.endpoints ( $type | replace "-" "_" ) "host_fqdn_override" }} {{- $endpointUser := index $userMap "username" }} -{{- $endpointPass := index $userMap "password" }} +{{- $endpointPass := index $userMap "password" | urlquery }} {{- $endpointHostSuffix := tuple $type $endpoint $context | include "helm-toolkit.endpoints.endpoint_host_lookup" }} {{- $endpointPort := tuple $type $endpoint $port $context | include "helm-toolkit.endpoints.endpoint_port_lookup" }} {{- $local := dict "endpointCredsAndHosts" list -}} diff --git a/releasenotes/notes/helm-toolkit.yaml b/releasenotes/notes/helm-toolkit.yaml index 9805c4ad8..3bbd2eb27 100644 --- a/releasenotes/notes/helm-toolkit.yaml +++ b/releasenotes/notes/helm-toolkit.yaml @@ -71,4 +71,5 @@ helm-toolkit: - 0.2.62 Add custom secret annotations snippet - 0.2.63 Add custom job annotations snippet and wire it into job templates - 0.2.64 Use custom secret annotations snippet in other secret templates + - 0.2.65 Escape special characters in password for DB connection ...