fix tcp 502 error

This commit is contained in:
lijie3 2023-03-31 10:07:35 +08:00 committed by k8s-infra-cherrypick-robot
parent ab99e23bba
commit 95ba84a69e

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
_, err = cjson.decode(backends)
if err then
ngx.log(ngx.ERR, "could not parse backends data: ", 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))