feat: improve template formatting
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{{- define "cluster.bootstrap" }}
|
||||
{{- if eq .Values.mode "standalone" }}
|
||||
{{- define "cluster.bootstrap" -}}
|
||||
{{- if eq .Values.mode "standalone" -}}
|
||||
bootstrap:
|
||||
initdb:
|
||||
{{- with .Values.cluster.initdb }}
|
||||
@@ -18,7 +18,7 @@ bootstrap:
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else if eq .Values.mode "recovery" }}
|
||||
{{- else if eq .Values.mode "recovery" -}}
|
||||
bootstrap:
|
||||
{{- if eq .Values.recovery.method "import" }}
|
||||
initdb:
|
||||
@@ -55,11 +55,11 @@ bootstrap:
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
schemaOnly: {{ .Values.recovery.import.schemaOnly }}
|
||||
{{ with .Values.recovery.import.pgDumpExtraOptions }}
|
||||
{{- with .Values.recovery.import.pgDumpExtraOptions }}
|
||||
pgDumpExtraOptions:
|
||||
{{- . | toYaml | nindent 8 }}
|
||||
{{- end }}
|
||||
{{ with .Values.recovery.import.pgRestoreExtraOptions }}
|
||||
{{- with .Values.recovery.import.pgRestoreExtraOptions }}
|
||||
pgRestoreExtraOptions:
|
||||
{{- . | toYaml | nindent 8 }}
|
||||
{{- end }}
|
||||
@@ -69,10 +69,10 @@ bootstrap:
|
||||
recoveryTarget:
|
||||
targetTime: {{ . }}
|
||||
{{- end }}
|
||||
{{ with .Values.recovery.backup.database }}
|
||||
{{- with .Values.recovery.backup.database }}
|
||||
database: {{ . }}
|
||||
{{- end }}
|
||||
{{ with .Values.recovery.backup.owner }}
|
||||
{{- with .Values.recovery.backup.owner }}
|
||||
owner: {{ . }}
|
||||
{{- end }}
|
||||
backup:
|
||||
@@ -83,17 +83,17 @@ bootstrap:
|
||||
recoveryTarget:
|
||||
targetTime: {{ . }}
|
||||
{{- end }}
|
||||
{{ with .Values.recovery.objectStore.database }}
|
||||
{{- with .Values.recovery.objectStore.database }}
|
||||
database: {{ . }}
|
||||
{{- end }}
|
||||
{{ with .Values.recovery.objectStore.owner }}
|
||||
{{- with .Values.recovery.objectStore.owner }}
|
||||
owner: {{ . }}
|
||||
{{- end }}
|
||||
source: {{ include "cluster.recoveryServerName" . }}
|
||||
{{- else }}
|
||||
{{- else -}}
|
||||
{{ fail "Invalid recovery mode!" }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{ fail "Invalid cluster mode!" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{{- define "cluster.externalClusters" }}
|
||||
{{- if eq .Values.mode "standalone" }}
|
||||
{{- else if eq .Values.mode "recovery" }}
|
||||
{{- define "cluster.externalClusters" -}}
|
||||
{{- if eq .Values.mode "standalone" -}}
|
||||
{{- else if eq .Values.mode "recovery" -}}
|
||||
externalClusters:
|
||||
{{- if eq .Values.recovery.method "import" }}
|
||||
- name: importSource
|
||||
@@ -15,7 +15,7 @@ externalClusters:
|
||||
barmanObjectName: "{{ include "cluster.name" . }}-recovery"
|
||||
serverName: {{ include "cluster.recoveryServerName" . }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- else -}}
|
||||
{{ fail "Invalid cluster mode!" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -124,7 +124,7 @@ spec:
|
||||
{{- toYaml . | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if not (empty .Values.backup.objectStore) -}}
|
||||
{{- if not (empty .Values.backup.objectStore) }}
|
||||
plugins:
|
||||
{{- range $objectStore := .Values.backup.objectStore }}
|
||||
- name: barman-cloud.cloudnative-pg.io
|
||||
|
||||
Reference in New Issue
Block a user