Skip to content

Commit 914f9ae

Browse files
committed
[ja] use $HOSTNAME env variable instead of hostname command
1 parent e2a139c commit 914f9ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

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

0 commit comments

Comments
 (0)