Skip to content

Commit 59d7871

Browse files
authored
Merge pull request #424 from infosiftr/entrypoint-deprecation
Add deprecation warnings to "docker-entrypoint.sh"
2 parents bc88db1 + 2fab209 commit 59d7871

File tree

5 files changed

+70
-5
lines changed

5 files changed

+70
-5
lines changed

3.8-rc/alpine/docker-entrypoint.sh

Lines changed: 14 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

3.8-rc/ubuntu/docker-entrypoint.sh

Lines changed: 14 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

3.8/alpine/docker-entrypoint.sh

Lines changed: 14 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

3.8/ubuntu/docker-entrypoint.sh

Lines changed: 14 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docker-entrypoint.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ for conf in "${!configDefaults[@]}"; do
179179
done
180180

181181
# if long and short hostnames are not the same, use long hostnames
182-
if [ "$(hostname)" != "$(hostname -s)" ]; then
182+
if [ -z "${RABBITMQ_USE_LONGNAME:-}" ] && [ "$(hostname)" != "$(hostname -s)" ]; then
183183
: "${RABBITMQ_USE_LONGNAME:=true}"
184184
fi
185185

@@ -195,6 +195,8 @@ if [ "${RABBITMQ_ERLANG_COOKIE:-}" ]; then
195195
echo "$RABBITMQ_ERLANG_COOKIE" > "$cookieFile"
196196
fi
197197
chmod 600 "$cookieFile"
198+
199+
echo >&2 "WARNING: '$cookieFile' was populated from '\$RABBITMQ_ERLANG_COOKIE', which will no longer happen in a future release! (https://github.com/docker-library/rabbitmq/pull/424)"
198200
fi
199201

200202
configBase="${RABBITMQ_CONFIG_FILE:-/etc/rabbitmq/rabbitmq}"
@@ -393,6 +395,13 @@ if [ "$1" = 'rabbitmq-server' ] && [ "$shouldWriteConfig" ]; then
393395
rabbit_set_config 'load_definitions' "$managementDefinitionsFile"
394396
fi
395397
fi
398+
399+
echo >&2 "WARNING: 'docker-entrypoint.sh' generated/modified the RabbitMQ configuration file, which will no longer happen in a future release! (https://github.com/docker-library/rabbitmq/pull/424)"
400+
echo >&2
401+
echo >&2 "Generated end result, for reference:"
402+
echo >&2 "------------------------------------"
403+
cat >&2 "$newConfigFile"
404+
echo >&2 "------------------------------------"
396405
fi
397406

398407
combinedSsl='/tmp/rabbitmq-ssl/combined.pem'
@@ -404,6 +413,8 @@ if [ "$haveSslConfig" ] && [[ "$1" == rabbitmq* ]] && [ ! -f "$combinedSsl" ]; t
404413
cat "$RABBITMQ_SSL_KEYFILE"
405414
} > "$combinedSsl"
406415
chmod 0400 "$combinedSsl"
416+
417+
echo >&2 "WARNING: relying on 'docker-entrypoint.sh' generating a combined PEM certificate file, which will no longer happen in a future release! (https://github.com/docker-library/rabbitmq/pull/424)"
407418
fi
408419
if [ "$haveSslConfig" ] && [ -f "$combinedSsl" ]; then
409420
# More ENV vars for make clustering happiness
@@ -413,6 +424,8 @@ if [ "$haveSslConfig" ] && [ -f "$combinedSsl" ]; then
413424
sslErlArgs="-pa $ERL_SSL_PATH -proto_dist inet_tls -ssl_dist_opt server_certfile $combinedSsl -ssl_dist_opt server_secure_renegotiate true client_secure_renegotiate true"
414425
export RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="${RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS:-} $sslErlArgs"
415426
export RABBITMQ_CTL_ERL_ARGS="${RABBITMQ_CTL_ERL_ARGS:-} $sslErlArgs"
427+
428+
# (no WARNING here, because this will only happen if we already displayed the "combined PEM certificate file" WARNING above, so it would be redundant)
416429
fi
417430

418431
exec "$@"

0 commit comments

Comments
 (0)