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/02/09 01:07:49 UTC

[GitHub] [apisix] zhixiongdu027 commented on a change in pull request #4880: feat: add kubernetes discovery module

zhixiongdu027 commented on a change in pull request #4880:
URL: https://github.com/apache/apisix/pull/4880#discussion_r802187707



##########
File path: apisix/discovery/kubernetes/informer_factory.lua
##########
@@ -152,48 +152,47 @@ local function split_event (body, dispatch_event)
         remainder_body = string.sub(body, captured_size + 1)
     end
 
-    return remainder_body, "Success", nil
+    return remainder_body, "Success"

Review comment:
       ```lua   
            remainder_body, reason, err = split_event(body, dispatch_event, informer)
               if reason ~= "Success" then
                   if reason == "ResourceGone" then
                       return true
                   end
                   return false, reason, err
               end
   ```
   
   "Success" makes sense here because the code above will use it.
   If there is no "Success", 
   how can only use remain_body is nil as a detection method, 
   I think this is not a good code style
   




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