From e669674ea35a408b575b8ecd616d68d80bd57446 Mon Sep 17 00:00:00 2001 From: daniyal ibrahim Date: Wed, 18 Oct 2023 17:42:43 +0200 Subject: [PATCH] fix #143 add randAlphaNum to instanceShortName --- stable/gcloud-sqlproxy/templates/_helpers.tpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stable/gcloud-sqlproxy/templates/_helpers.tpl b/stable/gcloud-sqlproxy/templates/_helpers.tpl index 8564788..7cd2261 100755 --- a/stable/gcloud-sqlproxy/templates/_helpers.tpl +++ b/stable/gcloud-sqlproxy/templates/_helpers.tpl @@ -94,7 +94,8 @@ Create the name of the service account to use Create the short instance name */}} {{- define "gcloud-sqlproxy.instanceShortName" -}} -{{ .instanceShortName | default (.instance | trunc 15 | trimSuffix "-") }} +{{- $randomString := randAlphaNum 10 -}} +{{ .instanceShortName | default (printf "%s-%s" (.instance | trunc 5 | trimSuffix "-") $randomString) }} {{- end -}} {{/*