Skip to content

Commit be1719b

Browse files
authored
Merge pull request #169 from infosiftr/config-warning
Add a warning if "--config" is specified and we're going to attempt initdb
2 parents 017d431 + 1df3c60 commit be1719b

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

3.0/docker-entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@ if [ "$originalArgOne" = 'mongod' ]; then
123123
done
124124

125125
if [ -z "$definitelyAlreadyInitialized" ]; then
126+
if _mongod_hack_have_arg --config "$@"; then
127+
echo >&2
128+
echo >&2 'warning: database is not yet initialized, and "--config" is specified'
129+
echo >&2 ' the initdb database startup might fail as a result!'
130+
echo >&2
131+
fi
132+
126133
pidfile="$(mktemp)"
127134
trap "rm -f '$pidfile'" EXIT
128135
_mongod_hack_ensure_arg_val --bind_ip 127.0.0.1 "$@"

3.2/docker-entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@ if [ "$originalArgOne" = 'mongod' ]; then
123123
done
124124

125125
if [ -z "$definitelyAlreadyInitialized" ]; then
126+
if _mongod_hack_have_arg --config "$@"; then
127+
echo >&2
128+
echo >&2 'warning: database is not yet initialized, and "--config" is specified'
129+
echo >&2 ' the initdb database startup might fail as a result!'
130+
echo >&2
131+
fi
132+
126133
pidfile="$(mktemp)"
127134
trap "rm -f '$pidfile'" EXIT
128135
_mongod_hack_ensure_arg_val --bind_ip 127.0.0.1 "$@"

3.4/docker-entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@ if [ "$originalArgOne" = 'mongod' ]; then
123123
done
124124

125125
if [ -z "$definitelyAlreadyInitialized" ]; then
126+
if _mongod_hack_have_arg --config "$@"; then
127+
echo >&2
128+
echo >&2 'warning: database is not yet initialized, and "--config" is specified'
129+
echo >&2 ' the initdb database startup might fail as a result!'
130+
echo >&2
131+
fi
132+
126133
pidfile="$(mktemp)"
127134
trap "rm -f '$pidfile'" EXIT
128135
_mongod_hack_ensure_arg_val --bind_ip 127.0.0.1 "$@"

3.5/docker-entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@ if [ "$originalArgOne" = 'mongod' ]; then
123123
done
124124

125125
if [ -z "$definitelyAlreadyInitialized" ]; then
126+
if _mongod_hack_have_arg --config "$@"; then
127+
echo >&2
128+
echo >&2 'warning: database is not yet initialized, and "--config" is specified'
129+
echo >&2 ' the initdb database startup might fail as a result!'
130+
echo >&2
131+
fi
132+
126133
pidfile="$(mktemp)"
127134
trap "rm -f '$pidfile'" EXIT
128135
_mongod_hack_ensure_arg_val --bind_ip 127.0.0.1 "$@"

0 commit comments

Comments
 (0)