Skip to content

Commit

Permalink
chart: protect resources naming against .Release.Nam contains dots. f…
Browse files Browse the repository at this point in the history
…rom ArgoCD

Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
  • Loading branch information
VietND96 committed Sep 17, 2024
1 parent 8126a9b commit 7dc9f18
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions charts/selenium-grid/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
| autoscaling.enableWithExistingKEDA | bool | `false` | Enable autoscaling without automatically installing KEDA |
| autoscaling.scalingType | string | `"job"` | Which type of KEDA scaling to use: job or deployment |
| autoscaling.annotations | object | `{"helm.sh/hook":"post-install,post-upgrade,post-rollback","helm.sh/hook-weight":"1"}` | Annotations for KEDA resources: ScaledObject and ScaledJob |
| autoscaling.patchObjectFinalizers.nameOverride | string | `nil` | Override the name of the patch job |
| 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 |
| autoscaling.patchObjectFinalizers.activeDeadlineSeconds | int | `120` | Deadline (in seconds) for patch job to complete |
| 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 |
Expand Down
6 changes: 3 additions & 3 deletions charts/selenium-grid/templates/_nameHelpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ component.autoscaling: "{{ .Release.Name }}"
{{- if eq $root.Release.Name "selenium" }}
{{- $component | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" $root.Release.Name $component | trunc 63 | trimSuffix "-" -}}
{{- printf "%s-%s" $root.Release.Name $component | replace "." "" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}

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

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

{{/*
Expand Down
2 changes: 2 additions & 0 deletions charts/selenium-grid/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,8 @@ autoscaling:
"helm.sh/hook": post-install,post-upgrade,post-rollback
"helm.sh/hook-weight": "1"
patchObjectFinalizers:
# -- Override the name of the patch job
nameOverride:
# -- 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
enabled: true
# -- Deadline (in seconds) for patch job to complete
Expand Down

0 comments on commit 7dc9f18

Please sign in to comment.