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: add admin schema to control_plane config #8809

Merged
merged 2 commits into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions apisix/cli/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ local deployment_schema = {
control_plane = {
properties = {
etcd = etcd_schema,
admin = admin_schema,
role_control_plane = {
properties = {
config_provider = {
Expand Down
30 changes: 30 additions & 0 deletions t/cli/test_deployment_control_plane.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,36 @@ fi

echo "passed: should check deployment schema during init"

# The 'admin.apisix.dev' is injected by ci/common.sh@set_coredns
echo '
apisix:
enable_admin: false
deployment:
role: control_plane
role_control_plane:
config_provider: etcd
conf_server:
listen: admin.apisix.dev:12345
cert: t/certs/mtls_server.crt
cert_key: t/certs/mtls_server.key
admin:
https_admin: "abc"
etcd:
prefix: "/apisix"
host:
- http://127.0.0.1:2379
certs:
trusted_ca_cert: t/certs/mtls_ca.crt
' > conf/config.yaml

out=$(make init 2>&1 || true)
if ! echo "$out" | grep 'property "https_admin" validation failed: wrong type: expected boolean, got string'; then
echo "failed: should check deployment schema during init"
exit 1
fi

echo "passed: should check deployment schema during init"

# The 'admin.apisix.dev' is injected by ci/common.sh@set_coredns
echo '
apisix:
Expand Down