Skip to content

Commit 9283a69

Browse files
authored
Update mysql-statefulset.yaml
As per the issue #35432, hostname command is no longer available as mysql:5.7 is based on oracle. For the command on line 27 to work, it is sufficient to use the $HOSTNAME variable which is set in the container, for it to work effectively.
1 parent 71c048c commit 9283a69

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/en/examples/application/mysql/mysql-statefulset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec:
2424
- |
2525
set -ex
2626
# Generate mysql server-id from pod ordinal index.
27-
[[ `hostname` =~ -([0-9]+)$ ]] || exit 1
27+
[[ $HOSTNAME =~ -([0-9]+)$ ]] || exit 1
2828
ordinal=${BASH_REMATCH[1]}
2929
echo [mysqld] > /mnt/conf.d/server-id.cnf
3030
# Add an offset to avoid reserved server-id=0 value.

0 commit comments

Comments
 (0)