From 05a480eed4a83ea54acc3ec1295e1e8c8c56f901 Mon Sep 17 00:00:00 2001 From: jiangfucheng Date: Mon, 2 Jan 2023 03:58:21 -0500 Subject: [PATCH 1/2] fix: add admin schema in control_plane config --- apisix/cli/schema.lua | 1 + t/cli/test_deployment_control_plane.sh | 30 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/apisix/cli/schema.lua b/apisix/cli/schema.lua index 5f1f789addda..477e2ce7e56d 100644 --- a/apisix/cli/schema.lua +++ b/apisix/cli/schema.lua @@ -375,6 +375,7 @@ local deployment_schema = { control_plane = { properties = { etcd = etcd_schema, + admin = admin_schema, role_control_plane = { properties = { config_provider = { diff --git a/t/cli/test_deployment_control_plane.sh b/t/cli/test_deployment_control_plane.sh index fa7210378da4..8d7df544d4e4 100755 --- a/t/cli/test_deployment_control_plane.sh +++ b/t/cli/test_deployment_control_plane.sh @@ -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: From 4ff5c298e49586510eebe669c0100a83a2646b83 Mon Sep 17 00:00:00 2001 From: Tristan <33349046+jiangfucheng@users.noreply.github.com> Date: Tue, 14 Feb 2023 10:13:08 +0800 Subject: [PATCH 2/2] fix code style --- t/cli/test_deployment_control_plane.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/cli/test_deployment_control_plane.sh b/t/cli/test_deployment_control_plane.sh index 8d7df544d4e4..58858f41fd1c 100755 --- a/t/cli/test_deployment_control_plane.sh +++ b/t/cli/test_deployment_control_plane.sh @@ -53,7 +53,7 @@ deployment: cert: t/certs/mtls_server.crt cert_key: t/certs/mtls_server.key admin: - https_admin: "abc" + https_admin: "abc" etcd: prefix: "/apisix" host: