This is an automated email from the ASF dual-hosted git repository.

spacewander pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new 00e9a56f7 fix: add admin schema to control_plane config (#8809)
00e9a56f7 is described below

commit 00e9a56f739e6a56b8d90fd821e2233003c69544
Author: Tristan <[email protected]>
AuthorDate: Wed Feb 15 09:46:40 2023 +0800

    fix: add admin schema to control_plane config (#8809)
---
 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 5f1f789ad..477e2ce7e 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 fa7210378..58858f41f 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:

Reply via email to