Skip to content

Commit aadc6f1

Browse files
authored
Add hostname and set Locale, fixes #311 (#312)
* Add initial dependabot config * Update config.yml * Add hostname and set Locale, fixes #311 * Remove dependabot
1 parent e57737d commit aadc6f1

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed

_test/rabbitmq.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,26 @@ test() {
4949
echo "Waiting for for all pods to start..."
5050
try_until 60 15 true "oc get sts/rabbitmq -n $NAMESPACE --template '{{ if .status.readyReplicas }}{{ eq .spec.replicas .status.readyReplicas }}{{ else }}false{{ end }}'" || kill -s TERM $TOP_PID
5151

52+
# Tests for issue #311
53+
echo "Ensure 'hostname' package is installed"
54+
hostname_rpm=$(oc -n $NAMESPACE rsh rabbitmq-0 rpm -q hostname)
55+
if [ $? -eq 0 ]; then
56+
echo "OK: RPM package 'hostname' installed"
57+
else
58+
echo "NOK: RPM package 'hostname' not installed"
59+
exit 1
60+
fi
61+
62+
echo "Ensure locale is set to UTF-8"
63+
lang_var=$(oc -n $NAMESPACE rsh rabbitmq-0 printenv LANG)
64+
if [[ "$lang_var" =~ "en_US.UTF-8" ]]; then
65+
echo "OK: Locale is set to 'en_US.UTF-8'"
66+
else
67+
echo "LANG: ===$lang_var==="
68+
echo "NOK: Locale is set to ${lang_var}, should be 'en_US.UTF-8'"
69+
exit 1
70+
fi
71+
5272
echo "Check RabbitMQ cluster status..."
5373
sts_json=$(oc get sts/rabbitmq -n $NAMESPACE -o json)
5474
replicas=$(jq '.spec.replicas' <<< $(echo $sts_json))

rabbitmq/.openshift/templates/imagestreams/images.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ items:
1313
- annotations: null
1414
from:
1515
kind: DockerImage
16-
name: registry.access.redhat.com/ubi7/ubi:7.7
16+
name: registry.access.redhat.com/ubi7/ubi:7.8
1717
importPolicy: {}
18-
name: "7.7"
18+
name: "7.8"
1919
referencePolicy:
2020
type: Source
2121
- annotations: null

rabbitmq/Dockerfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM registry.access.redhat.com/ubi7/ubi:7.7
1+
FROM registry.access.redhat.com/ubi7/ubi:7.8
22

33
ARG ERLANG_VERSION=22.1.4
44
ARG RABBITMQ_AUTOCLUSTER_VERSION=0.10.0
@@ -13,7 +13,10 @@ ENV GPG_KEY="0A9AF2115F4687BD29803A206B73A36E6026DFCA" \
1313
HOME=/var/lib/rabbitmq \
1414
RABBITMQ_HOME=/opt/rabbitmq \
1515
RABBITMQ_LOGS=- \
16-
RABBITMQ_SASL_LOGS=-
16+
RABBITMQ_SASL_LOGS=- \
17+
LANG=en_US.UTF-8 \
18+
LANGUAGE=en_US.:en \
19+
LC_ALL=en_US.UTF-8
1720

1821
RUN set -xe && \
1922
curl -LO https://github.com/rabbitmq/erlang-rpm/releases/download/v${ERLANG_VERSION}/erlang-${ERLANG_VERSION}-1.el7.x86_64.rpm && \
@@ -43,7 +46,10 @@ RUN set -xe && \
4346
chown -R 1001:0 /var/lib/rabbitmq /etc/rabbitmq ${RABBITMQ_HOME}/plugins && \
4447
chmod -R g=u /var/lib/rabbitmq /etc/rabbitmq && \
4548
rm -rf /var/lib/rabbitmq/.erlang.cookie && \
46-
ln -sf "$RABBITMQ_HOME/plugins" /plugins
49+
ln -sf "$RABBITMQ_HOME/plugins" /plugins && \
50+
INSTALL_PKGS="hostname" && \
51+
yum install -y $INSTALL_PKGS && \
52+
rm -rf /var/cache/yum
4753

4854
COPY docker-entrypoint.sh /usr/local/bin/
4955
USER 1001

0 commit comments

Comments
 (0)