Skip to content

Commit

Permalink
[gcloud-sqlproxy] fix #145 use sha1sum instead of randAlphaNum (#146)
Browse files Browse the repository at this point in the history
* 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 <daniyal.ibrahim@capgemini.com>
  • Loading branch information
danyworks and daibrahi committed Oct 20, 2023
1 parent 867f85b commit daa840e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion stable/gcloud-sqlproxy/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ name: gcloud-sqlproxy
sources:
- https://github.com/rimusz/charts
type: application
version: 0.25.3
version: 0.25.4
3 changes: 2 additions & 1 deletion stable/gcloud-sqlproxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ GCP does not support more than 5 endpoints on an Internal Load Balancer. To work

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`.

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.

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.

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

Expand Down
2 changes: 1 addition & 1 deletion stable/gcloud-sqlproxy/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Create the name of the service account to use
Create the short instance name
*/}}
{{- define "gcloud-sqlproxy.instanceShortName" -}}
{{- $randomString := randAlphaNum 9 | lower -}}
{{- $randomString := sha1sum .instance | lower | substr 0 9 -}}
{{ .instanceShortName | default (printf "%s-%s" (.instance | trunc 5 | trimSuffix "-") $randomString) }}
{{- end -}}

Expand Down

0 comments on commit daa840e

Please sign in to comment.