Skip to content

Commit 0647dcb

Browse files
committed
reduce number of changes
1 parent 46d0ed9 commit 0647dcb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

rootfs/etc/nginx/lua/balancer.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,14 @@ local function is_backend_with_external_name(backend)
110110
end
111111

112112
local function sync_backend(backend)
113+
-- We resolve external names before checking if the endpoints are empty
114+
-- because the behavior for resolve_external_names when the name was not
115+
-- resolved is to return an empty table so we set the balancer to nil below
116+
-- see https://github.com/kubernetes/ingress-nginx/pull/10989
113117
if is_backend_with_external_name(backend) then
114118
backend = resolve_external_names(backend)
115119
end
116120

117-
-- We check if the endpoints are empty after resolving the external names
118-
-- because the behavior for resolve_external_names when the name was not
119-
-- resolved is to return an empty table so we set the balancer to nil below
120-
-- see https://github.com/kubernetes/ingress-nginx/pull/10989
121121
if not backend.endpoints or #backend.endpoints == 0 then
122122
balancers[backend.name] = nil
123123
return

0 commit comments

Comments
 (0)