diff --git a/plan/plan.go b/plan/plan.go index c8087130b..b4100328d 100644 --- a/plan/plan.go +++ b/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 { diff --git a/provider/aws/aws_test.go b/provider/aws/aws_test.go index cd5067bd7..ad23109e1 100644 --- a/provider/aws/aws_test.go +++ b/provider/aws/aws_test.go @@ -1644,29 +1644,6 @@ func listAWSRecords(t *testing.T, client Route53API, zone string) []*route53.Res return recordSets } -// Route53 stores wildcards escaped: http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html?shortFooter=true#domain-name-format-asterisk -func escapeAWSRecords(t *testing.T, provider *AWSProvider, zone string) { - recordSets := listAWSRecords(t, provider.client, zone) - - changes := make([]*route53.Change, 0, len(recordSets)) - for _, recordSet := range recordSets { - changes = append(changes, &route53.Change{ - Action: aws.String(route53.ChangeActionUpsert), - ResourceRecordSet: recordSet, - }) - } - - if len(changes) != 0 { - _, err := provider.client.ChangeResourceRecordSetsWithContext(context.Background(), &route53.ChangeResourceRecordSetsInput{ - HostedZoneId: aws.String(zone), - ChangeBatch: &route53.ChangeBatch{ - Changes: changes, - }, - }) - require.NoError(t, err) - } -} - func newAWSProvider(t *testing.T, domainFilter endpoint.DomainFilter, zoneIDFilter provider.ZoneIDFilter, zoneTypeFilter provider.ZoneTypeFilter, evaluateTargetHealth, dryRun bool, records []*route53.ResourceRecordSet) (*AWSProvider, *Route53APIStub) { return newAWSProviderWithTagFilter(t, domainFilter, zoneIDFilter, zoneTypeFilter, provider.NewZoneTagFilter([]string{}), evaluateTargetHealth, dryRun, records) }