From 6bd767a68605db8e16a553d0f61766969852d3ca Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Fri, 3 Nov 2023 09:09:58 +1100 Subject: [PATCH] fix: use the right database name variable (#251) --- internal/templating/backups/template_prebackuppod.go | 4 ++-- .../backups/test-resources/result-prebackuppod2.yaml | 2 +- .../backups/test-resources/result-prebackuppod3.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/templating/backups/template_prebackuppod.go b/internal/templating/backups/template_prebackuppod.go index b558c248..326c3ebf 100644 --- a/internal/templating/backups/template_prebackuppod.go +++ b/internal/templating/backups/template_prebackuppod.go @@ -322,7 +322,7 @@ pod: fi && PGPASSWORD=$BACKUP_DB_PASSWORD pg_dump --host=$BACKUP_DB_HOST --port=$BACKUP_DB_PORT - --dbname=$BACKUP_DB_NAME + --dbname=$BACKUP_DB_DATABASE --username=$BACKUP_DB_USERNAME --format=t -w" fileExtension: .{{ .Name }}.tar @@ -356,7 +356,7 @@ pod: image: uselagoon/database-tools:latest imagePullPolicy: Always name: {{ .Name }}-prebackuppod`, - "mongodb-dbaas": `backupCommand: /bin/sh -c "mongodump --uri=mongodb://${BACKUP_DB_USER}:${BACKUP_DB_PASSWORD}@${BACKUP_DB_HOST}:${BACKUP_DB_PORT}/${BACKUP_DB_NAME}?ssl=true&sslInsecure=true&tls=true&tlsInsecure=true --archive" + "mongodb-dbaas": `backupCommand: /bin/sh -c "mongodump --uri=mongodb://${BACKUP_DB_USER}:${BACKUP_DB_PASSWORD}@${BACKUP_DB_HOST}:${BACKUP_DB_PORT}/${BACKUP_DB_DATABASE}?ssl=true&sslInsecure=true&tls=true&tlsInsecure=true --archive" fileExtension: .{{ .Name }}.bson pod: spec: diff --git a/internal/templating/backups/test-resources/result-prebackuppod2.yaml b/internal/templating/backups/test-resources/result-prebackuppod2.yaml index 870c21d2..80aea9aa 100644 --- a/internal/templating/backups/test-resources/result-prebackuppod2.yaml +++ b/internal/templating/backups/test-resources/result-prebackuppod2.yaml @@ -20,7 +20,7 @@ metadata: name: postgres-database-prebackuppod spec: backupCommand: | - /bin/sh -c "if [ ! -z $BACKUP_DB_READREPLICA_HOSTS ]; then BACKUP_DB_HOST=$(echo $BACKUP_DB_READREPLICA_HOSTS | cut -d ',' -f1); fi && PGPASSWORD=$BACKUP_DB_PASSWORD pg_dump --host=$BACKUP_DB_HOST --port=$BACKUP_DB_PORT --dbname=$BACKUP_DB_NAME --username=$BACKUP_DB_USERNAME --format=t -w" + /bin/sh -c "if [ ! -z $BACKUP_DB_READREPLICA_HOSTS ]; then BACKUP_DB_HOST=$(echo $BACKUP_DB_READREPLICA_HOSTS | cut -d ',' -f1); fi && PGPASSWORD=$BACKUP_DB_PASSWORD pg_dump --host=$BACKUP_DB_HOST --port=$BACKUP_DB_PORT --dbname=$BACKUP_DB_DATABASE --username=$BACKUP_DB_USERNAME --format=t -w" fileExtension: .postgres-database.tar pod: metadata: {} diff --git a/internal/templating/backups/test-resources/result-prebackuppod3.yaml b/internal/templating/backups/test-resources/result-prebackuppod3.yaml index 92a21f7f..7230de39 100644 --- a/internal/templating/backups/test-resources/result-prebackuppod3.yaml +++ b/internal/templating/backups/test-resources/result-prebackuppod3.yaml @@ -19,7 +19,7 @@ metadata: prebackuppod: mongodb-database name: mongodb-database-prebackuppod spec: - backupCommand: /bin/sh -c "mongodump --uri=mongodb://${BACKUP_DB_USER}:${BACKUP_DB_PASSWORD}@${BACKUP_DB_HOST}:${BACKUP_DB_PORT}/${BACKUP_DB_NAME}?ssl=true&sslInsecure=true&tls=true&tlsInsecure=true + backupCommand: /bin/sh -c "mongodump --uri=mongodb://${BACKUP_DB_USER}:${BACKUP_DB_PASSWORD}@${BACKUP_DB_HOST}:${BACKUP_DB_PORT}/${BACKUP_DB_DATABASE}?ssl=true&sslInsecure=true&tls=true&tlsInsecure=true --archive" fileExtension: .mongodb-database.bson pod: