fix: remove CompareBoolean func

CompareBoolean() is no more used now

cf: 5affab0561
This commit is contained in:
Pascal Bourdier 2023-12-16 15:16:02 +01:00
parent 7f3c10d652
commit 32e55eaf16

View File

@ -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 {