Commit 770b060b authored by Waqar Ahmed's avatar Waqar Ahmed

Add helper function for postgres name

parent b30c9958
...@@ -13,6 +13,10 @@ app.kubernetes.io/name: {{ include "nextcloud.name" . }}-postgres ...@@ -13,6 +13,10 @@ app.kubernetes.io/name: {{ include "nextcloud.name" . }}-postgres
app.kubernetes.io/instance: {{ .Release.Name }}-postgres app.kubernetes.io/instance: {{ .Release.Name }}-postgres
{{- end }} {{- end }}
{{- define "postgres.imageName" -}}
{{- print "postgres:13.1" -}}
{{- end -}}
{{/* {{/*
Retrieve postgres backup name Retrieve postgres backup name
This will return a unique name based on revision and chart numbers specified. This will return a unique name based on revision and chart numbers specified.
......
...@@ -17,7 +17,7 @@ spec: ...@@ -17,7 +17,7 @@ spec:
serviceAccountName: "{{ template "nextcloud.serviceAccountName" . }}" serviceAccountName: "{{ template "nextcloud.serviceAccountName" . }}"
containers: containers:
- name: {{ .Chart.Name }}-postgres-backup - name: {{ .Chart.Name }}-postgres-backup
image: "postgres:13.1" image: {{ template "postgres.imageName" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
env: env:
- name: POSTGRES_USER - name: POSTGRES_USER
......
...@@ -38,7 +38,7 @@ spec: ...@@ -38,7 +38,7 @@ spec:
{{- end }} {{- end }}
initContainers: initContainers:
- name: init-postgresdb - name: init-postgresdb
image: "postgres:13.1" image: {{ template "postgres.imageName" . }}
command: ['sh', '-c', "until pg_isready -h {{ template "nextcloud.fullname" . }}-postgres; do echo waiting for postgres; sleep 2; done"] command: ['sh', '-c', "until pg_isready -h {{ template "nextcloud.fullname" . }}-postgres; do echo waiting for postgres; sleep 2; done"]
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
containers: containers:
......
...@@ -25,7 +25,7 @@ spec: ...@@ -25,7 +25,7 @@ spec:
spec: spec:
containers: containers:
- name: {{ .Chart.Name }}-postgres - name: {{ .Chart.Name }}-postgres
image: "postgres:13.1" image: {{ template "postgres.imageName" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
env: env:
- name: POSTGRES_USER - name: POSTGRES_USER
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment