Skip to content

Commit 56e1d68

Browse files
authored
Merge pull request #457 from infosiftr/ignore-empty-config
Ignore empty config files
2 parents 1322308 + be84ebd commit 56e1d68

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

3.6/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ _parse_config() {
150150
fi
151151

152152
local configPath
153-
if configPath="$(_mongod_hack_get_arg_val --config "$@")"; then
153+
if configPath="$(_mongod_hack_get_arg_val --config "$@")" && [ -s "$configPath" ]; then
154154
# if --config is specified, parse it into a JSON file so we can remove a few problematic keys (especially SSL-related keys)
155155
# see https://docs.mongodb.com/manual/reference/configuration-options/
156156
if grep -vEm1 '^[[:space:]]*(#|$)' "$configPath" | grep -qE '^[[:space:]]*[^=:]+[[:space:]]*='; then

4.0/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ _parse_config() {
150150
fi
151151

152152
local configPath
153-
if configPath="$(_mongod_hack_get_arg_val --config "$@")"; then
153+
if configPath="$(_mongod_hack_get_arg_val --config "$@")" && [ -s "$configPath" ]; then
154154
# if --config is specified, parse it into a JSON file so we can remove a few problematic keys (especially SSL-related keys)
155155
# see https://docs.mongodb.com/manual/reference/configuration-options/
156156
if grep -vEm1 '^[[:space:]]*(#|$)' "$configPath" | grep -qE '^[[:space:]]*[^=:]+[[:space:]]*='; then

4.2/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ _parse_config() {
150150
fi
151151

152152
local configPath
153-
if configPath="$(_mongod_hack_get_arg_val --config "$@")"; then
153+
if configPath="$(_mongod_hack_get_arg_val --config "$@")" && [ -s "$configPath" ]; then
154154
# if --config is specified, parse it into a JSON file so we can remove a few problematic keys (especially SSL-related keys)
155155
# see https://docs.mongodb.com/manual/reference/configuration-options/
156156
if grep -vEm1 '^[[:space:]]*(#|$)' "$configPath" | grep -qE '^[[:space:]]*[^=:]+[[:space:]]*='; then

4.4/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ _parse_config() {
150150
fi
151151

152152
local configPath
153-
if configPath="$(_mongod_hack_get_arg_val --config "$@")"; then
153+
if configPath="$(_mongod_hack_get_arg_val --config "$@")" && [ -s "$configPath" ]; then
154154
# if --config is specified, parse it into a JSON file so we can remove a few problematic keys (especially SSL-related keys)
155155
# see https://docs.mongodb.com/manual/reference/configuration-options/
156156
if grep -vEm1 '^[[:space:]]*(#|$)' "$configPath" | grep -qE '^[[:space:]]*[^=:]+[[:space:]]*='; then

docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ _parse_config() {
150150
fi
151151

152152
local configPath
153-
if configPath="$(_mongod_hack_get_arg_val --config "$@")"; then
153+
if configPath="$(_mongod_hack_get_arg_val --config "$@")" && [ -s "$configPath" ]; then
154154
# if --config is specified, parse it into a JSON file so we can remove a few problematic keys (especially SSL-related keys)
155155
# see https://docs.mongodb.com/manual/reference/configuration-options/
156156
if grep -vEm1 '^[[:space:]]*(#|$)' "$configPath" | grep -qE '^[[:space:]]*[^=:]+[[:space:]]*='; then

0 commit comments

Comments
 (0)