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.
This commit is contained in:
parent
71c048c932
commit
9283a6905c
|
|
@ -24,7 +24,7 @@ spec:
|
|||
- |
|
||||
set -ex
|
||||
# Generate mysql server-id from pod ordinal index.
|
||||
[[ `hostname` =~ -([0-9]+)$ ]] || exit 1
|
||||
[[ $HOSTNAME =~ -([0-9]+)$ ]] || exit 1
|
||||
ordinal=${BASH_REMATCH[1]}
|
||||
echo [mysqld] > /mnt/conf.d/server-id.cnf
|
||||
# Add an offset to avoid reserved server-id=0 value.
|
||||
|
|
|
|||
Loading…
Reference in New Issue