Skip to content

Commit 6d97124

Browse files
hdurand0710oktalz
authored andcommitted
BUG/MAJOR: do not delete backends that were also upserted in the same cycle
When processBackendsDeletedInCycle ran, it would delete a backend even if another route had upserted it in the same reconciliation cycle. This caused backends shared between routes to be removed when one of the routes was updated, breaking traffic to the remaining routes. Fix by skipping deletion when the backend also appears in the Upserted map.
1 parent 31a4df8 commit 6d97124

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

k8s/gate/haproxy/backends.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,10 @@ func (b *HaproxyConfMgrImpl) processBackendsDeletedInCycle() utils.Errors {
10071007
var errs utils.Errors
10081008

10091009
for backendName := range b.backendsImpactedInCycle.Deleted {
1010+
if _, alsoUpserted := b.backendsImpactedInCycle.Upserted[backendName]; alsoUpserted {
1011+
// Another route upserted this backend in the same cycle: keep it.
1012+
continue
1013+
}
10101014
if err := b.configuration.deleteBackend(b.logger, backendName); err != nil {
10111015
errs.Add(err)
10121016
continue

0 commit comments

Comments
 (0)