Skip to content

Commit

Permalink
fix ingress update to an existing backend
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jcmoraisjr committed Aug 30, 2021
1 parent c075258 commit 8119212
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/converters/ingress/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,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
Expand All @@ -342,7 +342,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.Backend != nil {
backend := c.findBackend(ing.Namespace, ing.Spec.Backend)
Expand Down

0 comments on commit 8119212

Please sign in to comment.