Skip to content

Commit 7dc9f18

Browse files
committed
chart: protect resources naming against .Release.Nam contains dots. from ArgoCD
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 8126a9b commit 7dc9f18

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

charts/selenium-grid/CONFIGURATION.md

+1
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
301301
| autoscaling.enableWithExistingKEDA | bool | `false` | Enable autoscaling without automatically installing KEDA |
302302
| autoscaling.scalingType | string | `"job"` | Which type of KEDA scaling to use: job or deployment |
303303
| autoscaling.annotations | object | `{"helm.sh/hook":"post-install,post-upgrade,post-rollback","helm.sh/hook-weight":"1"}` | Annotations for KEDA resources: ScaledObject and ScaledJob |
304+
| autoscaling.patchObjectFinalizers.nameOverride | string | `nil` | Override the name of the patch job |
304305
| autoscaling.patchObjectFinalizers.enabled | bool | `true` | Enable patching finalizers for KEDA scaled resources. Workaround for Hook post-upgrade selenium-grid/templates/x-node-hpa.yaml failed: object is being deleted: scaledobjects.keda.sh "x" already exists |
305306
| autoscaling.patchObjectFinalizers.activeDeadlineSeconds | int | `120` | Deadline (in seconds) for patch job to complete |
306307
| autoscaling.patchObjectFinalizers.annotations | object | `{"helm.sh/hook":"post-install,post-upgrade,post-rollback,pre-delete","helm.sh/hook-delete-policy":"hook-succeeded,before-hook-creation","helm.sh/hook-weight":"-1"}` | Annotations for patch job |

charts/selenium-grid/templates/_nameHelpers.tpl

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ component.autoscaling: "{{ .Release.Name }}"
5252
{{- if eq $root.Release.Name "selenium" }}
5353
{{- $component | trunc 63 | trimSuffix "-" -}}
5454
{{- else -}}
55-
{{- printf "%s-%s" $root.Release.Name $component | trunc 63 | trimSuffix "-" -}}
55+
{{- printf "%s-%s" $root.Release.Name $component | replace "." "" | trunc 63 | trimSuffix "-" -}}
5656
{{- end -}}
5757
{{- end -}}
5858

@@ -74,7 +74,7 @@ Event bus fullname
7474
Event bus ConfigMap fullname
7575
*/}}
7676
{{- define "seleniumGrid.eventBus.configmap.fullname" -}}
77-
{{- tpl (default (include "seleniumGrid.eventBus.fullname" $) .Values.busConfigMap.nameOverride) $ | trunc 63 | trimSuffix "-" -}}
77+
{{- tpl (default (include "seleniumGrid.component.name" (list "selenium-event-bus-config" $)) .Values.busConfigMap.nameOverride) $ | trunc 63 | trimSuffix "-" -}}
7878
{{- end -}}
7979

8080
{{/*
@@ -207,7 +207,7 @@ Server ConfigMap fullname
207207
Patch scaledObjects finalizers job fullname
208208
*/}}
209209
{{- define "seleniumGrid.keda.patchObjectsJob.fullname" -}}
210-
{{- tpl (include "seleniumGrid.component.name" (list "selenium-patch-scaledobjects-finalizers" $)) $ | trunc 63 | trimSuffix "-" -}}
210+
{{- tpl ( default (include "seleniumGrid.component.name" (list "selenium-patch-scaledobjects-finalizers" $)) .Values.autoscaling.patchObjectFinalizers.nameOverride) $ | trunc 63 | trimSuffix "-" -}}
211211
{{- end -}}
212212

213213
{{/*

charts/selenium-grid/values.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,8 @@ autoscaling:
785785
"helm.sh/hook": post-install,post-upgrade,post-rollback
786786
"helm.sh/hook-weight": "1"
787787
patchObjectFinalizers:
788+
# -- Override the name of the patch job
789+
nameOverride:
788790
# -- Enable patching finalizers for KEDA scaled resources. Workaround for Hook post-upgrade selenium-grid/templates/x-node-hpa.yaml failed: object is being deleted: scaledobjects.keda.sh "x" already exists
789791
enabled: true
790792
# -- Deadline (in seconds) for patch job to complete

0 commit comments

Comments
 (0)