From e669674ea35a408b575b8ecd616d68d80bd57446 Mon Sep 17 00:00:00 2001 From: daniyal ibrahim Date: Wed, 18 Oct 2023 17:42:43 +0200 Subject: [PATCH 1/9] fix #143 add randAlphaNum to instanceShortName --- stable/gcloud-sqlproxy/templates/_helpers.tpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stable/gcloud-sqlproxy/templates/_helpers.tpl b/stable/gcloud-sqlproxy/templates/_helpers.tpl index 8564788..7cd2261 100755 --- a/stable/gcloud-sqlproxy/templates/_helpers.tpl +++ b/stable/gcloud-sqlproxy/templates/_helpers.tpl @@ -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 10 -}} +{{ .instanceShortName | default (printf "%s-%s" (.instance | trunc 5 | trimSuffix "-") $randomString) }} {{- end -}} {{/* From e11c1423056a2d18d55bd9b87e1fa5f9f02ca05c Mon Sep 17 00:00:00 2001 From: daniyal ibrahim Date: Wed, 18 Oct 2023 17:59:35 +0200 Subject: [PATCH 2/9] gcloud-sqlproxy bump chart version to 0.25.3 and update readme --- stable/gcloud-sqlproxy/Chart.yaml | 2 +- stable/gcloud-sqlproxy/README.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/stable/gcloud-sqlproxy/Chart.yaml b/stable/gcloud-sqlproxy/Chart.yaml index d4f28db..7d70c7c 100755 --- a/stable/gcloud-sqlproxy/Chart.yaml +++ b/stable/gcloud-sqlproxy/Chart.yaml @@ -19,4 +19,4 @@ name: gcloud-sqlproxy sources: - https://github.com/rimusz/charts type: application -version: 0.25.2 +version: 0.25.3 diff --git a/stable/gcloud-sqlproxy/README.md b/stable/gcloud-sqlproxy/README.md index dd37860..77c3e19 100755 --- a/stable/gcloud-sqlproxy/README.md +++ b/stable/gcloud-sqlproxy/README.md @@ -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 and the remaining 10 characters will be autogenerated. + **From <= 0.22.2 to >= 0.23.0** Please note, the `securityContext` has been renamed into `podSecurityContext`. From f5c71ac6220590fc960187f26721ade7dbc53978 Mon Sep 17 00:00:00 2001 From: daniyal ibrahim Date: Wed, 18 Oct 2023 18:07:21 +0200 Subject: [PATCH 3/9] gcloud-sqlproxy fix#143 allow only lowercase in randomString for instanceShortName --- stable/gcloud-sqlproxy/templates/_helpers.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stable/gcloud-sqlproxy/templates/_helpers.tpl b/stable/gcloud-sqlproxy/templates/_helpers.tpl index 7cd2261..27fe6ff 100755 --- a/stable/gcloud-sqlproxy/templates/_helpers.tpl +++ b/stable/gcloud-sqlproxy/templates/_helpers.tpl @@ -94,7 +94,7 @@ Create the name of the service account to use Create the short instance name */}} {{- define "gcloud-sqlproxy.instanceShortName" -}} -{{- $randomString := randAlphaNum 10 -}} +{{- $randomString := randAlphaNum 10 | lower -}} {{ .instanceShortName | default (printf "%s-%s" (.instance | trunc 5 | trimSuffix "-") $randomString) }} {{- end -}} From ce9fec41e190651604a22f0d93bbd7f39a21cba2 Mon Sep 17 00:00:00 2001 From: daniyal ibrahim Date: Wed, 18 Oct 2023 18:10:16 +0200 Subject: [PATCH 4/9] gcloud-sqlproxy fix#143 reduce length --- stable/gcloud-sqlproxy/templates/_helpers.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stable/gcloud-sqlproxy/templates/_helpers.tpl b/stable/gcloud-sqlproxy/templates/_helpers.tpl index 27fe6ff..909e5e3 100755 --- a/stable/gcloud-sqlproxy/templates/_helpers.tpl +++ b/stable/gcloud-sqlproxy/templates/_helpers.tpl @@ -94,7 +94,7 @@ Create the name of the service account to use Create the short instance name */}} {{- define "gcloud-sqlproxy.instanceShortName" -}} -{{- $randomString := randAlphaNum 10 | lower -}} +{{- $randomString := randAlphaNum 8 | lower -}} {{ .instanceShortName | default (printf "%s-%s" (.instance | trunc 5 | trimSuffix "-") $randomString) }} {{- end -}} From eee4571d5b5757426c949b6b79074b05f860b683 Mon Sep 17 00:00:00 2001 From: daniyal ibrahim Date: Wed, 18 Oct 2023 18:15:12 +0200 Subject: [PATCH 5/9] gcloud-sqlproxy fix#143 update readme --- stable/gcloud-sqlproxy/README.md | 2 +- stable/gcloud-sqlproxy/templates/_helpers.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stable/gcloud-sqlproxy/README.md b/stable/gcloud-sqlproxy/README.md index 77c3e19..82b6318 100755 --- a/stable/gcloud-sqlproxy/README.md +++ b/stable/gcloud-sqlproxy/README.md @@ -165,7 +165,7 @@ 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 and the remaining 10 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. **From <= 0.22.2 to >= 0.23.0** diff --git a/stable/gcloud-sqlproxy/templates/_helpers.tpl b/stable/gcloud-sqlproxy/templates/_helpers.tpl index 909e5e3..61fd838 100755 --- a/stable/gcloud-sqlproxy/templates/_helpers.tpl +++ b/stable/gcloud-sqlproxy/templates/_helpers.tpl @@ -94,7 +94,7 @@ Create the name of the service account to use Create the short instance name */}} {{- define "gcloud-sqlproxy.instanceShortName" -}} -{{- $randomString := randAlphaNum 8 | lower -}} +{{- $randomString := randAlphaNum 9 | lower -}} {{ .instanceShortName | default (printf "%s-%s" (.instance | trunc 5 | trimSuffix "-") $randomString) }} {{- end -}} From 46785b03f7899f0260fe9db06cb7101121e62bb7 Mon Sep 17 00:00:00 2001 From: daniyal ibrahim Date: Thu, 19 Oct 2023 16:21:36 +0200 Subject: [PATCH 6/9] gcloud-sqlproxy fix #145 generate randomstring using sha1sum not with randAlphaNum --- stable/gcloud-sqlproxy/templates/_helpers.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stable/gcloud-sqlproxy/templates/_helpers.tpl b/stable/gcloud-sqlproxy/templates/_helpers.tpl index 61fd838..93fcd48 100755 --- a/stable/gcloud-sqlproxy/templates/_helpers.tpl +++ b/stable/gcloud-sqlproxy/templates/_helpers.tpl @@ -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 -}} From b513cfd3da86672d150339787c744140dd4ef733 Mon Sep 17 00:00:00 2001 From: daniyal ibrahim Date: Thu, 19 Oct 2023 16:24:05 +0200 Subject: [PATCH 7/9] gcloud-sqlproxy fix #145 update readme --- stable/gcloud-sqlproxy/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stable/gcloud-sqlproxy/README.md b/stable/gcloud-sqlproxy/README.md index 82b6318..9477a7f 100755 --- a/stable/gcloud-sqlproxy/README.md +++ b/stable/gcloud-sqlproxy/README.md @@ -165,7 +165,7 @@ 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** From faa4743f18909a6110a6cdc3bb552a340d7ee182 Mon Sep 17 00:00:00 2001 From: daniyal ibrahim Date: Thu, 19 Oct 2023 16:31:02 +0200 Subject: [PATCH 8/9] gcloud-sqlproxy fix #145 bump chart version --- stable/gcloud-sqlproxy/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stable/gcloud-sqlproxy/Chart.yaml b/stable/gcloud-sqlproxy/Chart.yaml index 7d70c7c..4d3a8d4 100755 --- a/stable/gcloud-sqlproxy/Chart.yaml +++ b/stable/gcloud-sqlproxy/Chart.yaml @@ -19,4 +19,4 @@ name: gcloud-sqlproxy sources: - https://github.com/rimusz/charts type: application -version: 0.25.3 +version: 0.25.4 From 08374e70a0a2fb0dc1e1dfc171f6c9976d840fbb Mon Sep 17 00:00:00 2001 From: Daniyal I <48337074+danyworks@users.noreply.github.com> Date: Fri, 20 Oct 2023 11:05:07 +0200 Subject: [PATCH 9/9] add new line at the end of Chart.yaml --- stable/gcloud-sqlproxy/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stable/gcloud-sqlproxy/Chart.yaml b/stable/gcloud-sqlproxy/Chart.yaml index 05ae4bf..4d3a8d4 100755 --- a/stable/gcloud-sqlproxy/Chart.yaml +++ b/stable/gcloud-sqlproxy/Chart.yaml @@ -19,4 +19,4 @@ name: gcloud-sqlproxy sources: - https://github.com/rimusz/charts type: application -version: 0.25.4 \ No newline at end of file +version: 0.25.4