Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fix: New provider specific update" #3199

Merged
merged 1 commit into from
Nov 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions plan/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
}
Expand Down