-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
bug: there is a bug in the schema check of nodes when admin-api saves the upstream configuration. #10455
Comments
Could you please paste the configuration here? |
{
"nodes": [
{
"host": "ops-kuber.newlink.com",
"weight": 1
}
],
"retries": 0,
"timeout": {
"connect": 6,
"send": 6,
"read": 6
},
"type": "roundrobin",
"scheme": "https",
"pass_host": "node",
"name": "认证服务",
"desc": "认证服务",
"keepalive_pool": {
"idle_timeout": 60,
"requests": 1000,
"size": 320
}
} This is a legitimate upstream,but it can not be saved both in apisix-dashboard or admin-api. |
this isn't valid as |
https://apisix.apache.org/zh/docs/apisix/admin-api/#upstream And when I set nodes as hashmap, like this: {
"nodes": {
"ops-kuber.newlink.com": 1
},
"retries": 0,
"timeout": {
"connect": 6,
"send": 6,
"read": 6
},
"type": "roundrobin",
"scheme": "https",
"pass_host": "node",
"name": "认证服务",
"desc": "认证服务",
"keepalive_pool": {
"idle_timeout": 60,
"requests": 1000,
"size": 320
}
} It becomes valid. |
even the code says port is required: Line 328 in 266ace7
Would you like to raise a PR to update the document? |
I think "port is optional" is reasonable. Because when my node is a domain name, I don’t need to provide a port. |
considered resolved |
Current Behavior
nodes_schema中的port不是必须的呀,辛苦修复一下,会导致通过admin api put上游时,如果node是array形式,无法通过校验!
Expected Behavior
No response
Error Logs
No response
Steps to Reproduce
Environment
apisix version
):3.4.1uname -a
):23.0.0 Darwin Kernel Version 23.0.0: Fri Sep 15 14:43:05 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T6020 arm64openresty -V
ornginx -V
):curl http://127.0.0.1:9090/v1/server_info
): 3.5.0luarocks --version
):The text was updated successfully, but these errors were encountered: