Merge pull request #37917 from Arhell/ja-use

[ja] use $HOSTNAME env variable instead of hostname command
pull/37942/head
Kubernetes Prow Robot 2022-11-21 17:22:14 -08:00 committed by GitHub
commit 0bef9ea716
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,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.