Skip to content

Commit

Permalink
Merge pull request #3199 from kubernetes-sigs/revert-3177-fix/new-pro…
Browse files Browse the repository at this point in the history
…vider-specific-update

Revert "fix: New provider specific update"
  • Loading branch information
k8s-ci-robot authored Nov 29, 2022
2 parents f1d37ea + 82a554e commit 00752b4
Showing 1 changed file with 9 additions and 10 deletions.
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

0 comments on commit 00752b4

Please sign in to comment.