Skip to content

Commit

Permalink
fix: sed not suitable for docker if config.yaml is volume mounted (#534)
Browse files Browse the repository at this point in the history
  • Loading branch information
jingzhao-self authored Jan 12, 2024
1 parent 915c187 commit a01780a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
7 changes: 4 additions & 3 deletions debian-dev/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions debian/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions redhat/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a01780a

Please sign in to comment.