Commit ae102d64 authored by Matt Potter's avatar Matt Potter

refactor to use sets.String

parent b8c03148
...@@ -27,6 +27,7 @@ import ( ...@@ -27,6 +27,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
pkgruntime "k8s.io/apimachinery/pkg/runtime" pkgruntime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/cache"
...@@ -346,14 +347,14 @@ func getResolvedEndpoints(endpoints []string) ([]string, error) { ...@@ -346,14 +347,14 @@ func getResolvedEndpoints(endpoints []string) ([]string, error) {
resolvedEndpoints = append(resolvedEndpoints, endpoint) resolvedEndpoints = append(resolvedEndpoints, endpoint)
} }
} }
deduped := []string{} deduped := sets.String{}
for _, value := range resolvedEndpoints { for _, endpoint := range resolvedEndpoints {
if !dedupeEndpoints(value, deduped) { if !deduped.Has(endpoint) {
deduped = append(deduped, value) deduped.Insert(endpoint)
} }
} }
return deduped, nil return deduped.List(), nil
} }
/* ensureDNSRrsets ensures (idempotently, and with minimum mutations) that all of the DNS resource record sets for dnsName are consistent with endpoints. /* ensureDNSRrsets ensures (idempotently, and with minimum mutations) that all of the DNS resource record sets for dnsName are consistent with endpoints.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment