You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "jiangfucheng (via GitHub)" <gi...@apache.org> on 2023/02/07 13:45:53 UTC
[GitHub] [apisix] jiangfucheng opened a new pull request, #8809: fix: add admin schema to control_plane config
jiangfucheng opened a new pull request, #8809:
URL: https://github.com/apache/apisix/pull/8809
### Description
<!-- Please include a summary of the change and which issue is fixed. -->
<!-- Please also include relevant motivation and context. -->
Fixes https://github.com/apache/apisix/issues/8804
Maybe just add the schema of admin to conrol_plane config definition is enough?
### Checklist
- [x] I have explained the need for this PR and the problem it solves
- [ ] I have explained the changes or the new features added to this PR
- [ ] I have added tests corresponding to this change
- [ ] I have updated the documentation to reflect this change
- [ ] I have verified that this change is backward compatible (If not, please discuss on the [APISIX mailing list](https://github.com/apache/apisix/tree/master#community) first)
<!--
Note
1. Mark the PR as draft until it's ready to be reviewed.
2. Always add/update tests for any changes unless you have a good reason.
3. Always update the documentation to reflect the changes made in the PR.
4. Make a new commit to resolve conversations instead of `push -f`.
5. To resolve merge conflicts, merge master instead of rebasing.
6. Use "request review" to notify the reviewer after making changes.
7. Only a reviewer can mark a conversation as resolved.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] spacewander commented on a diff in pull request #8809: fix: add admin schema to control_plane config
Posted by "spacewander (via GitHub)" <gi...@apache.org>.
spacewander commented on code in PR #8809:
URL: https://github.com/apache/apisix/pull/8809#discussion_r1105215829
##########
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"
Review Comment:
```suggestion
https_admin: "abc"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] spacewander merged pull request #8809: fix: add admin schema to control_plane config
Posted by "spacewander (via GitHub)" <gi...@apache.org>.
spacewander merged PR #8809:
URL: https://github.com/apache/apisix/pull/8809
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] jiangfucheng commented on a diff in pull request #8809: fix: add admin schema to control_plane config
Posted by "jiangfucheng (via GitHub)" <gi...@apache.org>.
jiangfucheng commented on code in PR #8809:
URL: https://github.com/apache/apisix/pull/8809#discussion_r1104517183
##########
t/cli/test_deployment_control_plane.sh:
##########
@@ -40,6 +40,37 @@ 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:
+ admin_listen:
+ port: "abcd"
+ 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 'expect: number, but got: string'; then
Review Comment:
I changed a special field, it can be merged, but can't pass config validation, although this way is not perfect。🤣
##########
apisix/cli/schema.lua:
##########
@@ -409,7 +410,7 @@ local deployment_schema = {
default = {},
},
},
- required = {"etcd", "role_control_plane"}
+ required = {"etcd", "admin", "role_control_plane"}
Review Comment:
Removed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] spacewander commented on a diff in pull request #8809: fix: add admin schema to control_plane config
Posted by "spacewander (via GitHub)" <gi...@apache.org>.
spacewander commented on code in PR #8809:
URL: https://github.com/apache/apisix/pull/8809#discussion_r1103938239
##########
t/cli/test_deployment_control_plane.sh:
##########
@@ -40,6 +40,37 @@ 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:
+ admin_listen:
+ port: "abcd"
+ 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 'expect: number, but got: string'; then
Review Comment:
The err is from there: https://github.com/apache/apisix/blob/0bc65ea9acd726f79f80ae0abd8f50b7eb172e3d/apisix/cli/file.lua#L180
It is detected before the schema check.
We should find another way to validate the schema check.
##########
apisix/cli/schema.lua:
##########
@@ -409,7 +410,7 @@ local deployment_schema = {
default = {},
},
},
- required = {"etcd", "role_control_plane"}
+ required = {"etcd", "admin", "role_control_plane"}
Review Comment:
The admin is not required as we always have a default value.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] jiangfucheng commented on a diff in pull request #8809: fix: add admin schema to control_plane config
Posted by "jiangfucheng (via GitHub)" <gi...@apache.org>.
jiangfucheng commented on code in PR #8809:
URL: https://github.com/apache/apisix/pull/8809#discussion_r1105218458
##########
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"
Review Comment:
Fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] jiangfucheng commented on pull request #8809: fix: add admin schema to control_plane config
Posted by "jiangfucheng (via GitHub)" <gi...@apache.org>.
jiangfucheng commented on PR #8809:
URL: https://github.com/apache/apisix/pull/8809#issuecomment-1422708019
> Can you add a test to validate the admin schema in https://github.com/apache/apisix/blob/master/t/cli/test_deployment_control_plane.sh? So we won't miss schema next time.
I added test case for this pr. I wanted to through `schema.validate()` method to validate whether config is right, but admin field already in default-config.yaml, `schema.validate()` can't return any error, so i deleted admin field in config-default.yaml.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] shreemaan-abhishek commented on pull request #8809: fix: add admin schema to control_plane config
Posted by "shreemaan-abhishek (via GitHub)" <gi...@apache.org>.
shreemaan-abhishek commented on PR #8809:
URL: https://github.com/apache/apisix/pull/8809#issuecomment-1427074485
@jiangfucheng You can make an empty commit and push it to re-run the CI. This might be some error that does not occur consistently.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] jiangfucheng commented on pull request #8809: fix: add admin schema to control_plane config
Posted by "jiangfucheng (via GitHub)" <gi...@apache.org>.
jiangfucheng commented on PR #8809:
URL: https://github.com/apache/apisix/pull/8809#issuecomment-1425794640
@spacewander I can't reproduce the failed CI, could you guide me how to fix it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org