Skip to content

Commit 0580e85

Browse files
Romain JACQUETrjacquet31
authored andcommitted
fix: mongodb restore / backup jobs currently does not support the
replicaset add a new parameter to insert the extra parameter for url
1 parent 119ffc5 commit 0580e85

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

charts/kargo/templates/_db-backup.tpl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ The restore cronjob is suspended to be started manually.
331331
- host The host where the dabatabase is running
332332
- username The database username to use to perform the dump
333333
- password The username password
334+
- urlParams Extra parameters for the url, ex replicaset name
334335
- rcloneSecret The name of the secret where rclone.conf can be found
335336
- backupCron The schedule expression "0 * * * *"
336337
- remotePath The folder where the backup will be transfered (the filename is generated).
@@ -354,7 +355,7 @@ type: Opaque
354355
stringData:
355356
mongo-config.yml: |-
356357
password: {{ .args.password | default "" }}
357-
uri: mongodb://{{ if hasKey .args "username" }}{{ .args.username }}@{{ end }}{{ .args.host }}
358+
uri: mongodb://{{ if hasKey .args "username" }}{{ .args.username }}@{{ end }}{{ .args.host }}{{ if hasKey .args "urlParams" }}?{{ .args.urlParams }}{{ end }}
358359

359360
{{- if eq (include "kargo.tplvalues.render" (dict "value" (.args.ignoreBackup | default false) "context" .context) | trim | lower) "false" }}
360361
---
@@ -822,6 +823,7 @@ The restore cronjob is suspended to be started manually.
822823
- username The database username to use to perform the dump
823824
- password The username password
824825
- database The database to dump
826+
- urlParams Extra parameters for the url, ex replicaset name
825827
- remotePath The folder where the backup will be transfered (the filename is generated).
826828
- rcloneSecret The name of the secret where rclone.conf can be found
827829
- backupCron The schedule expression "0 * * * *"
@@ -845,7 +847,7 @@ type: Opaque
845847
stringData:
846848
mongo-config.yml: |-
847849
password: {{ .args.password | default "" }}
848-
uri: mongodb://{{ if hasKey .args "username" }}{{ .args.username }}@{{ end }}{{ .args.host }}/{{ .args.database }}
850+
uri: mongodb://{{ if hasKey .args "username" }}{{ .args.username }}@{{ end }}{{ .args.host }}/{{ .args.database }}{{ if hasKey .args "urlParams" }}?{{ .args.urlParams }}{{ end }}
849851

850852
{{- if eq (include "kargo.tplvalues.render" (dict "value" (.args.ignoreBackup | default false) "context" .context) | trim | lower) "false" }}
851853
---

0 commit comments

Comments
 (0)