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/01/30 13:30:01 UTC

[GitHub] [apisix] spacewander opened a new pull request #6241: refactor: mv the var mqtt_client_id to plugin level

spacewander opened a new pull request #6241:
URL: https://github.com/apache/apisix/pull/6241


   ### What this PR does / why we need it:
   <!--- Why is this change required? What problem does it solve? -->
   <!--- If it fixes an open issue, please link to the issue here. -->
   
   ### Pre-submission checklist:
   
   <!--
   Please follow the PR manners:
   1. Use Draft if the PR is not ready to be reviewed
   2. Test is required for the feat/fix PR, unless you have a good reason
   3. Doc is required for the feat PR
   4. Use a new commit to resolve review instead of `push -f`
   5. If you need to resolve merge conflicts after the PR is reviewed, please merge master but do not rebase
   6. Use "request review" to notify the reviewer once you have resolved the review
   7. Only reviewer can click "Resolve conversation" to mark the reviewer's review resolved
   -->
   
   * [x] Did you explain what problem does this PR solve? Or what new features have been added?
   * [ ] Have you added corresponding test cases?
   * [x] Have you modified the corresponding document?
   * [x] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix/tree/master#community) first**
   


-- 
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 change in pull request #6241: refactor: mv the var mqtt_client_id to plugin level

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #6241:
URL: https://github.com/apache/apisix/pull/6241#discussion_r798220261



##########
File path: apisix/core/ctx.lua
##########
@@ -254,10 +253,6 @@ function _M.register_var(name, getter)
         error("the getter of registered var should be a function")
     end
 
-    if apisix_var_names[name] then
-        error(name .. " is registered")
-    end
-

Review comment:
       It doesn't work when we need to reload the plugin. The same var will be registered twice in the different version of the same plugin.




-- 
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] bisakhmondal commented on a change in pull request #6241: refactor: mv the var mqtt_client_id to plugin level

Posted by GitBox <gi...@apache.org>.
bisakhmondal commented on a change in pull request #6241:
URL: https://github.com/apache/apisix/pull/6241#discussion_r797825041



##########
File path: apisix/core/ctx.lua
##########
@@ -254,10 +253,6 @@ function _M.register_var(name, getter)
         error("the getter of registered var should be a function")
     end
 
-    if apisix_var_names[name] then
-        error(name .. " is registered")
-    end
-

Review comment:
       I think we can keep it. This can act as a protection to prevent overriding defaults / name conflict. WDYT?




-- 
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 #6241: refactor: mv the var mqtt_client_id to plugin level

Posted by GitBox <gi...@apache.org>.
spacewander merged pull request #6241:
URL: https://github.com/apache/apisix/pull/6241


   


-- 
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] bisakhmondal commented on a change in pull request #6241: refactor: mv the var mqtt_client_id to plugin level

Posted by GitBox <gi...@apache.org>.
bisakhmondal commented on a change in pull request #6241:
URL: https://github.com/apache/apisix/pull/6241#discussion_r798230884



##########
File path: apisix/core/ctx.lua
##########
@@ -254,10 +253,6 @@ function _M.register_var(name, getter)
         error("the getter of registered var should be a function")
     end
 
-    if apisix_var_names[name] then
-        error(name .. " is registered")
-    end
-

Review comment:
       Oh, I see. Then it's fine to remove it. Thanks




-- 
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] bisakhmondal commented on a change in pull request #6241: refactor: mv the var mqtt_client_id to plugin level

Posted by GitBox <gi...@apache.org>.
bisakhmondal commented on a change in pull request #6241:
URL: https://github.com/apache/apisix/pull/6241#discussion_r797825041



##########
File path: apisix/core/ctx.lua
##########
@@ -254,10 +253,6 @@ function _M.register_var(name, getter)
         error("the getter of registered var should be a function")
     end
 
-    if apisix_var_names[name] then
-        error(name .. " is registered")
-    end
-

Review comment:
       I think we can keep it. This can act as a protection to prevent overriding defaults / name conflict.




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