Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the registry clusters entrypoint to support the use of custom username and password combinations #1224

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 16 additions & 2 deletions src/server/src/main/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,30 @@ if [ "$1" = 'register-clusters' ]; then
REAPER_PORT=$4
fi

if [ -z "$REAPER_AUTH_USER" ]; then
echo "The register-clusters command did not find a value for the REAPER_AUTH_USER environment variable. Defaulting to the admin user."
USERNAME="admin"
else
USERNAME=$REAPER_AUTH_USER
fi

if [ -z "$REAPER_AUTH_PASSWORD" ]; then
echo "The register-clusters command did not find a value for the REAPER_AUTH_PASSWORD environment variable. Defaulting to the default admin password."
PASSWORD="admin"
else
PASSWORD=$REAPER_AUTH_PASSWORD
fi

mkdir -p ~/.reaper
echo "admin" > ~/.reaper/credentials
echo ${PASSWORD} > ~/.reaper/credentials

wait_for ${REAPER_HOST} ${REAPER_PORT}

for SEED in $(echo "${REAPER_AUTO_SCHEDULING_SEEDS}" | sed "s/,/ /g"); do
SEED_HOST=$(echo ${SEED} | cut -d':' -f1)
SEED_PORT=$(echo ${SEED} | cut -d':' -f2)
wait_for ${SEED_HOST} ${SEED_PORT}
/usr/local/bin/spreaper login --reaper-host "${REAPER_HOST}" --reaper-port "${REAPER_PORT}" admin
/usr/local/bin/spreaper login --reaper-host "${REAPER_HOST}" --reaper-port "${REAPER_PORT}" $USERNAME
/usr/local/bin/spreaper add-cluster --reaper-host "${REAPER_HOST}" --reaper-port "${REAPER_PORT}" "${SEED_HOST}" "${SEED_PORT}"
done

Expand Down