Skip to content

Commit 5124945

Browse files
committed
BUG: empty servers list when zero endpoints
1 parent 52e08f8 commit 5124945

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
@@ -145,6 +145,15 @@ func (k *K8s) EventEndpoints(ns *Namespace, data *Endpoints, syncHAproxySrvs fun
145145
logger.Tracef("service %s : port name %s, backend %+v", data.Service, portName, backendName)
146146
}
147147
}
148+
if len(endpoints) == 0 {
149+
for _, runtimeBackend := range ns.HAProxyRuntime[data.Service] {
150+
runtimeBackend.Endpoints = PortEndpoints{}
151+
for _, haproxySrv := range runtimeBackend.HAProxySrvs {
152+
haproxySrv.Address = ""
153+
haproxySrv.Modified = true
154+
}
155+
}
156+
}
148157
for portName, portEndpoints := range endpoints {
149158
// Make a copy of addresses for potential standalone runtime backend
150159
// as these addresses are consumed/removed in the process

0 commit comments

Comments
 (0)