Skip to content

Commit

Permalink
chore: fix mongodb backup failed when using hostnetwork (#335)
Browse files Browse the repository at this point in the history
(cherry picked from commit 638643d)
  • Loading branch information
wangyelei committed Feb 29, 2024
1 parent d2c3c7b commit 69e142b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion addons/mongodb/dataprotection/backup-info-collector.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function get_current_time() {
CLIENT=$(which mongosh >/dev/null && echo mongosh || echo mongo)
curr_time=$(${CLIENT} -u ${DP_DB_USER} -p ${DP_DB_PASSWORD} --port 27017 --host ${DP_DB_HOST} --authenticationDatabase admin --eval 'db.isMaster().lastWrite.lastWriteDate.getTime()/1000' --quiet)
curr_time=$(${CLIENT} -u ${DP_DB_USER} -p ${DP_DB_PASSWORD} --port ${DP_DB_PORT} --host ${DP_DB_HOST} --authenticationDatabase admin --eval 'db.isMaster().lastWrite.lastWriteDate.getTime()/1000' --quiet)
curr_time=$(date -d "@${curr_time}" -u '+%Y-%m-%dT%H:%M:%SZ')
echo $curr_time
}
Expand Down
2 changes: 0 additions & 2 deletions addons/mongodb/templates/actionset-dump.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ spec:
env:
- name: DATA_DIR
value: {{ .Values.dataMountPath }}/db
- name: DP_DB_PORT
value: "27017"
- name: IMAGE_TAG
value: {{ .Values.image.tag }}
- name: PARALLEL
Expand Down

0 comments on commit 69e142b

Please sign in to comment.