Baoyuantop commented on PR #13025:
URL: https://github.com/apache/apisix/pull/13025#issuecomment-4174333644
Yes, you're right. Here's an example:
```lua
local function fetch_and_update_es_version(conf)
if conf._version then
return
end
-- resolve secrets for the HTTP request (deep copy, does not modify
original)
local conf_resolved = fetch_secrets(conf, true)
local selected_endpoint_addr
if conf_resolved.endpoint_addr then
selected_endpoint_addr = conf_resolved.endpoint_addr
else
selected_endpoint_addr = conf_resolved.endpoint_addrs[
math_random(#conf_resolved.endpoint_addrs)]
end
local major_version, err = get_es_major_version(selected_endpoint_addr,
conf_resolved)
if err then
core.log.error("failed to get Elasticsearch version: ", err)
return
end
-- write to ORIGINAL conf to preserve caching across requests
conf._version = major_version
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]