Skip to content

Commit fa05071

Browse files
committed
Make agent launcher script fail if tools are missing
1 parent 9fe3cb0 commit fa05071

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docker/mongodb-kubernetes-init-database/content/agent-launcher.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,10 @@ else
206206
ln -sf "${MONGOD_ROOT}/bin/mongod" ${mdb_downloads_dir}/mongod/bin/mongod
207207
ln -sf "${MONGOD_ROOT}/bin/mongos" ${mdb_downloads_dir}/mongod/bin/mongos
208208

209-
ln -sf "/tools/mongodump" ${mdb_downloads_dir}/mongod/bin/mongodump
210-
ln -sf "/tools/mongorestore" ${mdb_downloads_dir}/mongod/bin/mongorestore
211-
ln -sf "/tools/mongoexport" ${mdb_downloads_dir}/mongod/bin/mongoexport
212-
ln -sf "/tools/mongoimport" ${mdb_downloads_dir}/mongod/bin/mongoimport
209+
for tool in mongoimport mongodump mongorestore mongoexport; do
210+
[ -e "/tools/${tool}" ] || { echo "/tools/${tool} not found"; exit 1; }
211+
ln -sf "/tools/${tool}" ${mdb_downloads_dir}/mongod/bin/${tool}
212+
done
213213
else
214214
echo "Mongod PID not found within the specified time."
215215
exit 1

0 commit comments

Comments
 (0)