You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "bzp2010 (via GitHub)" <gi...@apache.org> on 2025/05/22 02:36:58 UTC

Re: [PR] fix: only parse and validate apisix.yaml in cli when startup [apisix]

bzp2010 commented on code in PR #12216:
URL: https://github.com/apache/apisix/pull/12216#discussion_r2101507333


##########
apisix/cli/file.lua:
##########
@@ -293,7 +294,9 @@ function _M.read_yaml_conf(apisix_home)
         end
     end
 
-    if default_conf.deployment.config_provider == "yaml" then
+    --- using `not ngx` to check whether the current execution environment is apisix cli module,
+    --- because it is only necessary to parse and validate `apisix.yaml` in apisix cli.
+    if default_conf.deployment.config_provider == "yaml" and not ngx then
         local apisix_conf_path = profile:yaml_path("apisix")

Review Comment:
   Actually I don't see what the following code does, it just reads the yaml and parses the variables whose values it contains. Other than that, there is no utilization of the values it reads.
   So whether we add this extra judgment or not doesn't affect the functionality of using it. I read your PR description and this is just an efficiency difference? I didn't get the need for 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