You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/04/27 01:05:52 UTC

[GitHub] [apisix] spacewander opened a new issue, #6939: feat: As a user, I want to check the subordinate relationship in the Admin API

spacewander opened a new issue, #6939:
URL: https://github.com/apache/apisix/issues/6939

   ### Description
   
   See https://github.com/apache/apisix/blob/dbe7eeebba06229d4a8df75263f2a78301cc1ca0/apisix/stream/router/ip_port.lua#L82
   
   We need to check the subordinate relationship in the Admin API, including:
   1. validate if the stream route with superior id exists and its protocol matches the subordinate
   2. when deleting a stream route, check if it is referenced by another stream route


-- 
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.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] ro4i7 commented on issue #6939: feat: As a user, I want to check the subordinate relationship in the Admin API

Posted by "ro4i7 (via GitHub)" <gi...@apache.org>.
ro4i7 commented on issue #6939:
URL: https://github.com/apache/apisix/issues/6939#issuecomment-1476078673

   > You could submit a PR with test added to it.
   
   @spacewander @starsz @navendu-pottekkat Please check #9116 


-- 
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 issue #6939: feat: As a user, I want to check the subordinate relationship in the Admin API

Posted by "spacewander (via GitHub)" <gi...@apache.org>.
spacewander commented on issue #6939:
URL: https://github.com/apache/apisix/issues/6939#issuecomment-1465457482

   You could submit a PR with test added to 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


[GitHub] [apisix] ro4i7 commented on issue #6939: feat: As a user, I want to check the subordinate relationship in the Admin API

Posted by "ro4i7 (via GitHub)" <gi...@apache.org>.
ro4i7 commented on issue #6939:
URL: https://github.com/apache/apisix/issues/6939#issuecomment-1465208840

   Hello @spacewander @lijing-21 
   
   May be replacing code from line 79 to line number 84 in [apisix/apisix/stream/router/ip_port.lua](https://github.com/apache/apisix/blob/dbe7eeebba06229d4a8df75263f2a78301cc1ca0/apisix/stream/router/ip_port.lua#L82) with below code may solve this issue: 
   ```
   local route = item.value
   if route.protocol and route.protocol.superior_id then
       local admin_api = require("apisix.admin").check_http_admin()
       if not admin_api then
           ngx.log(ngx.ERR, "failed to get http admin node")
           goto CONTINUE
       end
   
       local route_id = route.id
       local superior_id = route.protocol.superior_id
   
       local res, err = admin_api:get("/stream/routes/" .. superior_id)
       if not res then
           ngx.log(ngx.ERR, "failed to fetch superior stream route: ", err)
           goto CONTINUE
       end
   
       if res.body.data and res.body.data.protocol == route.protocol then
           ngx.log(ngx.INFO, "matched stream route with superior id: ", superior_id)
       else
           ngx.log(ngx.ERR, "failed to match stream route with superior id: ", superior_id)
           goto CONTINUE
       end
   
       -- TODO: when deleting a stream route, check if it is referenced by another stream route
   
   end
   ```
   please, give me feedback on this.


-- 
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