Skip to content

Commit

Permalink
Fix backup copy
Browse files Browse the repository at this point in the history
  • Loading branch information
majst01 committed Aug 25, 2023
1 parent 8fadb33 commit 28193e0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 deletions.
4 changes: 2 additions & 2 deletions cmd/internal/database/meilisearch/meilisearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ func (db *Meilisearch) moveDumpToBackupDir() error {
}

backupDst := path.Join(constants.BackupDir, latestStableDump)
db.log.Infow("move dump", "from", src, "to", backupDst)
copy := exec.Command("mv", "-v", src, backupDst)
db.log.Infow("move dump", "from", db.latestStableDumpDst, "to", backupDst)
copy := exec.Command("mv", "-v", db.latestStableDumpDst, backupDst)
copy.Stdout = os.Stdout
copy.Stderr = os.Stderr
err = copy.Run()
Expand Down
27 changes: 7 additions & 20 deletions deploy/meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,8 @@ spec:
imagePullPolicy: IfNotPresent
name: meilisearch
command:
- tini
- --
args:
- sh
- -x
- -c
- backup-restore-sidecar wait --log-level debug && meilisearch
- backup-restore-sidecar
- wait
livenessProbe:
failureThreshold: 3
httpGet:
Expand Down Expand Up @@ -86,18 +81,12 @@ spec:
mountPath: /usr/local/bin/backup-restore-sidecar
- name: backup-restore-sidecar-config
mountPath: /etc/backup-restore-sidecar
- name: bin-provision
subPath: tini
mountPath: /usr/local/bin/tini
- image: getmeili/meilisearch:v1.2.0
name: backup-restore-sidecar
command:
- tini
- --
args:
- sh
- -c
- backup-restore-sidecar start --log-level debug
- backup-restore-sidecar
- start
- --log-level=debug
env:
# FIXME fetch from secret
- name: BACKUP_RESTORE_SIDECAR_MEILISEARCH_APIKEY
Expand All @@ -114,17 +103,13 @@ spec:
mountPath: /usr/local/bin/backup-restore-sidecar
- name: backup-restore-sidecar-config
mountPath: /etc/backup-restore-sidecar
- name: bin-provision
subPath: tini
mountPath: /usr/local/bin/tini
initContainers:
- name: backup-restore-sidecar-provider
image: ghcr.io/metal-stack/backup-restore-sidecar:meilisearch-support
imagePullPolicy: Always
command:
- cp
- /backup-restore-sidecar
- /sbin/tini
- /bin-provision
ports:
- containerPort: 2112
Expand Down Expand Up @@ -164,6 +149,8 @@ data:
backup-cron-schedule: "*/1 * * * *"
object-prefix: meilisearch-test
compression-method: tar
post-exec-cmds:
- meilisearch
---
apiVersion: v1
data:
Expand Down

0 comments on commit 28193e0

Please sign in to comment.