You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# config file exist but it isn't writeable (e.g. Kubernetes v1.9.4+ configMap mount)
207
-
tmp="/tmp/rabbitmq.conf"
208
-
cat "$newConfigFile">"${tmp}"
209
-
newConfigFile="${tmp}"
210
-
export RABBITMQ_CONFIG_FILE="${tmp}"
205
+
if [ -n"$shouldWriteConfig" ] &&! touch "$newConfigFile";then
206
+
# config file exists but it isn't writeable (likely read-only mount, such as Kubernetes configMap)
207
+
export RABBITMQ_CONFIG_FILE='/tmp/rabbitmq.conf'
208
+
cp "$newConfigFile""$RABBITMQ_CONFIG_FILE"
209
+
echo>&2
210
+
echo>&2"WARNING: '$newConfigFile' is not writable, but environment variables have been provided which request that we write to it"
211
+
echo>&2" We have copied it to '$RABBITMQ_CONFIG_FILE' so it can be amended to work around the problem, but it is recommended that the read-only source file should be modified and the environment variables removed instead."
212
+
echo>&2
213
+
newConfigFile="$RABBITMQ_CONFIG_FILE"
211
214
fi
212
215
if [ -n"$shouldWriteConfig" ] && [ -f"$oldConfigFile" ];then
# config file exist but it isn't writeable (e.g. Kubernetes v1.9.4+ configMap mount)
207
-
tmp="/tmp/rabbitmq.conf"
208
-
cat "$newConfigFile">"${tmp}"
209
-
newConfigFile="${tmp}"
210
-
export RABBITMQ_CONFIG_FILE="${tmp}"
205
+
if [ -n"$shouldWriteConfig" ] &&! touch "$newConfigFile";then
206
+
# config file exists but it isn't writeable (likely read-only mount, such as Kubernetes configMap)
207
+
export RABBITMQ_CONFIG_FILE='/tmp/rabbitmq.conf'
208
+
cp "$newConfigFile""$RABBITMQ_CONFIG_FILE"
209
+
echo>&2
210
+
echo>&2"WARNING: '$newConfigFile' is not writable, but environment variables have been provided which request that we write to it"
211
+
echo>&2" We have copied it to '$RABBITMQ_CONFIG_FILE' so it can be amended to work around the problem, but it is recommended that the read-only source file should be modified and the environment variables removed instead."
212
+
echo>&2
213
+
newConfigFile="$RABBITMQ_CONFIG_FILE"
211
214
fi
212
215
if [ -n"$shouldWriteConfig" ] && [ -f"$oldConfigFile" ];then
# config file exist but it isn't writeable (e.g. Kubernetes v1.9.4+ configMap mount)
207
-
tmp="/tmp/rabbitmq.conf"
208
-
cat "$newConfigFile">"${tmp}"
209
-
newConfigFile="${tmp}"
210
-
export RABBITMQ_CONFIG_FILE="${tmp}"
205
+
if [ -n"$shouldWriteConfig" ] &&! touch "$newConfigFile";then
206
+
# config file exists but it isn't writeable (likely read-only mount, such as Kubernetes configMap)
207
+
export RABBITMQ_CONFIG_FILE='/tmp/rabbitmq.conf'
208
+
cp "$newConfigFile""$RABBITMQ_CONFIG_FILE"
209
+
echo>&2
210
+
echo>&2"WARNING: '$newConfigFile' is not writable, but environment variables have been provided which request that we write to it"
211
+
echo>&2" We have copied it to '$RABBITMQ_CONFIG_FILE' so it can be amended to work around the problem, but it is recommended that the read-only source file should be modified and the environment variables removed instead."
212
+
echo>&2
213
+
newConfigFile="$RABBITMQ_CONFIG_FILE"
211
214
fi
212
215
if [ -n"$shouldWriteConfig" ] && [ -f"$oldConfigFile" ];then
# config file exist but it isn't writeable (e.g. Kubernetes v1.9.4+ configMap mount)
207
-
tmp="/tmp/rabbitmq.conf"
208
-
cat "$newConfigFile">"${tmp}"
209
-
newConfigFile="${tmp}"
210
-
export RABBITMQ_CONFIG_FILE="${tmp}"
205
+
if [ -n"$shouldWriteConfig" ] &&! touch "$newConfigFile";then
206
+
# config file exists but it isn't writeable (likely read-only mount, such as Kubernetes configMap)
207
+
export RABBITMQ_CONFIG_FILE='/tmp/rabbitmq.conf'
208
+
cp "$newConfigFile""$RABBITMQ_CONFIG_FILE"
209
+
echo>&2
210
+
echo>&2"WARNING: '$newConfigFile' is not writable, but environment variables have been provided which request that we write to it"
211
+
echo>&2" We have copied it to '$RABBITMQ_CONFIG_FILE' so it can be amended to work around the problem, but it is recommended that the read-only source file should be modified and the environment variables removed instead."
212
+
echo>&2
213
+
newConfigFile="$RABBITMQ_CONFIG_FILE"
211
214
fi
212
215
if [ -n"$shouldWriteConfig" ] && [ -f"$oldConfigFile" ];then
# config file exist but it isn't writeable (e.g. Kubernetes v1.9.4+ configMap mount)
207
-
tmp="/tmp/rabbitmq.conf"
208
-
cat "$newConfigFile">"${tmp}"
209
-
newConfigFile="${tmp}"
210
-
export RABBITMQ_CONFIG_FILE="${tmp}"
205
+
if [ -n"$shouldWriteConfig" ] &&! touch "$newConfigFile";then
206
+
# config file exists but it isn't writeable (likely read-only mount, such as Kubernetes configMap)
207
+
export RABBITMQ_CONFIG_FILE='/tmp/rabbitmq.conf'
208
+
cp "$newConfigFile""$RABBITMQ_CONFIG_FILE"
209
+
echo>&2
210
+
echo>&2"WARNING: '$newConfigFile' is not writable, but environment variables have been provided which request that we write to it"
211
+
echo>&2" We have copied it to '$RABBITMQ_CONFIG_FILE' so it can be amended to work around the problem, but it is recommended that the read-only source file should be modified and the environment variables removed instead."
212
+
echo>&2
213
+
newConfigFile="$RABBITMQ_CONFIG_FILE"
211
214
fi
212
215
if [ -n"$shouldWriteConfig" ] && [ -f"$oldConfigFile" ];then
# config file exist but it isn't writeable (e.g. Kubernetes v1.9.4+ configMap mount)
207
-
tmp="/tmp/rabbitmq.conf"
208
-
cat "$newConfigFile">"${tmp}"
209
-
newConfigFile="${tmp}"
210
-
export RABBITMQ_CONFIG_FILE="${tmp}"
205
+
if [ -n"$shouldWriteConfig" ] &&! touch "$newConfigFile";then
206
+
# config file exists but it isn't writeable (likely read-only mount, such as Kubernetes configMap)
207
+
export RABBITMQ_CONFIG_FILE='/tmp/rabbitmq.conf'
208
+
cp "$newConfigFile""$RABBITMQ_CONFIG_FILE"
209
+
echo>&2
210
+
echo>&2"WARNING: '$newConfigFile' is not writable, but environment variables have been provided which request that we write to it"
211
+
echo>&2" We have copied it to '$RABBITMQ_CONFIG_FILE' so it can be amended to work around the problem, but it is recommended that the read-only source file should be modified and the environment variables removed instead."
212
+
echo>&2
213
+
newConfigFile="$RABBITMQ_CONFIG_FILE"
211
214
fi
212
215
if [ -n"$shouldWriteConfig" ] && [ -f"$oldConfigFile" ];then
# config file exist but it isn't writeable (e.g. Kubernetes v1.9.4+ configMap mount)
207
-
tmp="/tmp/rabbitmq.conf"
208
-
cat "$newConfigFile">"${tmp}"
209
-
newConfigFile="${tmp}"
210
-
export RABBITMQ_CONFIG_FILE="${tmp}"
205
+
if [ -n"$shouldWriteConfig" ] &&! touch "$newConfigFile";then
206
+
# config file exists but it isn't writeable (likely read-only mount, such as Kubernetes configMap)
207
+
export RABBITMQ_CONFIG_FILE='/tmp/rabbitmq.conf'
208
+
cp "$newConfigFile""$RABBITMQ_CONFIG_FILE"
209
+
echo>&2
210
+
echo>&2"WARNING: '$newConfigFile' is not writable, but environment variables have been provided which request that we write to it"
211
+
echo>&2" We have copied it to '$RABBITMQ_CONFIG_FILE' so it can be amended to work around the problem, but it is recommended that the read-only source file should be modified and the environment variables removed instead."
212
+
echo>&2
213
+
newConfigFile="$RABBITMQ_CONFIG_FILE"
211
214
fi
212
215
if [ -n"$shouldWriteConfig" ] && [ -f"$oldConfigFile" ];then
0 commit comments