Skip to content

Commit daa840e

Browse files
danyworksdaibrahi
andauthored
[gcloud-sqlproxy] fix #145 use sha1sum instead of randAlphaNum (#146)
* 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 * gcloud-sqlproxy fix #145 generate randomstring using sha1sum not with randAlphaNum * gcloud-sqlproxy fix #145 update readme * gcloud-sqlproxy fix #145 bump chart version * add new line at the end of Chart.yaml --------- Co-authored-by: daniyal ibrahim <[email protected]>
1 parent 867f85b commit daa840e

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
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.3
22+
version: 0.25.4

stable/gcloud-sqlproxy/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +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.
168+
169+
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 using sha1sum of the `instance` name.
169170

170171
**From <= 0.22.2 to >= 0.23.0**
171172

stable/gcloud-sqlproxy/templates/_helpers.tpl

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

0 commit comments

Comments
 (0)