Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use sed replace yq #508

Merged
merged 4 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions centos/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,8 @@ deployment:
config_provider: yaml
_EOC_
else
wget -qO /usr/local/apisix/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 \
&& chmod a+x /usr/local/apisix/yq
/usr/local/apisix/yq -i '.deployment.role = "data_plane"' ${PREFIX}/conf/config.yaml
/usr/local/apisix/yq -i '.deployment.role_data_plane.config_provider = "yaml"' ${PREFIX}/conf/config.yaml
rm /usr/local/apisix/yq
sed -i 's/role: traditional/role: data_plane/' config.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think we need to match only when role: traditional and config_provider is etcd.
It should be replaced in any case which is role: * and config_provider: *

Copy link
Contributor Author

@kamly kamly Sep 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for replying to you so late.

I think there may be other role configurations in config , such as:

test:
   role: xxx

sed -i 's/config_provider: etcd/config_provider: yaml/' config.yaml
fi

if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then
Expand Down
7 changes: 2 additions & 5 deletions debian-dev/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,8 @@ deployment:
config_provider: yaml
_EOC_
else
wget -qO /usr/local/apisix/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 \
&& chmod a+x /usr/local/apisix/yq
/usr/local/apisix/yq -i '.deployment.role = "data_plane"' ${PREFIX}/conf/config.yaml
/usr/local/apisix/yq -i '.deployment.role_data_plane.config_provider = "yaml"' ${PREFIX}/conf/config.yaml
rm /usr/local/apisix/yq
sed -i 's/role: traditional/role: data_plane/' config.yaml
sed -i 's/config_provider: etcd/config_provider: yaml/' config.yaml
fi

if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then
Expand Down
7 changes: 2 additions & 5 deletions debian/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,8 @@ deployment:
config_provider: yaml
_EOC_
else
wget -qO /usr/local/apisix/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 \
&& chmod a+x /usr/local/apisix/yq
/usr/local/apisix/yq -i '.deployment.role = "data_plane"' ${PREFIX}/conf/config.yaml
/usr/local/apisix/yq -i '.deployment.role_data_plane.config_provider = "yaml"' ${PREFIX}/conf/config.yaml
rm /usr/local/apisix/yq
sed -i 's/role: traditional/role: data_plane/' config.yaml
sed -i 's/config_provider: etcd/config_provider: yaml/' config.yaml
fi

if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then
Expand Down
7 changes: 2 additions & 5 deletions redhat/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,8 @@ deployment:
config_provider: yaml
_EOC_
else
wget -qO /usr/local/apisix/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 \
&& chmod a+x /usr/local/apisix/yq
/usr/local/apisix/yq -i '.deployment.role = "data_plane"' ${PREFIX}/conf/config.yaml
/usr/local/apisix/yq -i '.deployment.role_data_plane.config_provider = "yaml"' ${PREFIX}/conf/config.yaml
rm /usr/local/apisix/yq
sed -i 's/role: traditional/role: data_plane/' config.yaml
sed -i 's/config_provider: etcd/config_provider: yaml/' config.yaml
fi

if [ ! -f "${PREFIX}/conf/apisix.yaml" ]; then
Expand Down
Loading