diff --git a/endpoint/endpoint_test.go b/endpoint/endpoint_test.go index fe61f8dc6..0f1392036 100644 --- a/endpoint/endpoint_test.go +++ b/endpoint/endpoint_test.go @@ -37,7 +37,7 @@ func TestNewEndpoint(t *testing.T) { func TestNewEndpointWithIPv6(t *testing.T) { e := NewEndpoint("example.org", "AAAA", "foo.com") - if e.DNSName != "example.com" || e.Targets[0] != "foo.com" || e.RecordType != "AAAA" { + if e.DNSName != "example.org" || e.Targets[0] != "foo.com" || e.RecordType != "AAAA" { t.Error("Endpoint is not initialized correctly") } @@ -46,7 +46,7 @@ func TestNewEndpointWithIPv6(t *testing.T) { } w := NewEndpoint("example.org", "", "load-balancer.com.") - if w.DNSName != "example.org" || e.Targets[0] != "load-balancer.com" || w.RecordType != "" { + if w.DNSName != "example.org" || w.Targets[0] != "load-balancer.com" || w.RecordType != "" { t.Error("Endpoint is not initialized correctly") } } diff --git a/pkg/apis/externaldns/types_test.go b/pkg/apis/externaldns/types_test.go index 7d4cc6ab8..d9c68480c 100644 --- a/pkg/apis/externaldns/types_test.go +++ b/pkg/apis/externaldns/types_test.go @@ -372,6 +372,7 @@ func TestParseFlags(t *testing.T) { "--transip-keyfile=/path/to/transip.key", "--digitalocean-api-page-size=100", "--managed-record-types=A", + "--managed-record-types=AAAA", "--managed-record-types=CNAME", "--managed-record-types=NS", "--rfc2136-batch-change-size=100", @@ -488,7 +489,7 @@ func TestParseFlags(t *testing.T) { "EXTERNAL_DNS_TRANSIP_ACCOUNT": "transip", "EXTERNAL_DNS_TRANSIP_KEYFILE": "/path/to/transip.key", "EXTERNAL_DNS_DIGITALOCEAN_API_PAGE_SIZE": "100", - "EXTERNAL_DNS_MANAGED_RECORD_TYPES": "A\nCNAME\nNS", + "EXTERNAL_DNS_MANAGED_RECORD_TYPES": "A\nAAAA\nCNAME\nNS", "EXTERNAL_DNS_RFC2136_BATCH_CHANGE_SIZE": "100", "EXTERNAL_DNS_IBMCLOUD_PROXIED": "1", "EXTERNAL_DNS_IBMCLOUD_CONFIG_FILE": "ibmcloud.json", diff --git a/source/service_test.go b/source/service_test.go index 932d172e3..373298b0a 100644 --- a/source/service_test.go +++ b/source/service_test.go @@ -1054,7 +1054,8 @@ func testServiceSourceEndpoints(t *testing.T) { serviceTypesFilter: []string{}, annotations: map[string]string{hostnameAnnotationKey: "foobar.example.org"}, expected: []*endpoint.Endpoint{ - {DNSName: "foobar.example.org", Targets: endpoint.Targets{"1.1.1.1", "2001:db8::1"}}, + {DNSName: "foobar.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.1"}}, + {DNSName: "foobar.example.org", RecordType: endpoint.RecordTypeAAAA, Targets: endpoint.Targets{"2001:db8::1"}}, }, }, { @@ -1070,7 +1071,7 @@ func testServiceSourceEndpoints(t *testing.T) { serviceTypesFilter: []string{}, annotations: map[string]string{hostnameAnnotationKey: "foobar-v6.example.org"}, expected: []*endpoint.Endpoint{ - {DNSName: "foobar-v6.example.org", Targets: endpoint.Targets{"2001:db8::2"}}, + {DNSName: "foobar-v6.example.org", RecordType: endpoint.RecordTypeAAAA, Targets: endpoint.Targets{"2001:db8::2"}}, }, }, } {