Skip to content

Commit

Permalink
gcloud-sqlproxy fix rimusz#145 generate randomstring using sha1sum no…
Browse files Browse the repository at this point in the history
…t with randAlphaNum
  • Loading branch information
daibrahi committed Oct 19, 2023
1 parent eee4571 commit 46785b0
Showing 1 changed file with 1 addition and 1 deletion.
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 46785b0

Please sign in to comment.