fix issues, no default backups
All checks were successful
release-charts-postgres-cluster / release (push) Successful in 18s

This commit is contained in:
2025-05-24 03:09:47 -05:00
parent a7150e1d20
commit 245212e878
7 changed files with 46 additions and 42 deletions

View File

@@ -94,3 +94,10 @@ Generate name for recovery object store credentials
{{- printf "%s-backup-secret" (include "cluster.name" .) | trunc 63 | trimSuffix "-" -}}
{{- end }}
{{- end }}
{{/*
Generate name for backup object store credentials
*/}}
{{- define "cluster.backupCredentials" -}}
{{- printf "%s-backup-secret" (include "cluster.name" .) | trunc 63 | trimSuffix "-" -}}
{{- end }}

View File

@@ -22,15 +22,12 @@ spec:
{{ if or (eq .Values.backup.method "objectStore") (eq .Values.recovery.method "objectStore") }}
plugins:
{{ end }}
{{ if and (.Values.backup.enabled) (eq .Values.backup.method "objectStore") }}
{{ $context := . -}}
{{ range .Values.backup.objectStore -}}
{{- range $objectStore := .Values.backup.objectStore }}
- name: barman-cloud.cloudnative-pg.io
isWALArchiver: {{ .isWALArchiver }}
isWALArchiver: {{ $objectStore.isWALArchiver }}
parameters:
barmanObjectName: "{{ include "cluster.name" $context }}-{{ .name }}-backup"
{{ end -}}
{{ end }}
barmanObjectName: "{{ include "cluster.name" $ }}-{{ $objectStore.name }}-backup"
{{- end }}
{{ if eq .Values.recovery.method "objectStore" }}
- name: barman-cloud.cloudnative-pg.io
parameters:

View File

@@ -27,10 +27,10 @@ spec:
{{- if .wal }}
wal:
compression: {{ .wal.compression | default "snappy" }}
{{- with .wal.encryption }}
{{ with .wal.encryption }}
encryption: {{ . }}
{{- end }}
maxParallel: {{ .wal.maxParallel | default 1 }}
{{ end }}
maxParallel: {{ .wal.maxParallel | default "1" }}
{{- end }}
{{- if .wal }}
data:
@@ -45,14 +45,14 @@ spec:
{{- if .endpointCredentials }}
name: {{ .endpointCredentials }}
{{- else }}
name: {{- printf "%s-backup-secret" (include "cluster.name" $context) | trunc 63 | trimSuffix "-" -}}
name: {{ include "cluster.recoveryCredentials" $context }}
{{- end }}
key: ACCESS_KEY_ID
secretAccessKey:
{{- if .endpointCredentials }}
name: {{ .endpointCredentials }}
{{- else }}
name: {{- printf "%s-backup-secret" (include "cluster.name" $context) | trunc 63 | trimSuffix "-" -}}
name: {{ include "cluster.recoveryCredentials" $context }}
{{- end }}
key: ACCESS_SECRET_KEY
{{ end -}}

View File

@@ -10,15 +10,15 @@ metadata:
labels:
{{- include "cluster.labels" $context | nindent 4 }}
spec:
immediate: true
suspend: {{ .suspend }}
schedule: {{ .schedule | quote }}
backupOwnerReference: {{ .backupOwnerReference }}
immediate: {{ .immediate | default true }}
suspend: {{ .suspend | default false }}
schedule: {{ .schedule | quote | required "Schedule is required" }}
backupOwnerReference: {{ .backupOwnerReference | default "self" }}
cluster:
name: {{ include "cluster.name" $context }}-cluster
method: plugin
pluginConfiguration:
name: {{ .plugin }}
name: {{ .plugin | default "barman-cloud.cloudnative-pg.io" }}
parameters:
barmanObjectName: "{{ include "cluster.name" $context }}-{{ .backupName }}-backup"
{{ end -}}