Skip to content

Commit feaf36b

Browse files
committed
BUG: empty servers list when zero endpoints
1 parent 59fd8e5 commit feaf36b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/store/events.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,15 @@ func (k *K8s) EventEndpoints(ns *Namespace, data *Endpoints, syncHAproxySrvs fun
141141
logger.Tracef("service %s : port name %s, backend %+v", data.Service, portName, backendName)
142142
}
143143
}
144+
if len(endpoints) == 0 {
145+
for _, runtimeBackend := range ns.HAProxyRuntime[data.Service] {
146+
runtimeBackend.Endpoints = PortEndpoints{}
147+
for _, haproxySrv := range runtimeBackend.HAProxySrvs {
148+
haproxySrv.Address = ""
149+
haproxySrv.Modified = true
150+
}
151+
}
152+
}
144153
for portName, portEndpoints := range endpoints {
145154
// Make a copy of addresses for potential standalone runtime backend
146155
// as these addresses are consumed/removed in the process

0 commit comments

Comments
 (0)