You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "ro4i7 (via GitHub)" <gi...@apache.org> on 2023/03/20 11:43:49 UTC

[GitHub] [apisix] ro4i7 opened a new pull request, #9116: feat: Add feature to check for stream route references when deleting and implement protocol matching

ro4i7 opened a new pull request, #9116:
URL: https://github.com/apache/apisix/pull/9116

   ### Description
   
   Implemented a feature to check if a stream route is referenced by another stream route when deleting. Also, add a check to match the current stream route's protocol with the superior stream route's protocol. Log an info message if matched; otherwise, log an error message. Log an error message if there's an error while fetching the superior stream route.
   
   <!-- Please include a summary of the change and which issue is fixed. -->
   <!-- Please also include relevant motivation and context. -->
   
   Fixes # (issue)
   
   ### Checklist
   
   - [ ] 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] ro4i7 commented on a diff in pull request #9116: feat: Add feature to check for stream route references when deleting and implement protocol matching

Posted by "ro4i7 (via GitHub)" <gi...@apache.org>.
ro4i7 commented on code in PR #9116:
URL: https://github.com/apache/apisix/pull/9116#discussion_r1148373644


##########
apisix/stream/router/ip_port.lua:
##########
@@ -78,9 +78,30 @@ do
 
             local route = item.value
             if route.protocol and route.protocol.superior_id then
-                -- subordinate route won't be matched in the entry
-                -- TODO: check the subordinate relationship in the Admin API
-                goto CONTINUE
+                local admin_api = require("apisix.admin").check_http_admin()
+                if not admin_api then
+                    ngx.log(ngx.ERR, "failed to get http admin node")

Review Comment:
   > Can we use "core.log" instead?
   
   @starsz Sorry, I have been out of the station, so replying late. Yeah definitely, I have updated it according to it, please check.



-- 
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] starsz commented on a diff in pull request #9116: feat: Add feature to check for stream route references when deleting and implement protocol matching

Posted by "starsz (via GitHub)" <gi...@apache.org>.
starsz commented on code in PR #9116:
URL: https://github.com/apache/apisix/pull/9116#discussion_r1142948519


##########
apisix/stream/router/ip_port.lua:
##########
@@ -78,9 +78,30 @@ do
 
             local route = item.value
             if route.protocol and route.protocol.superior_id then
-                -- subordinate route won't be matched in the entry
-                -- TODO: check the subordinate relationship in the Admin API
-                goto CONTINUE
+                local admin_api = require("apisix.admin").check_http_admin()
+                if not admin_api then
+                    ngx.log(ngx.ERR, "failed to get http admin node")

Review Comment:
   Can we use "core.log" instead?



-- 
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] monkeyDluffy6017 closed pull request #9116: feat: Add feature to check for stream route references when deleting and implement protocol matching

Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 closed pull request #9116: feat: Add feature to check for stream route references when deleting and implement protocol matching
URL: https://github.com/apache/apisix/pull/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] monkeyDluffy6017 commented on pull request #9116: feat: Add feature to check for stream route references when deleting and implement protocol matching

Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 commented on PR #9116:
URL: https://github.com/apache/apisix/pull/9116#issuecomment-1488214147

   I will close this PR, the functions involved in this PR don't even exist


-- 
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] monkeyDluffy6017 commented on pull request #9116: feat: Add feature to check for stream route references when deleting and implement protocol matching

Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 commented on PR #9116:
URL: https://github.com/apache/apisix/pull/9116#issuecomment-1477150401

   hi @ro4i7, please make the ci pass


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