AlinsRan commented on code in PR #13607:
URL: https://github.com/apache/apisix/pull/13607#discussion_r3583319346


##########
apisix/plugins/error-log-logger.lua:
##########
@@ -185,6 +195,7 @@ local _M = {
 
 function _M.check_schema(conf, schema_type)
     if schema_type == core.schema.TYPE_METADATA then
+        core.utils.check_tls_bool({"kafka.tls.verify"}, conf, plugin_name)

Review Comment:
   This runs before `core.schema.check` fills schema defaults, so the warning 
misses the case it most needs to catch: when a user sets `"tls": {}` (TLS on, 
no cert verification), `conf.kafka.tls.verify` is still `nil` here, 
`check_tls_bool` skips it, and no warning is emitted. It also diverges from 
kafka-logger.lua, where the call runs after the schema check.
   
   Move it after the check:
   
   ```lua
   if schema_type == core.schema.TYPE_METADATA then
       local ok, err = core.schema.check(metadata_schema, conf)
       if not ok then
           return nil, err
       end
       core.utils.check_tls_bool({"kafka.tls.verify"}, conf, plugin_name)
       return true
   end
   ```
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to