From 9dd6df65c0aacff1bef018bc6bb9dd365a96b734 Mon Sep 17 00:00:00 2001 From: Helene Durand Date: Tue, 28 Jan 2025 09:28:52 +0100 Subject: [PATCH] BUG/MEDIUM: reload the configuration after a failed synced configuration if servers are created Fix the scenario where we have a failure when we sync the configuration and we scale a deployment before fixing the issue. In this scenario we were writing the configuration correctly with the new servers but not reloading. The runtime still had missing servers, it was capped to the server slots number of servers. --- pkg/haproxy/api/api.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/haproxy/api/api.go b/pkg/haproxy/api/api.go index 63ae4888..cfb01e06 100644 --- a/pkg/haproxy/api/api.go +++ b/pkg/haproxy/api/api.go @@ -279,6 +279,12 @@ func (c *clientNative) processServers(backendName string, configuration configur errCreateServer := configuration.CreateServer("backend", backendName, server, c.activeTransaction, 0) if errCreateServer != nil { errs.Add(configuration.EditServer(server.Name, "backend", backendName, server, c.activeTransaction, 0)) + } else { + // Server has been created, a reload is required + // It covers the case where there was a failure, scaleHAProxySrvs has already been called in a previous loop + // but the sync failed (wrong config) + // When the config is fixed, servers will be created + instance.Reload("server '%s' created in backend '%s'", server.Name, backendName) } } return errs