From 3a70ea3d40f63a5ac34f6cd21e383ead9e50e97c Mon Sep 17 00:00:00 2001 From: Joao Morais Date: Sun, 29 Aug 2021 15:08:18 -0300 Subject: [PATCH] fix ingress update to an existing backend Resource tracking is used to identify resources that should be parsed due to a configuration change. Resources directly or indirectly related with what was changed is removed and recreated to ensure that old behavior doesn't survive in the new state. A new ingress is already tracked to ensure that the referenced hosts and backends are removed, but this wasn't happening with existent ingress that reference a new backend that was already referenced elsewhere - such hosts and backends was being properly tracked for future updates, but would be missing some new configurations provided by the ingress that started to reference them. --- pkg/converters/ingress/ingress.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/converters/ingress/ingress.go b/pkg/converters/ingress/ingress.go index 2efbaa351..24d8cc365 100644 --- a/pkg/converters/ingress/ingress.go +++ b/pkg/converters/ingress/ingress.go @@ -368,7 +368,7 @@ func (c *converter) syncPartial() { // // All state change works removing hosts and backs objects in an old state and // resyncing ingress objects to recreate hosts and backs in a new state. This -// works very well, except with new ingress objects that references hosts or +// works very well, except with ingress objects that starts to reference hosts or // backs that already exist - all the tracking starts from the ingress parsing. // // trackAddedIngress does the same tracking the sync ingress already do, but @@ -377,7 +377,7 @@ func (c *converter) syncPartial() { // here and removed before parse the added ingress which will readd such hosts // and backs func (c *converter) trackAddedIngress() { - for _, ing := range c.changed.IngressesAdd { + for _, ing := range append(c.changed.IngressesAdd, c.changed.IngressesUpd...) { name := ing.Namespace + "/" + ing.Name if ing.Spec.DefaultBackend != nil { backend := c.findBackend(ing.Namespace, ing.Spec.DefaultBackend)