Skip to content

Commit 867f85b

Browse files
danyworksdaibrahi
andauthored
[gcloud-sqlproxy] fix #143 add suffix using randAlphaNum to instanceShortName (#144)
* fix #143 add randAlphaNum to instanceShortName * gcloud-sqlproxy bump chart version to 0.25.3 and update readme * gcloud-sqlproxy fix#143 allow only lowercase in randomString for instanceShortName * gcloud-sqlproxy fix#143 reduce length * gcloud-sqlproxy fix#143 update readme --------- Co-authored-by: daniyal ibrahim <[email protected]>
1 parent 36e7528 commit 867f85b

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

stable/gcloud-sqlproxy/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ name: gcloud-sqlproxy
1919
sources:
2020
- https://github.com/rimusz/charts
2121
type: application
22-
version: 0.25.2
22+
version: 0.25.3

stable/gcloud-sqlproxy/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ GCP does not support more than 5 endpoints on an Internal Load Balancer. To work
165165

166166
Please note, as of `0.25.0` use [cloud-sql-proxy v2](https://github.com/GoogleCloudPlatform/cloud-sql-proxy/blob/main/migration-guide.md). The `httpPortProbe` replaced `httpLivenessProbe.port` & `httpReadinessProbe.port`.
167167

168+
Please note, as of `0.25.3`, if the value of `cloudsql.instances[].instanceShortName` remains undefined, an instanceShortName of 15 characters length will be generated, with a combination of first 5 letters of the instance name, then a hypen "-" and the remaining 9 characters will be autogenerated.
169+
168170
**From <= 0.22.2 to >= 0.23.0**
169171

170172
Please note, the `securityContext` has been renamed into `podSecurityContext`.

stable/gcloud-sqlproxy/templates/_helpers.tpl

+2-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ Create the name of the service account to use
9494
Create the short instance name
9595
*/}}
9696
{{- define "gcloud-sqlproxy.instanceShortName" -}}
97-
{{ .instanceShortName | default (.instance | trunc 15 | trimSuffix "-") }}
97+
{{- $randomString := randAlphaNum 9 | lower -}}
98+
{{ .instanceShortName | default (printf "%s-%s" (.instance | trunc 5 | trimSuffix "-") $randomString) }}
9899
{{- end -}}
99100

100101
{{/*

0 commit comments

Comments
 (0)