Skip to content

Commit 8ce30d4

Browse files
authored
Merge pull request #1015 from percona/K8SPS-265_fix_heartbeat
K8SPS-265 fix heartbeat
2 parents a16b171 + f7cd7ce commit 8ce30d4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

build/heartbeat-entrypoint.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ for i in {1..5}; do
3030
fi
3131
done
3232

33+
# If password contains commas they must be escaped with a backslash: “exam,ple” according https://docs.percona.com/percona-toolkit/pt-heartbeat.html
34+
ESCAPED_HEARTBEAT_PASSWORD="${HEARTBEAT_PASSWORD//,/\\,}"
35+
3336
HEARTBEAT_USER='heartbeat'
3437
echo "[INFO] pt-heartbeat --update --replace --fail-successive-errors 20 --check-read-only --create-table --database sys_operator \
3538
--table heartbeat --user ${HEARTBEAT_USER} --password XXXX --port ${MYSQL_ADMIN_PORT}"
@@ -43,5 +46,5 @@ pt-heartbeat \
4346
--database sys_operator \
4447
--table heartbeat \
4548
--user "${HEARTBEAT_USER}" \
46-
--password "${HEARTBEAT_PASSWORD}" \
49+
--password "${ESCAPED_HEARTBEAT_PASSWORD}" \
4750
--port "${MYSQL_ADMIN_PORT}"

build/ps-entrypoint.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ file_env() {
4242
fi
4343
export "$var"="$val"
4444
unset "$fileVar"
45-
set -o xtrace
4645
}
4746

4847
# usage: process_init_file FILENAME MYSQLCOMMAND...
@@ -294,7 +293,6 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
294293
MYSQL_ROOT_PASSWORD="$(pwmake 128)"
295294
echo "GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD"
296295
fi
297-
set -x
298296

299297
rootCreate=
300298
# default root to listen for connections from anywhere
@@ -366,7 +364,6 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
366364
FLUSH PRIVILEGES ;
367365
EOSQL
368366

369-
{ set +x; } 2>/dev/null
370367
if [ -n "$MYSQL_ROOT_PASSWORD" ]; then
371368
mysql+=(-p"${MYSQL_ROOT_PASSWORD}")
372369
fi

0 commit comments

Comments
 (0)