Merge pull request #10222 from k8s-infra-cherrypick-robot/cherry-pick-9815-to-release-1.8

[release-1.8] Scanning port 10247 lead to tcp connection 502 error
This commit is contained in:
James Strong 2023-07-20 13:49:55 -04:00 committed by GitHub
commit fda54cce2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,6 @@
local ngx = ngx
local tostring = tostring
local cjson = require("cjson.safe")
-- this is the Lua representation of TCP/UDP Configuration
local tcp_udp_configuration_data = ngx.shared.tcp_udp_configuration_data
@ -37,6 +38,14 @@ function _M.call()
return
end
local _, backends_err = cjson.decode(backends)
if backends_err then
ngx.log(ngx.ERR, "could not parse backends data: ", backends_err)
return
end
local success, err_conf = tcp_udp_configuration_data:set("backends", backends)
if not success then
ngx.log(ngx.ERR, "dynamic-configuration: error updating configuration: " .. tostring(err_conf))