Skip to content

Commit fa38442

Browse files
fabianonunesoktalz
authored andcommitted
BUG/MINOR: avoid hard restarts when the number of endpoints reaches zero
If the number of endpoints of a service reaches zero the haproxy does a forced restart. this scenario happens, for example, during a deploy/rollout of a workload with `replicas: 1` or if the rolling strategy of the workload has `maxUnavailable: 100%`.
1 parent 68f3ca0 commit fa38442

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/store/events.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func (k *K8s) EventEndpoints(ns *Namespace, data *Endpoints, syncHAproxySrvs fun
101101
endpoints := getEndpoints(ns.Endpoints[data.Service])
102102
logger.Tracef("service %s : endpoints list %+v", data.Service, endpoints)
103103
_, ok := ns.HAProxyRuntime[data.Service]
104-
if !ok || len(endpoints) == 0 {
104+
if !ok {
105105
ns.HAProxyRuntime[data.Service] = make(map[string]*RuntimeBackend)
106106
}
107107
logger.Tracef("service %s : number of already existing backend(s) in this transaction for this endpoint: %d", data.Service, len(ns.HAProxyRuntime[data.Service]))

0 commit comments

Comments
 (0)