From 82a554e77561093ed7e842f06c65e53f7b7457aa Mon Sep 17 00:00:00 2001 From: Raffaele Di Fazio Date: Tue, 29 Nov 2022 10:05:26 +0100 Subject: [PATCH] Revert "fix: New provider specific update" --- plan/plan.go | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/plan/plan.go b/plan/plan.go index 7eb4d9fe10..d7bac70909 100644 --- a/plan/plan.go +++ b/plan/plan.go @@ -209,17 +209,16 @@ func shouldUpdateTTL(desired, current *endpoint.Endpoint) bool { } func (p *Plan) shouldUpdateProviderSpecific(desired, current *endpoint.Endpoint) bool { - currentProperties := map[string]endpoint.ProviderSpecificProperty{} - - if current.ProviderSpecific != nil { - for _, d := range current.ProviderSpecific { - currentProperties[d.Name] = d - } - } + desiredProperties := map[string]endpoint.ProviderSpecificProperty{} if desired.ProviderSpecific != nil { for _, d := range desired.ProviderSpecific { - if c, ok := currentProperties[d.Name]; ok { + desiredProperties[d.Name] = d + } + } + if current.ProviderSpecific != nil { + for _, c := range current.ProviderSpecific { + if d, ok := desiredProperties[c.Name]; ok { if p.PropertyComparator != nil { if !p.PropertyComparator(c.Name, c.Value, d.Value) { return true @@ -229,10 +228,10 @@ func (p *Plan) shouldUpdateProviderSpecific(desired, current *endpoint.Endpoint) } } else { if p.PropertyComparator != nil { - if !p.PropertyComparator(c.Name, "", d.Value) { + if !p.PropertyComparator(c.Name, c.Value, "") { return true } - } else if d.Value != "" { + } else if c.Value != "" { return true } }