Skip to content

Commit

Permalink
New provider-specific properties support when updating DNS records
Browse files Browse the repository at this point in the history
shouldUpdateProviderSpecific seems to be iterating over just the current properties that were previously set, not taking into consideration for planning changes when additional ProviderSpecific properties were just set.

The previous code version only iterates over current ProviderSpecific properties. This new version iterates over desired properties, including those that were just set.
  • Loading branch information
gjmveloso committed Nov 22, 2022
1 parent ee77277 commit 1cb15ab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plan/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ func (p *Plan) shouldUpdateProviderSpecific(desired, current *endpoint.Endpoint)
currentProperties := map[string]endpoint.ProviderSpecificProperty{}

if current.ProviderSpecific != nil {
for _, d := range current.ProviderSpecific {
currentProperties[d.Name] = d
for _, c := range current.ProviderSpecific {
currentProperties[c.Name] = c
}
}

Expand All @@ -229,7 +229,7 @@ func (p *Plan) shouldUpdateProviderSpecific(desired, current *endpoint.Endpoint)
}
} else {
if p.PropertyComparator != nil {
if !p.PropertyComparator(c.Name, "", d.Value) {
if !p.PropertyComparator(d.Name, "", d.Value) {
return true
}
} else if d.Value != "" {
Expand Down

0 comments on commit 1cb15ab

Please sign in to comment.