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

[DPE-4173] Add ability to customize router exporter listen port #50

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions snap/local/start-mysql-router-exporter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ EXPORTER_OPTS=(
EXPORTER_PATH="/usr/bin/mysqlrouter_exporter"

if [ -n "$SNAP" ]; then
MYSQLROUTER_EXPORTER_LISTEN_PORT="$(snapctl get mysqlrouter-exporter.listen-port)"
MYSQLROUTER_EXPORTER_USER="$(snapctl get mysqlrouter-exporter.user)"
MYSQLROUTER_EXPORTER_PASS="$(snapctl get mysqlrouter-exporter.password)"
MYSQLROUTER_EXPORTER_URL="$(snapctl get mysqlrouter-exporter.url)"
Expand Down Expand Up @@ -60,6 +61,11 @@ if [ -z "${MYSQLROUTER_EXPORTER_SERVICE_NAME}" ]; then
exit 1
fi

# Modify the listen-port if supplied
if [ -n "${MYSQLROUTER_EXPORTER_LISTEN_PORT}" ]; then
EXPORTER_OPTS+=("--listen-port=${MYSQLROUTER_EXPORTER_LISTEN_PORT}")
fi

# Execute the mysqlrouter_exporter command
if [ -n "${SNAP}" ]; then
SETPRIV_OPTIONS=(
Expand Down