mirror of
https://github.com/kubernetes-sigs/external-dns.git
synced 2025-08-06 01:26:59 +02:00
fix: remove CompareBoolean func
CompareBoolean() is no more used now
cf: 5affab0561
This commit is contained in:
parent
7f3c10d652
commit
32e55eaf16
26
plan/plan.go
26
plan/plan.go
@ -18,7 +18,6 @@ package plan
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
@ -342,31 +341,6 @@ func normalizeDNSName(dnsName string) string {
|
||||
return s
|
||||
}
|
||||
|
||||
// CompareBoolean is an implementation of PropertyComparator for comparing boolean-line values
|
||||
// For example external-dns.alpha.kubernetes.io/cloudflare-proxied: "true"
|
||||
// If value doesn't parse as boolean, the defaultValue is used
|
||||
func CompareBoolean(defaultValue bool, name, current, previous string) bool {
|
||||
var err error
|
||||
|
||||
v1, v2 := defaultValue, defaultValue
|
||||
|
||||
if previous != "" {
|
||||
v1, err = strconv.ParseBool(previous)
|
||||
if err != nil {
|
||||
v1 = defaultValue
|
||||
}
|
||||
}
|
||||
|
||||
if current != "" {
|
||||
v2, err = strconv.ParseBool(current)
|
||||
if err != nil {
|
||||
v2 = defaultValue
|
||||
}
|
||||
}
|
||||
|
||||
return v1 == v2
|
||||
}
|
||||
|
||||
func IsManagedRecord(record string, managedRecords, excludeRecords []string) bool {
|
||||
for _, r := range excludeRecords {
|
||||
if record == r {
|
||||
|
Loading…
Reference in New Issue
Block a user