Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 736f709

Browse filesBrowse files
committed
Use helper for secret checksum calculation
1 parent b5436dd commit 736f709
Copy full SHA for 736f709

File tree

Expand file treeCollapse file tree

2 files changed

+11
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+11
-1
lines changed

‎charts/pgcat/templates/_helpers.tpl

Copy file name to clipboardExpand all lines: charts/pgcat/templates/_helpers.tpl
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,13 @@ Create the name of the service account to use
6060
{{- default "default" .Values.serviceAccount.name }}
6161
{{- end }}
6262
{{- end }}
63+
64+
{{/*
65+
Generate a checksum of the specified template file.
66+
*/}}
67+
{{- define "pgcat.checksum" -}}
68+
{{- $files := .Files -}}
69+
{{- $secretPath := (print $.Template.BasePath "/secret.yaml") -}}
70+
{{- $secret := $files.Get $secretPath -}}
71+
{{- sha256sum $secret -}}
72+
{{- end }}

‎charts/pgcat/templates/deployment.yaml

Copy file name to clipboardExpand all lines: charts/pgcat/templates/deployment.yaml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ spec:
1212
template:
1313
metadata:
1414
annotations:
15-
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
15+
checksum/secret: {{ include "pgcat.checksum" . }}
1616
{{- with .Values.podAnnotations }}
1717
{{- toYaml . | nindent 8 }}
1818
{{- end }}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.