membphis commented on issue #2924: URL: https://github.com/apache/apisix/issues/2924#issuecomment-739118609
> I would prefer hacking this issue on the manager api side, for it's the bridge between fe and data store. I don't like this method, which means that the data saved in etcd is not the same as the data requested by the Admin user. Here is an example: ``` # request with `remote_addrs` curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d ' { "uri": "/hello", "remote_addrs": [] "upstream": { "type": "roundrobin", "nodes": { "127.0.0.1:8080": 1 } } }' # when we fetch route, there is no `remote_addrs` curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' { "uri": "/hello", "upstream": { "type": "roundrobin", "nodes": { "127.0.0.1:8080": 1 } } }' ``` And if we change to this way, the Admin API needs to process it in the same way too. We need to keep this hack way both in `Admin API` and `Manager API`. As we talked about before, if Admin API rejects empty array `"remote_addrs": []`, then the Manager API should reject empty array too. Keep the same is important. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
