Skip to content

Commit 0433402

Browse files
authored
Merge pull request #107 from lamvng/main
feat(backup-restore): Add flags to allow disable backup/restore hook …
2 parents cd9b704 + 780339f commit 0433402

4 files changed

Lines changed: 8 additions & 0 deletions

File tree

charts/firefly-db/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ storage:
3737
| backup.pvc.dataSize | string | `"1Gi"` | |
3838
| backup.pvc.existingClaim | string | `""` | Use an existing PersistentVolumeClaim, overrides values above |
3939
| backupSchedule | string | `"0 3 * * *"` | |
40+
| configs.BACKUP_ENABLED | bool | `true` | Enable backup hook job |
4041
| configs.BACKUP_URL | string | `""` | |
4142
| configs.DBHOST | string | `""` | |
4243
| configs.DBNAME | string | `"firefly"` | |
@@ -46,6 +47,7 @@ storage:
4647
| configs.POSTGRES_HOST_AUTH_METHOD | string | `"trust"` | |
4748
| configs.POSTGRES_PASSWORD | string | `""` | |
4849
| configs.POSTGRES_USER | string | `"firefly"` | |
50+
| configs.RESTORE_ENABLED | bool | `true` | Enable restore hook job |
4951
| configs.RESTORE_URL | string | `""` | |
5052
| configs.TZ | string | `"Europe/Amsterdam"` | |
5153
| configs.existingSecret | string | `""` | Set this to the name of a secret to load environment variables from. If defined, values in the secret will override values in configs |

charts/firefly-db/templates/firefly-db-backup-job.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.configs.BACKUP_ENABLED }}
12
{{- if and (eq .Values.backup.destination "http") (empty .Values.configs.BACKUP_URL) }}
23
{{- fail "BACKUP_URL must be set when backup.destination is 'http'" }}
34
{{- end }}
@@ -23,3 +24,4 @@ spec:
2324
completions: 1
2425
template:
2526
{{- include "backupJobSpec" . | indent 4 }}
27+
{{- end }}

charts/firefly-db/templates/firefly-db-restore-job.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.configs.RESTORE_ENABLED }}
12
apiVersion: batch/v1
23
kind: Job
34
metadata:
@@ -57,3 +58,4 @@ spec:
5758
{{- else }}
5859
emptyDir: {}
5960
{{- end }}
61+
{{- end }}

charts/firefly-db/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ backup:
2121
existingClaim: ""
2222

2323
configs:
24+
RESTORE_ENABLED: true
25+
BACKUP_ENABLED: true
2426
RESTORE_URL: ""
2527
BACKUP_URL: "" # -- Must have value if backup.destination is set to http
2628
PGPASSWORD: ""

0 commit comments

Comments
 (0)