Skip to content

Commit

Permalink
[gcloud-sqlproxy] fix #143 add suffix using randAlphaNum to instanceS…
Browse files Browse the repository at this point in the history
…hortName (#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 <daniyal.ibrahim@capgemini.com>
  • Loading branch information
danyworks and daibrahi authored Oct 19, 2023
1 parent 36e7528 commit 867f85b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 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.2
version: 0.25.3
2 changes: 2 additions & 0 deletions stable/gcloud-sqlproxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +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.

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

Please note, the `securityContext` has been renamed into `podSecurityContext`.
Expand Down
3 changes: 2 additions & 1 deletion stable/gcloud-sqlproxy/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 9 | lower -}}
{{ .instanceShortName | default (printf "%s-%s" (.instance | trunc 5 | trimSuffix "-") $randomString) }}
{{- end -}}

{{/*
Expand Down

0 comments on commit 867f85b

Please sign in to comment.