Skip to content

Commit ed7c222

Browse files
authored
Check for mounted config file to copy (#1)
1 parent 4ce15fa commit ed7c222

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

3.7-rc/alpine/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ oldConfigFile="$configBase.config"
202202
newConfigFile="$configBase.conf"
203203

204204
shouldWriteConfig="$haveConfig"
205-
if [ -n "$shouldWriteConfig" ] && [ -f "$newConfigFile" ] && [ ! -w "$newConfigFile" ]; then
205+
if [ -n "$shouldWriteConfig" ] && [ -f "$newConfigFile" ] && { [ ! -w "$newConfigFile" ] || [ "$(grep -sq "$newConfigFile" /proc/mounts; echo $?)" -eq 0 ]; }; then
206206
# config file exist but it isn't writeable (e.g. Kubernetes v1.9.4+ configMap mount)
207207
tmp="/tmp/rabbitmq.conf"
208208
cat "$newConfigFile" > "${tmp}"

3.7-rc/ubuntu/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ oldConfigFile="$configBase.config"
202202
newConfigFile="$configBase.conf"
203203

204204
shouldWriteConfig="$haveConfig"
205-
if [ -n "$shouldWriteConfig" ] && [ -f "$newConfigFile" ] && [ ! -w "$newConfigFile" ]; then
205+
if [ -n "$shouldWriteConfig" ] && [ -f "$newConfigFile" ] && { [ ! -w "$newConfigFile" ] || [ "$(grep -sq "$newConfigFile" /proc/mounts; echo $?)" -eq 0 ]; }; then
206206
# config file exist but it isn't writeable (e.g. Kubernetes v1.9.4+ configMap mount)
207207
tmp="/tmp/rabbitmq.conf"
208208
cat "$newConfigFile" > "${tmp}"

3.7/alpine/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ oldConfigFile="$configBase.config"
202202
newConfigFile="$configBase.conf"
203203

204204
shouldWriteConfig="$haveConfig"
205-
if [ -n "$shouldWriteConfig" ] && [ -f "$newConfigFile" ] && [ ! -w "$newConfigFile" ]; then
205+
if [ -n "$shouldWriteConfig" ] && [ -f "$newConfigFile" ] && { [ ! -w "$newConfigFile" ] || [ "$(grep -sq "$newConfigFile" /proc/mounts; echo $?)" -eq 0 ]; }; then
206206
# config file exist but it isn't writeable (e.g. Kubernetes v1.9.4+ configMap mount)
207207
tmp="/tmp/rabbitmq.conf"
208208
cat "$newConfigFile" > "${tmp}"

3.7/ubuntu/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ oldConfigFile="$configBase.config"
202202
newConfigFile="$configBase.conf"
203203

204204
shouldWriteConfig="$haveConfig"
205-
if [ -n "$shouldWriteConfig" ] && [ -f "$newConfigFile" ] && [ ! -w "$newConfigFile" ]; then
205+
if [ -n "$shouldWriteConfig" ] && [ -f "$newConfigFile" ] && { [ ! -w "$newConfigFile" ] || [ "$(grep -sq "$newConfigFile" /proc/mounts; echo $?)" -eq 0 ]; }; then
206206
# config file exist but it isn't writeable (e.g. Kubernetes v1.9.4+ configMap mount)
207207
tmp="/tmp/rabbitmq.conf"
208208
cat "$newConfigFile" > "${tmp}"

3.8-rc/alpine/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ oldConfigFile="$configBase.config"
202202
newConfigFile="$configBase.conf"
203203

204204
shouldWriteConfig="$haveConfig"
205-
if [ -n "$shouldWriteConfig" ] && [ -f "$newConfigFile" ] && [ ! -w "$newConfigFile" ]; then
205+
if [ -n "$shouldWriteConfig" ] && [ -f "$newConfigFile" ] && { [ ! -w "$newConfigFile" ] || [ "$(grep -sq "$newConfigFile" /proc/mounts; echo $?)" -eq 0 ]; }; then
206206
# config file exist but it isn't writeable (e.g. Kubernetes v1.9.4+ configMap mount)
207207
tmp="/tmp/rabbitmq.conf"
208208
cat "$newConfigFile" > "${tmp}"

3.8-rc/ubuntu/docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ oldConfigFile="$configBase.config"
202202
newConfigFile="$configBase.conf"
203203

204204
shouldWriteConfig="$haveConfig"
205-
if [ -n "$shouldWriteConfig" ] && [ -f "$newConfigFile" ] && [ ! -w "$newConfigFile" ]; then
205+
if [ -n "$shouldWriteConfig" ] && [ -f "$newConfigFile" ] && { [ ! -w "$newConfigFile" ] || [ "$(grep -sq "$newConfigFile" /proc/mounts; echo $?)" -eq 0 ]; }; then
206206
# config file exist but it isn't writeable (e.g. Kubernetes v1.9.4+ configMap mount)
207207
tmp="/tmp/rabbitmq.conf"
208208
cat "$newConfigFile" > "${tmp}"

docker-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ oldConfigFile="$configBase.config"
202202
newConfigFile="$configBase.conf"
203203

204204
shouldWriteConfig="$haveConfig"
205-
if [ -n "$shouldWriteConfig" ] && [ -f "$newConfigFile" ] && [ ! -w "$newConfigFile" ]; then
205+
if [ -n "$shouldWriteConfig" ] && [ -f "$newConfigFile" ] && { [ ! -w "$newConfigFile" ] || [ "$(grep -sq "$newConfigFile" /proc/mounts; echo $?)" -eq 0 ]; }; then
206206
# config file exist but it isn't writeable (e.g. Kubernetes v1.9.4+ configMap mount)
207207
tmp="/tmp/rabbitmq.conf"
208208
cat "$newConfigFile" > "${tmp}"

0 commit comments

Comments
 (0)