From f0a162b4aaf402949509f1bc2ce5bff871590fb4 Mon Sep 17 00:00:00 2001 From: Damien Coraboeuf Date: Wed, 27 Dec 2023 09:44:22 +0100 Subject: [PATCH] feat: backup name --- charts/pg-db-backup-do-space/Chart.yaml | 2 +- charts/pg-db-backup-do-space/templates/db-extraction-job.yaml | 2 +- charts/pg-db-backup-do-space/values.yaml | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/charts/pg-db-backup-do-space/Chart.yaml b/charts/pg-db-backup-do-space/Chart.yaml index 02ec25a..63ca51b 100644 --- a/charts/pg-db-backup-do-space/Chart.yaml +++ b/charts/pg-db-backup-do-space/Chart.yaml @@ -4,5 +4,5 @@ description: This chart is used to set up a job which saves the content of a Dig type: application -version: 0.1.3 +version: 0.1.4 appVersion: "0.1.1" diff --git a/charts/pg-db-backup-do-space/templates/db-extraction-job.yaml b/charts/pg-db-backup-do-space/templates/db-extraction-job.yaml index 480da45..4231d75 100644 --- a/charts/pg-db-backup-do-space/templates/db-extraction-job.yaml +++ b/charts/pg-db-backup-do-space/templates/db-extraction-job.yaml @@ -35,7 +35,7 @@ spec: --host-bucket='%(bucket)s.{{ .Values.digitalocean.space.region }}.digitaloceanspaces.com' \ put \ dump.sql \ - s3://{{ .Values.digitalocean.space.bucket }}/{{ .Values.digitalocean.space.path.root }}/{{ .Values.database.name }}/dump-$(date +%Y%m%d%H%M%S).sql + s3://{{ .Values.digitalocean.space.bucket }}/{{ .Values.digitalocean.space.path.root }}/{{ or .Values.backup.name .Values.database.name }}/dump-$(date +%Y%m%d%H%M%S).sql env: - name: PGSSLMODE value: "require" diff --git a/charts/pg-db-backup-do-space/values.yaml b/charts/pg-db-backup-do-space/values.yaml index 0136655..cf7be35 100644 --- a/charts/pg-db-backup-do-space/values.yaml +++ b/charts/pg-db-backup-do-space/values.yaml @@ -2,6 +2,8 @@ backup: # Schedule schedule: "0 0 * * *" + # Name of the backup (if not defined, defaults to the database name) + name: "" # Connection to the PG cluster connection: # Host name or IP