Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions charts/selenium-grid/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,10 @@ template:
{{- toYaml . | nindent 6 }}
{{- end }}
annotations:
checksum/event-bus-configmap: {{ include (print $.Template.BasePath "/event-bus-configmap.yaml") . | sha256sum }}
checksum/node-configmap: {{ include (print $.Template.BasePath "/node-configmap.yaml") . | sha256sum }}
checksum/logging-configmap: {{ include (print $.Template.BasePath "/logging-configmap.yaml") . | sha256sum }}
checksum/server-configmap: {{ include (print $.Template.BasePath "/server-configmap.yaml") . | sha256sum }}
checksum/event-bus-configmap: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/event-bus-configmap.yaml") }}
checksum/node-configmap: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/node-configmap.yaml") }}
checksum/logging-configmap: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/logging-configmap.yaml") }}
checksum/server-configmap: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/server-configmap.yaml") }}
{{- with .node.annotations }}
{{- toYaml . | nindent 6 }}
{{- end }}
Expand Down Expand Up @@ -1109,3 +1109,12 @@ Usage: {{- $thisArray = include "utils.appendDefaultIfNotExist" (dict "currentAr
{{- end -}}
{{- $currentArray | toYaml -}}
{{- end -}}

{{/*
Compute a ConfigMap or Secret checksum from its data only, for checksum/* pod annotations.
Hashing the whole manifest would include the chart labels, which change on every chart version
bump and would restart the pods when no configuration changed.
*/}}
{{- define "seleniumGrid.configMapOrSecretContentHash" -}}
{{ pick (include (print .ctx.Template.BasePath .name) .ctx | fromYaml) "data" "stringData" | toYaml | sha256sum }}
{{- end -}}
12 changes: 6 additions & 6 deletions charts/selenium-grid/templates/distributor-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ spec:
metadata:
labels: *distributor_labels
annotations:
checksum/event-bus-configmap: {{ include (print $.Template.BasePath "/event-bus-configmap.yaml") . | sha256sum }}
checksum/logging-configmap: {{ include (print $.Template.BasePath "/logging-configmap.yaml") . | sha256sum }}
checksum/server-configmap: {{ include (print $.Template.BasePath "/server-configmap.yaml") . | sha256sum }}
checksum/distributor-configmap: {{ include (print $.Template.BasePath "/distributor-configmap.yaml") . | sha256sum }}
checksum/router-configmap: {{ include (print $.Template.BasePath "/router-configmap.yaml") . | sha256sum }}
checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
checksum/event-bus-configmap: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/event-bus-configmap.yaml") }}
checksum/logging-configmap: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/logging-configmap.yaml") }}
checksum/server-configmap: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/server-configmap.yaml") }}
checksum/distributor-configmap: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/distributor-configmap.yaml") }}
checksum/router-configmap: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/router-configmap.yaml") }}
checksum/secrets: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/secrets.yaml") }}
{{- with .Values.components.distributor.annotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
6 changes: 3 additions & 3 deletions charts/selenium-grid/templates/event-bus-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ spec:
metadata:
labels: *event_bus_labels
annotations:
checksum/logging-configmap: {{ include (print $.Template.BasePath "/logging-configmap.yaml") . | sha256sum }}
checksum/server-configmap: {{ include (print $.Template.BasePath "/server-configmap.yaml") . | sha256sum }}
checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
checksum/logging-configmap: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/logging-configmap.yaml") }}
checksum/server-configmap: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/server-configmap.yaml") }}
checksum/secrets: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/secrets.yaml") }}
{{- with .Values.components.eventBus.annotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
12 changes: 6 additions & 6 deletions charts/selenium-grid/templates/hub-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ spec:
metadata:
labels: *hub_labels
annotations:
checksum/logging-configmap: {{ include (print $.Template.BasePath "/logging-configmap.yaml") . | sha256sum }}
checksum/server-configmap: {{ include (print $.Template.BasePath "/server-configmap.yaml") . | sha256sum }}
checksum/distributor-configmap: {{ include (print $.Template.BasePath "/distributor-configmap.yaml") . | sha256sum }}
checksum/router-configmap: {{ include (print $.Template.BasePath "/router-configmap.yaml") . | sha256sum }}
checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
checksum/tls-cert-secret: {{ include (print $.Template.BasePath "/tls-cert-secret.yaml") . | sha256sum }}
checksum/logging-configmap: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/logging-configmap.yaml") }}
checksum/server-configmap: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/server-configmap.yaml") }}
checksum/distributor-configmap: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/distributor-configmap.yaml") }}
checksum/router-configmap: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/router-configmap.yaml") }}
checksum/secrets: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/secrets.yaml") }}
checksum/tls-cert-secret: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/tls-cert-secret.yaml") }}
{{- with .Values.hub.annotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
8 changes: 4 additions & 4 deletions charts/selenium-grid/templates/router-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ spec:
metadata:
labels: *router_labels
annotations:
checksum/logging-configmap: {{ include (print $.Template.BasePath "/logging-configmap.yaml") . | sha256sum }}
checksum/server-configmap: {{ include (print $.Template.BasePath "/server-configmap.yaml") . | sha256sum }}
checksum/router-configmap: {{ include (print $.Template.BasePath "/router-configmap.yaml") . | sha256sum }}
checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
checksum/logging-configmap: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/logging-configmap.yaml") }}
checksum/server-configmap: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/server-configmap.yaml") }}
checksum/router-configmap: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/router-configmap.yaml") }}
checksum/secrets: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/secrets.yaml") }}
{{- with .Values.components.router.annotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
8 changes: 4 additions & 4 deletions charts/selenium-grid/templates/session-map-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ spec:
metadata:
labels: *session_map_labels
annotations:
checksum/event-bus-configmap: {{ include (print $.Template.BasePath "/event-bus-configmap.yaml") . | sha256sum }}
checksum/logging-configmap: {{ include (print $.Template.BasePath "/logging-configmap.yaml") . | sha256sum }}
checksum/server-configmap: {{ include (print $.Template.BasePath "/server-configmap.yaml") . | sha256sum }}
checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
checksum/event-bus-configmap: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/event-bus-configmap.yaml") }}
checksum/logging-configmap: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/logging-configmap.yaml") }}
checksum/server-configmap: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/server-configmap.yaml") }}
checksum/secrets: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/secrets.yaml") }}
{{- with .Values.components.sessionMap.annotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
6 changes: 3 additions & 3 deletions charts/selenium-grid/templates/session-queue-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ spec:
metadata:
labels: *session_queue_labels
annotations:
checksum/logging-configmap: {{ include (print $.Template.BasePath "/logging-configmap.yaml") . | sha256sum }}
checksum/server-configmap: {{ include (print $.Template.BasePath "/server-configmap.yaml") . | sha256sum }}
checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
checksum/logging-configmap: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/logging-configmap.yaml") }}
checksum/server-configmap: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/server-configmap.yaml") }}
checksum/secrets: {{ include "seleniumGrid.configMapOrSecretContentHash" (dict "ctx" . "name" "/secrets.yaml") }}
{{- with .Values.components.sessionQueue.annotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down