From a01780aa972706dfb3c56e1142c08cbcca1662b2 Mon Sep 17 00:00:00 2001 From: inceptio-jingzhao <60691314+jingzhao-self@users.noreply.github.com> Date: Fri, 12 Jan 2024 11:37:11 +0800 Subject: [PATCH] fix: sed not suitable for docker if config.yaml is volume mounted (#534) --- debian-dev/docker-entrypoint.sh | 7 ++++--- debian/docker-entrypoint.sh | 6 +++--- redhat/docker-entrypoint.sh | 6 +++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/debian-dev/docker-entrypoint.sh b/debian-dev/docker-entrypoint.sh index 1fe8c44c..f718502a 100755 --- a/debian-dev/docker-entrypoint.sh +++ b/debian-dev/docker-entrypoint.sh @@ -32,9 +32,10 @@ deployment: _EOC_ else # updating config.yaml for standalone mode - sed -i 's/role: traditional/role: data_plane/' ${PREFIX}/conf/config.yaml - sed -i 's/role_traditional:/role_data_plane:/' ${PREFIX}/conf/config.yaml - sed -i 's/config_provider: etcd/config_provider: yaml/' ${PREFIX}/conf/config.yaml + echo "$(sed 's/role: traditional/role: data_plane/g' ${PREFIX}/conf/config.yaml)" > ${PREFIX}/conf/config.yaml + echo "$(sed 's/role_traditional:/role_data_plane:/g' ${PREFIX}/conf/config.yaml)" > ${PREFIX}/conf/config.yaml + echo "$(sed 's/config_provider: etcd/config_provider: yaml/g' ${PREFIX}/conf/config.yaml)" > ${PREFIX}/conf/config.yaml + fi if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then diff --git a/debian/docker-entrypoint.sh b/debian/docker-entrypoint.sh index a8a34a9e..04fe00b5 100755 --- a/debian/docker-entrypoint.sh +++ b/debian/docker-entrypoint.sh @@ -32,9 +32,9 @@ deployment: _EOC_ else # updating config.yaml for standalone mode - sed -i 's/role: traditional/role: data_plane/' ${PREFIX}/conf/config.yaml - sed -i 's/role_traditional:/role_data_plane:/' ${PREFIX}/conf/config.yaml - sed -i 's/config_provider: etcd/config_provider: yaml/' ${PREFIX}/conf/config.yaml + echo "$(sed 's/role: traditional/role: data_plane/g' ${PREFIX}/conf/config.yaml)" > ${PREFIX}/conf/config.yaml + echo "$(sed 's/role_traditional:/role_data_plane:/g' ${PREFIX}/conf/config.yaml)" > ${PREFIX}/conf/config.yaml + echo "$(sed 's/config_provider: etcd/config_provider: yaml/g' ${PREFIX}/conf/config.yaml)" > ${PREFIX}/conf/config.yaml fi if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then diff --git a/redhat/docker-entrypoint.sh b/redhat/docker-entrypoint.sh index a8a34a9e..04fe00b5 100755 --- a/redhat/docker-entrypoint.sh +++ b/redhat/docker-entrypoint.sh @@ -32,9 +32,9 @@ deployment: _EOC_ else # updating config.yaml for standalone mode - sed -i 's/role: traditional/role: data_plane/' ${PREFIX}/conf/config.yaml - sed -i 's/role_traditional:/role_data_plane:/' ${PREFIX}/conf/config.yaml - sed -i 's/config_provider: etcd/config_provider: yaml/' ${PREFIX}/conf/config.yaml + echo "$(sed 's/role: traditional/role: data_plane/g' ${PREFIX}/conf/config.yaml)" > ${PREFIX}/conf/config.yaml + echo "$(sed 's/role_traditional:/role_data_plane:/g' ${PREFIX}/conf/config.yaml)" > ${PREFIX}/conf/config.yaml + echo "$(sed 's/config_provider: etcd/config_provider: yaml/g' ${PREFIX}/conf/config.yaml)" > ${PREFIX}/conf/config.yaml fi if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then