Skip to content

Commit 4ce7877

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 a1857e3 commit 4ce7877

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
@@ -115,7 +115,7 @@ func (k *K8s) EventEndpoints(ns *Namespace, data *Endpoints, syncHAproxySrvs fun
115115
endpoints := getEndpoints(ns.Endpoints[data.Service])
116116
logger.Tracef("service %s : endpoints list %+v", data.Service, endpoints)
117117
_, ok := ns.HAProxyRuntime[data.Service]
118-
if !ok || len(endpoints) == 0 {
118+
if !ok {
119119
ns.HAProxyRuntime[data.Service] = make(map[string]*RuntimeBackend)
120120
}
121121
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)