mirror of
https://github.com/kubernetes-sigs/external-dns.git
synced 2025-08-05 09:06:58 +02:00
Make unit tests more strict about record type
This commit is contained in:
parent
ee546ae242
commit
06227c1fbf
@ -220,8 +220,9 @@ func testEndpointsFromHTTPProxy(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "foo.bar",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "foo.bar",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -235,8 +236,9 @@ func testEndpointsFromHTTPProxy(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "foo.bar",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "foo.bar",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -251,12 +253,14 @@ func testEndpointsFromHTTPProxy(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "foo.bar",
|
||||
Targets: endpoint.Targets{"8.8.8.8", "127.0.0.1"},
|
||||
DNSName: "foo.bar",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8", "127.0.0.1"},
|
||||
},
|
||||
{
|
||||
DNSName: "foo.bar",
|
||||
Targets: endpoint.Targets{"elb.com", "alb.com"},
|
||||
DNSName: "foo.bar",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"elb.com", "alb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -342,20 +346,24 @@ func testHTTPProxyEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
{
|
||||
DNSName: "new.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "new.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "new.org",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "new.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -380,20 +388,24 @@ func testHTTPProxyEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
{
|
||||
DNSName: "new.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "new.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "new.org",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "new.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -418,12 +430,14 @@ func testHTTPProxyEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -446,8 +460,9 @@ func testHTTPProxyEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -509,8 +524,9 @@ func testHTTPProxyEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -551,8 +567,9 @@ func testHTTPProxyEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -593,12 +610,14 @@ func testHTTPProxyEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "fake1.ext-dns.test.com",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "fake1.ext-dns.test.com",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "fake1.ext-dns.test.com",
|
||||
Targets: endpoint.Targets{"elb.com"},
|
||||
DNSName: "fake1.ext-dns.test.com",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"elb.com"},
|
||||
},
|
||||
},
|
||||
fqdnTemplate: "{{.Name}}.ext-dns.test.com",
|
||||
@ -882,19 +901,22 @@ func testHTTPProxyEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"httpproxy-target.com"},
|
||||
RecordTTL: endpoint.TTL(6),
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"httpproxy-target.com"},
|
||||
RecordTTL: endpoint.TTL(6),
|
||||
},
|
||||
{
|
||||
DNSName: "example2.org",
|
||||
Targets: endpoint.Targets{"httpproxy-target.com"},
|
||||
RecordTTL: endpoint.TTL(1),
|
||||
DNSName: "example2.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"httpproxy-target.com"},
|
||||
RecordTTL: endpoint.TTL(1),
|
||||
},
|
||||
{
|
||||
DNSName: "example3.org",
|
||||
Targets: endpoint.Targets{"httpproxy-target.com"},
|
||||
RecordTTL: endpoint.TTL(10),
|
||||
DNSName: "example3.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"httpproxy-target.com"},
|
||||
RecordTTL: endpoint.TTL(10),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -997,20 +1019,24 @@ func testHTTPProxyEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
{
|
||||
DNSName: "new.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "new.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "new.org",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "new.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
ignoreHostnameAnnotation: true,
|
||||
|
@ -177,8 +177,9 @@ func testEndpointsFromIngress(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "foo.bar",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "foo.bar",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -190,8 +191,9 @@ func testEndpointsFromIngress(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "foo.bar",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "foo.bar",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -204,12 +206,14 @@ func testEndpointsFromIngress(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "foo.bar",
|
||||
Targets: endpoint.Targets{"8.8.8.8", "127.0.0.1"},
|
||||
DNSName: "foo.bar",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8", "127.0.0.1"},
|
||||
},
|
||||
{
|
||||
DNSName: "foo.bar",
|
||||
Targets: endpoint.Targets{"elb.com", "alb.com"},
|
||||
DNSName: "foo.bar",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"elb.com", "alb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -270,12 +274,14 @@ func testEndpointsFromIngressHostnameSourceAnnotation(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "foo.bar",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "foo.bar",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
{
|
||||
DNSName: "foo.baz",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "foo.baz",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -287,8 +293,9 @@ func testEndpointsFromIngressHostnameSourceAnnotation(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "foo.bar",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "foo.bar",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -301,12 +308,14 @@ func testEndpointsFromIngressHostnameSourceAnnotation(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "foo.bar",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "foo.bar",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
{
|
||||
DNSName: "foo.baz",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "foo.baz",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -319,8 +328,9 @@ func testEndpointsFromIngressHostnameSourceAnnotation(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "foo.bar",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "foo.bar",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -333,8 +343,9 @@ func testEndpointsFromIngressHostnameSourceAnnotation(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "foo.baz",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "foo.baz",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -387,12 +398,14 @@ func testIngressEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "new.org",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "new.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -435,12 +448,14 @@ func testIngressEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "new.org",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "new.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -463,8 +478,9 @@ func testIngressEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -485,8 +501,9 @@ func testIngressEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -542,8 +559,9 @@ func testIngressEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -580,8 +598,9 @@ func testIngressEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -618,12 +637,14 @@ func testIngressEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "fake1.ext-dns.test.com",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "fake1.ext-dns.test.com",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "fake1.ext-dns.test.com",
|
||||
Targets: endpoint.Targets{"elb.com"},
|
||||
DNSName: "fake1.ext-dns.test.com",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"elb.com"},
|
||||
},
|
||||
},
|
||||
fqdnTemplate: "{{.Name}}.ext-dns.test.com",
|
||||
@ -973,19 +994,22 @@ func testIngressEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"ingress-target.com"},
|
||||
RecordTTL: endpoint.TTL(6),
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"ingress-target.com"},
|
||||
RecordTTL: endpoint.TTL(6),
|
||||
},
|
||||
{
|
||||
DNSName: "example2.org",
|
||||
Targets: endpoint.Targets{"ingress-target.com"},
|
||||
RecordTTL: endpoint.TTL(1),
|
||||
DNSName: "example2.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"ingress-target.com"},
|
||||
RecordTTL: endpoint.TTL(1),
|
||||
},
|
||||
{
|
||||
DNSName: "example3.org",
|
||||
Targets: endpoint.Targets{"ingress-target.com"},
|
||||
RecordTTL: endpoint.TTL(10),
|
||||
DNSName: "example3.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"ingress-target.com"},
|
||||
RecordTTL: endpoint.TTL(10),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -1132,12 +1156,14 @@ func testIngressEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "new.org",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "new.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -1169,8 +1195,9 @@ func testIngressEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"1.2.3.4"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"1.2.3.4"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -1189,8 +1216,9 @@ func testIngressEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -184,8 +184,9 @@ func testEndpointsFromGatewayConfig(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "foo.bar",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "foo.bar",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -203,8 +204,9 @@ func testEndpointsFromGatewayConfig(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "foo.bar",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "foo.bar",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -222,8 +224,9 @@ func testEndpointsFromGatewayConfig(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "foo.bar",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "foo.bar",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -242,12 +245,14 @@ func testEndpointsFromGatewayConfig(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "foo.bar",
|
||||
Targets: endpoint.Targets{"8.8.8.8", "127.0.0.1"},
|
||||
DNSName: "foo.bar",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8", "127.0.0.1"},
|
||||
},
|
||||
{
|
||||
DNSName: "foo.bar",
|
||||
Targets: endpoint.Targets{"elb.com", "alb.com"},
|
||||
DNSName: "foo.bar",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"elb.com", "alb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -310,8 +315,9 @@ func testEndpointsFromGatewayConfig(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "foo.bar",
|
||||
Targets: endpoint.Targets{"lb.com", "lb2.com"},
|
||||
DNSName: "foo.bar",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com", "lb2.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -376,20 +382,24 @@ func testGatewayEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
{
|
||||
DNSName: "new.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "new.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "new.org",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "new.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -416,20 +426,24 @@ func testGatewayEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
{
|
||||
DNSName: "new.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "new.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "new.org",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "new.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -452,12 +466,14 @@ func testGatewayEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -482,8 +498,9 @@ func testGatewayEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -551,8 +568,9 @@ func testGatewayEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -597,8 +615,9 @@ func testGatewayEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -643,12 +662,14 @@ func testGatewayEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "fake1.ext-dns.test.com",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "fake1.ext-dns.test.com",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "fake1.ext-dns.test.com",
|
||||
Targets: endpoint.Targets{"elb.com"},
|
||||
DNSName: "fake1.ext-dns.test.com",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"elb.com"},
|
||||
},
|
||||
},
|
||||
fqdnTemplate: "{{.Name}}.ext-dns.test.com",
|
||||
@ -948,19 +969,22 @@ func testGatewayEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"gateway-target.com"},
|
||||
RecordTTL: endpoint.TTL(6),
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"gateway-target.com"},
|
||||
RecordTTL: endpoint.TTL(6),
|
||||
},
|
||||
{
|
||||
DNSName: "example2.org",
|
||||
Targets: endpoint.Targets{"gateway-target.com"},
|
||||
RecordTTL: endpoint.TTL(1),
|
||||
DNSName: "example2.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"gateway-target.com"},
|
||||
RecordTTL: endpoint.TTL(1),
|
||||
},
|
||||
{
|
||||
DNSName: "example3.org",
|
||||
Targets: endpoint.Targets{"gateway-target.com"},
|
||||
RecordTTL: endpoint.TTL(10),
|
||||
DNSName: "example3.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"gateway-target.com"},
|
||||
RecordTTL: endpoint.TTL(10),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -1069,20 +1093,24 @@ func testGatewayEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
{
|
||||
DNSName: "new.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "new.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "new.org",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "new.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
ignoreHostnameAnnotation: true,
|
||||
@ -1137,12 +1165,14 @@ func testGatewayEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "fake1.dns-through-hostname.com",
|
||||
Targets: endpoint.Targets{"1.2.3.4"},
|
||||
DNSName: "fake1.dns-through-hostname.com",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"1.2.3.4"},
|
||||
},
|
||||
{
|
||||
DNSName: "fake2.dns-through-hostname.com",
|
||||
Targets: endpoint.Targets{"1.2.3.4"},
|
||||
DNSName: "fake2.dns-through-hostname.com",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"1.2.3.4"},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -394,8 +394,9 @@ func testEndpointsFromVirtualServiceConfig(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "foo.bar",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "foo.bar",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -416,8 +417,9 @@ func testEndpointsFromVirtualServiceConfig(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "foo.bar",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "foo.bar",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -439,12 +441,14 @@ func testEndpointsFromVirtualServiceConfig(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "foo.bar",
|
||||
Targets: endpoint.Targets{"8.8.8.8", "127.0.0.1"},
|
||||
DNSName: "foo.bar",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8", "127.0.0.1"},
|
||||
},
|
||||
{
|
||||
DNSName: "foo.bar",
|
||||
Targets: endpoint.Targets{"elb.com", "alb.com"},
|
||||
DNSName: "foo.bar",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"elb.com", "alb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -543,8 +547,9 @@ func testEndpointsFromVirtualServiceConfig(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "foo.bar",
|
||||
Targets: endpoint.Targets{"elb.com", "alb.com"},
|
||||
DNSName: "foo.bar",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"elb.com", "alb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -618,20 +623,24 @@ func testVirtualServiceEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
{
|
||||
DNSName: "new.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "new.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "new.org",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "new.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -665,8 +674,9 @@ func testVirtualServiceEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -702,20 +712,24 @@ func testVirtualServiceEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
{
|
||||
DNSName: "new.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "new.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "new.org",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "new.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -752,12 +766,14 @@ func testVirtualServiceEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -790,8 +806,9 @@ func testVirtualServiceEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -858,8 +875,9 @@ func testVirtualServiceEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -917,12 +935,14 @@ func testVirtualServiceEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "vs1.ext-dns.test.com",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "vs1.ext-dns.test.com",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "vs1.ext-dns.test.com",
|
||||
Targets: endpoint.Targets{"elb.com"},
|
||||
DNSName: "vs1.ext-dns.test.com",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"elb.com"},
|
||||
},
|
||||
},
|
||||
fqdnTemplate: "{{.Name}}.ext-dns.test.com",
|
||||
@ -1206,14 +1226,16 @@ func testVirtualServiceEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
RecordTTL: endpoint.TTL(6),
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
RecordTTL: endpoint.TTL(6),
|
||||
},
|
||||
{
|
||||
DNSName: "example2.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
RecordTTL: endpoint.TTL(1),
|
||||
DNSName: "example2.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
RecordTTL: endpoint.TTL(1),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -1322,20 +1344,24 @@ func testVirtualServiceEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "example.org",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "example.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
{
|
||||
DNSName: "new.org",
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
DNSName: "new.org",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets{"8.8.8.8"},
|
||||
},
|
||||
{
|
||||
DNSName: "new.org",
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
DNSName: "new.org",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets{"lb.com"},
|
||||
},
|
||||
},
|
||||
ignoreHostnameAnnotation: true,
|
||||
|
@ -197,7 +197,8 @@ func testOcpRouteSourceEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "my-domain.com",
|
||||
DNSName: "my-domain.com",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: []string{
|
||||
"apps.my-domain.com",
|
||||
},
|
||||
@ -230,7 +231,8 @@ func testOcpRouteSourceEndpoints(t *testing.T) {
|
||||
ocpRouterName: "default",
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "my-domain.com",
|
||||
DNSName: "my-domain.com",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: []string{
|
||||
"router-default.my-domain.com",
|
||||
},
|
||||
@ -274,7 +276,8 @@ func testOcpRouteSourceEndpoints(t *testing.T) {
|
||||
ocpRouterName: "default",
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "my-domain.com",
|
||||
DNSName: "my-domain.com",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: []string{
|
||||
"router-default.my-domain.com",
|
||||
},
|
||||
@ -393,8 +396,11 @@ func testOcpRouteSourceEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "my-domain.com",
|
||||
Targets: []string{"router-test.my-domain.com"},
|
||||
DNSName: "my-domain.com",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: []string{
|
||||
"router-test.my-domain.com",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -439,7 +445,8 @@ func testOcpRouteSourceEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "my-annotation-domain.com",
|
||||
DNSName: "my-annotation-domain.com",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: []string{
|
||||
"my.site.foo.com",
|
||||
},
|
||||
@ -479,7 +486,8 @@ func testOcpRouteSourceEndpoints(t *testing.T) {
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "my-annotation-domain.com",
|
||||
DNSName: "my-annotation-domain.com",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: []string{
|
||||
"my.site.foo.com",
|
||||
},
|
||||
|
@ -232,7 +232,7 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -277,8 +277,8 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.fqdn.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.fqdn.com", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.fqdn.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.fqdn.com", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -294,8 +294,8 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.fqdn.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.fqdn.com", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.fqdn.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.fqdn.com", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -313,10 +313,10 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "bar.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.fqdn.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.fqdn.com", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "bar.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.fqdn.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.fqdn.com", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -335,8 +335,8 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.fqdn.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.fqdn.com", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.fqdn.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.fqdn.com", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -352,8 +352,8 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "bar.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "bar.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -369,8 +369,8 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "bar.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "bar.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -386,7 +386,7 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"lb.example.com"}, // Kubernetes omits the trailing dot
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"lb.example.com"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeCNAME, Targets: endpoint.Targets{"lb.example.com"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -402,8 +402,8 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4", "lb.example.com"}, // Kubernetes omits the trailing dot
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"lb.example.com"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeCNAME, Targets: endpoint.Targets{"lb.example.com"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -420,7 +420,7 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -453,7 +453,7 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -484,7 +484,7 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -502,7 +502,7 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -553,7 +553,7 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -599,7 +599,7 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"10.2.3.4", "11.2.3.4"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"10.2.3.4", "11.2.3.4"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -615,7 +615,7 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4", "8.8.8.8"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4", "8.8.8.8"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4", "8.8.8.8"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -646,7 +646,7 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -665,8 +665,8 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "bar.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "bar.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -683,8 +683,8 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4", "lb.example.com"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "internal.foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "internal.foo.example.org", Targets: endpoint.Targets{"lb.example.com"}},
|
||||
{DNSName: "internal.foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "internal.foo.example.org", RecordType: endpoint.RecordTypeCNAME, Targets: endpoint.Targets{"lb.example.com"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -702,10 +702,10 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "bar.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "internal.foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "internal.bar.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "bar.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "internal.foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "internal.bar.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -720,8 +720,8 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4", "elb.com"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.bar.example.com", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.bar.example.com", Targets: endpoint.Targets{"elb.com"}},
|
||||
{DNSName: "foo.bar.example.com", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.bar.example.com", RecordType: endpoint.RecordTypeCNAME, Targets: endpoint.Targets{"elb.com"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -738,8 +738,8 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4", "elb.com"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"elb.com"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeCNAME, Targets: endpoint.Targets{"elb.com"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -757,7 +757,7 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "mate.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "mate.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -787,7 +787,7 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}, RecordTTL: endpoint.TTL(0)},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}, RecordTTL: endpoint.TTL(0)},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -804,7 +804,7 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}, RecordTTL: endpoint.TTL(0)},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}, RecordTTL: endpoint.TTL(0)},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -821,7 +821,7 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}, RecordTTL: endpoint.TTL(10)},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}, RecordTTL: endpoint.TTL(10)},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -838,7 +838,7 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}, RecordTTL: endpoint.TTL(60)},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}, RecordTTL: endpoint.TTL(60)},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -855,7 +855,7 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}, RecordTTL: endpoint.TTL(0)},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}, RecordTTL: endpoint.TTL(0)},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -871,7 +871,7 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{string(v1.ServiceTypeLoadBalancer)},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -902,7 +902,7 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.internal.example.org", Targets: endpoint.Targets{"1.1.1.1"}},
|
||||
{DNSName: "foo.internal.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.1"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -920,8 +920,8 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
lbs: []string{"1.2.3.4"},
|
||||
serviceTypesFilter: []string{},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.internal.example.org", Targets: endpoint.Targets{"1.1.1.1"}},
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.internal.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.1"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -939,7 +939,7 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
serviceLabelSelector: "app=web-external",
|
||||
fqdnTemplate: "{{.Name}}.bar.example.com",
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "fqdn.bar.example.com", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "fqdn.bar.example.com", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -957,7 +957,7 @@ func testServiceSourceEndpoints(t *testing.T) {
|
||||
serviceLabelSelector: "app=web-external",
|
||||
annotations: map[string]string{hostnameAnnotationKey: "annotation.bar.example.com"},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "annotation.bar.example.com", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "annotation.bar.example.com", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -1112,7 +1112,7 @@ func testMultipleServicesEndpoints(t *testing.T) {
|
||||
},
|
||||
[]string{},
|
||||
[]*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}, Labels: map[string]string{endpoint.ResourceLabelKey: "service/testing/foo1.2.3.4"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}, Labels: map[string]string{endpoint.ResourceLabelKey: "service/testing/foo1.2.3.4"}},
|
||||
},
|
||||
false,
|
||||
},
|
||||
@ -1136,7 +1136,7 @@ func testMultipleServicesEndpoints(t *testing.T) {
|
||||
},
|
||||
[]string{},
|
||||
[]*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4", "1.2.3.5", "1.2.3.6"}, Labels: map[string]string{endpoint.ResourceLabelKey: "service/testing/foo1.2.3.4"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4", "1.2.3.5", "1.2.3.6"}, Labels: map[string]string{endpoint.ResourceLabelKey: "service/testing/foo1.2.3.4"}},
|
||||
},
|
||||
false,
|
||||
},
|
||||
@ -1164,9 +1164,9 @@ func testMultipleServicesEndpoints(t *testing.T) {
|
||||
},
|
||||
[]string{},
|
||||
[]*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4", "1.2.3.5", "1.2.3.6"}, Labels: map[string]string{endpoint.ResourceLabelKey: "service/testing/foo1.2.3.4"}},
|
||||
{DNSName: "bar.example.org", Targets: endpoint.Targets{"10.1.1.1", "10.1.1.2", "10.1.1.3"}, Labels: map[string]string{endpoint.ResourceLabelKey: "service/testing/foo10.1.1.1"}},
|
||||
{DNSName: "foobar.example.org", Targets: endpoint.Targets{"20.1.1.1"}, Labels: map[string]string{endpoint.ResourceLabelKey: "service/testing/foo20.1.1.1"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4", "1.2.3.5", "1.2.3.6"}, Labels: map[string]string{endpoint.ResourceLabelKey: "service/testing/foo1.2.3.4"}},
|
||||
{DNSName: "bar.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"10.1.1.1", "10.1.1.2", "10.1.1.3"}, Labels: map[string]string{endpoint.ResourceLabelKey: "service/testing/foo10.1.1.1"}},
|
||||
{DNSName: "foobar.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"20.1.1.1"}, Labels: map[string]string{endpoint.ResourceLabelKey: "service/testing/foo20.1.1.1"}},
|
||||
},
|
||||
false,
|
||||
},
|
||||
@ -1189,8 +1189,8 @@ func testMultipleServicesEndpoints(t *testing.T) {
|
||||
},
|
||||
[]string{},
|
||||
[]*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"a.elb.com"}, Labels: map[string]string{endpoint.ResourceLabelKey: "service/testing/fooa.elb.com"}, SetIdentifier: "a"},
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"b.elb.com"}, Labels: map[string]string{endpoint.ResourceLabelKey: "service/testing/foob.elb.com"}, SetIdentifier: "b"},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeCNAME, Targets: endpoint.Targets{"a.elb.com"}, Labels: map[string]string{endpoint.ResourceLabelKey: "service/testing/fooa.elb.com"}, SetIdentifier: "a"},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeCNAME, Targets: endpoint.Targets{"b.elb.com"}, Labels: map[string]string{endpoint.ResourceLabelKey: "service/testing/foob.elb.com"}, SetIdentifier: "b"},
|
||||
},
|
||||
false,
|
||||
},
|
||||
@ -1304,7 +1304,7 @@ func TestClusterIpServices(t *testing.T) {
|
||||
},
|
||||
clusterIP: "1.2.3.4",
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -1327,7 +1327,7 @@ func TestClusterIpServices(t *testing.T) {
|
||||
fqdnTemplate: "{{.Name}}.bar.example.com",
|
||||
clusterIP: "4.5.6.7",
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.bar.example.com", Targets: endpoint.Targets{"4.5.6.7"}},
|
||||
{DNSName: "foo.bar.example.com", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"4.5.6.7"}},
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -1347,7 +1347,7 @@ func TestClusterIpServices(t *testing.T) {
|
||||
labels: map[string]string{"app": "web-internal"},
|
||||
clusterIP: "4.5.6.7",
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.bar.example.com", Targets: endpoint.Targets{"4.5.6.7"}},
|
||||
{DNSName: "foo.bar.example.com", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"4.5.6.7"}},
|
||||
},
|
||||
labelSelector: "app=web-internal",
|
||||
},
|
||||
@ -1748,8 +1748,8 @@ func TestServiceSourceNodePortServices(t *testing.T) {
|
||||
kopsDNSControllerInternalHostnameAnnotationKey: "internal.foo.example.org., internal.bar.example.org",
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "internal.foo.example.org", Targets: endpoint.Targets{"10.0.1.1"}},
|
||||
{DNSName: "internal.bar.example.org", Targets: endpoint.Targets{"10.0.1.1"}},
|
||||
{DNSName: "internal.foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"10.0.1.1"}},
|
||||
{DNSName: "internal.bar.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"10.0.1.1"}},
|
||||
},
|
||||
nodes: []*v1.Node{{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
@ -1790,8 +1790,8 @@ func TestServiceSourceNodePortServices(t *testing.T) {
|
||||
kopsDNSControllerInternalHostnameAnnotationKey: "internal.foo.example.org., internal.bar.example.org",
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "internal.foo.example.org", Targets: endpoint.Targets{"10.0.1.1", "10.0.1.2"}},
|
||||
{DNSName: "internal.bar.example.org", Targets: endpoint.Targets{"10.0.1.1", "10.0.1.2"}},
|
||||
{DNSName: "internal.foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"10.0.1.1", "10.0.1.2"}},
|
||||
{DNSName: "internal.bar.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"10.0.1.1", "10.0.1.2"}},
|
||||
},
|
||||
nodes: []*v1.Node{{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
@ -1832,8 +1832,8 @@ func TestServiceSourceNodePortServices(t *testing.T) {
|
||||
kopsDNSControllerHostnameAnnotationKey: "foo.example.org., bar.example.org",
|
||||
},
|
||||
expected: []*endpoint.Endpoint{
|
||||
{DNSName: "foo.example.org", Targets: endpoint.Targets{"54.10.11.1", "54.10.11.2"}},
|
||||
{DNSName: "bar.example.org", Targets: endpoint.Targets{"54.10.11.1", "54.10.11.2"}},
|
||||
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"54.10.11.1", "54.10.11.2"}},
|
||||
{DNSName: "bar.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"54.10.11.1", "54.10.11.2"}},
|
||||
},
|
||||
nodes: []*v1.Node{{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
@ -2051,9 +2051,9 @@ func TestHeadlessServices(t *testing.T) {
|
||||
false,
|
||||
[]v1.Node{},
|
||||
[]*endpoint.Endpoint{
|
||||
{DNSName: "foo-0.service.example.org", Targets: endpoint.Targets{"1.1.1.1"}},
|
||||
{DNSName: "foo-1.service.example.org", Targets: endpoint.Targets{"1.1.1.2"}},
|
||||
{DNSName: "service.example.org", Targets: endpoint.Targets{"1.1.1.1", "1.1.1.2"}},
|
||||
{DNSName: "foo-0.service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.1"}},
|
||||
{DNSName: "foo-1.service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.2"}},
|
||||
{DNSName: "service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.1", "1.1.1.2"}},
|
||||
},
|
||||
false,
|
||||
},
|
||||
@ -2114,9 +2114,9 @@ func TestHeadlessServices(t *testing.T) {
|
||||
false,
|
||||
[]v1.Node{},
|
||||
[]*endpoint.Endpoint{
|
||||
{DNSName: "foo-0.service.example.org", Targets: endpoint.Targets{"1.1.1.1"}, RecordTTL: endpoint.TTL(1)},
|
||||
{DNSName: "foo-1.service.example.org", Targets: endpoint.Targets{"1.1.1.2"}, RecordTTL: endpoint.TTL(1)},
|
||||
{DNSName: "service.example.org", Targets: endpoint.Targets{"1.1.1.1", "1.1.1.2"}, RecordTTL: endpoint.TTL(1)},
|
||||
{DNSName: "foo-0.service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.1"}, RecordTTL: endpoint.TTL(1)},
|
||||
{DNSName: "foo-1.service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.2"}, RecordTTL: endpoint.TTL(1)},
|
||||
{DNSName: "service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.1", "1.1.1.2"}, RecordTTL: endpoint.TTL(1)},
|
||||
},
|
||||
false,
|
||||
},
|
||||
@ -2147,8 +2147,8 @@ func TestHeadlessServices(t *testing.T) {
|
||||
false,
|
||||
[]v1.Node{},
|
||||
[]*endpoint.Endpoint{
|
||||
{DNSName: "foo-0.service.example.org", Targets: endpoint.Targets{"1.1.1.1"}},
|
||||
{DNSName: "service.example.org", Targets: endpoint.Targets{"1.1.1.1"}},
|
||||
{DNSName: "foo-0.service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.1"}},
|
||||
{DNSName: "service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.1"}},
|
||||
},
|
||||
false,
|
||||
},
|
||||
@ -2179,9 +2179,9 @@ func TestHeadlessServices(t *testing.T) {
|
||||
true,
|
||||
[]v1.Node{},
|
||||
[]*endpoint.Endpoint{
|
||||
{DNSName: "foo-0.service.example.org", Targets: endpoint.Targets{"1.1.1.1"}},
|
||||
{DNSName: "foo-1.service.example.org", Targets: endpoint.Targets{"1.1.1.2"}},
|
||||
{DNSName: "service.example.org", Targets: endpoint.Targets{"1.1.1.1", "1.1.1.2"}},
|
||||
{DNSName: "foo-0.service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.1"}},
|
||||
{DNSName: "foo-1.service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.2"}},
|
||||
{DNSName: "service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.1", "1.1.1.2"}},
|
||||
},
|
||||
false,
|
||||
},
|
||||
@ -2212,7 +2212,7 @@ func TestHeadlessServices(t *testing.T) {
|
||||
false,
|
||||
[]v1.Node{},
|
||||
[]*endpoint.Endpoint{
|
||||
{DNSName: "service.example.org", Targets: endpoint.Targets{"1.1.1.1", "1.1.1.2"}},
|
||||
{DNSName: "service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.1", "1.1.1.2"}},
|
||||
},
|
||||
false,
|
||||
},
|
||||
@ -2243,7 +2243,7 @@ func TestHeadlessServices(t *testing.T) {
|
||||
false,
|
||||
[]v1.Node{},
|
||||
[]*endpoint.Endpoint{
|
||||
{DNSName: "service.example.org", Targets: endpoint.Targets{"1.1.1.1", "1.1.1.2"}},
|
||||
{DNSName: "service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.1", "1.1.1.2"}},
|
||||
},
|
||||
false,
|
||||
},
|
||||
@ -2276,7 +2276,7 @@ func TestHeadlessServices(t *testing.T) {
|
||||
false,
|
||||
[]v1.Node{},
|
||||
[]*endpoint.Endpoint{
|
||||
{DNSName: "service.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
},
|
||||
false,
|
||||
},
|
||||
@ -2319,7 +2319,7 @@ func TestHeadlessServices(t *testing.T) {
|
||||
},
|
||||
},
|
||||
[]*endpoint.Endpoint{
|
||||
{DNSName: "service.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
},
|
||||
false,
|
||||
},
|
||||
@ -2351,7 +2351,7 @@ func TestHeadlessServices(t *testing.T) {
|
||||
false,
|
||||
[]v1.Node{},
|
||||
[]*endpoint.Endpoint{
|
||||
{DNSName: "service.example.org", Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
{DNSName: "service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.2.3.4"}},
|
||||
},
|
||||
false,
|
||||
},
|
||||
@ -2523,9 +2523,9 @@ func TestHeadlessServicesHostIP(t *testing.T) {
|
||||
},
|
||||
false,
|
||||
[]*endpoint.Endpoint{
|
||||
{DNSName: "foo-0.service.example.org", Targets: endpoint.Targets{"1.1.1.1"}},
|
||||
{DNSName: "foo-1.service.example.org", Targets: endpoint.Targets{"1.1.1.2"}},
|
||||
{DNSName: "service.example.org", Targets: endpoint.Targets{"1.1.1.1", "1.1.1.2"}},
|
||||
{DNSName: "foo-0.service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.1"}},
|
||||
{DNSName: "foo-1.service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.2"}},
|
||||
{DNSName: "service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.1", "1.1.1.2"}},
|
||||
},
|
||||
false,
|
||||
},
|
||||
@ -2588,9 +2588,9 @@ func TestHeadlessServicesHostIP(t *testing.T) {
|
||||
},
|
||||
false,
|
||||
[]*endpoint.Endpoint{
|
||||
{DNSName: "foo-0.service.example.org", Targets: endpoint.Targets{"1.1.1.1"}, RecordTTL: endpoint.TTL(1)},
|
||||
{DNSName: "foo-1.service.example.org", Targets: endpoint.Targets{"1.1.1.2"}, RecordTTL: endpoint.TTL(1)},
|
||||
{DNSName: "service.example.org", Targets: endpoint.Targets{"1.1.1.1", "1.1.1.2"}, RecordTTL: endpoint.TTL(1)},
|
||||
{DNSName: "foo-0.service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.1"}, RecordTTL: endpoint.TTL(1)},
|
||||
{DNSName: "foo-1.service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.2"}, RecordTTL: endpoint.TTL(1)},
|
||||
{DNSName: "service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.1", "1.1.1.2"}, RecordTTL: endpoint.TTL(1)},
|
||||
},
|
||||
false,
|
||||
},
|
||||
@ -2622,8 +2622,8 @@ func TestHeadlessServicesHostIP(t *testing.T) {
|
||||
},
|
||||
false,
|
||||
[]*endpoint.Endpoint{
|
||||
{DNSName: "foo-0.service.example.org", Targets: endpoint.Targets{"1.1.1.1"}},
|
||||
{DNSName: "service.example.org", Targets: endpoint.Targets{"1.1.1.1"}},
|
||||
{DNSName: "foo-0.service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.1"}},
|
||||
{DNSName: "service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.1"}},
|
||||
},
|
||||
false,
|
||||
},
|
||||
@ -2655,9 +2655,9 @@ func TestHeadlessServicesHostIP(t *testing.T) {
|
||||
},
|
||||
true,
|
||||
[]*endpoint.Endpoint{
|
||||
{DNSName: "foo-0.service.example.org", Targets: endpoint.Targets{"1.1.1.1"}},
|
||||
{DNSName: "foo-1.service.example.org", Targets: endpoint.Targets{"1.1.1.2"}},
|
||||
{DNSName: "service.example.org", Targets: endpoint.Targets{"1.1.1.1", "1.1.1.2"}},
|
||||
{DNSName: "foo-0.service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.1"}},
|
||||
{DNSName: "foo-1.service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.2"}},
|
||||
{DNSName: "service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.1", "1.1.1.2"}},
|
||||
},
|
||||
false,
|
||||
},
|
||||
@ -2689,7 +2689,7 @@ func TestHeadlessServicesHostIP(t *testing.T) {
|
||||
},
|
||||
false,
|
||||
[]*endpoint.Endpoint{
|
||||
{DNSName: "service.example.org", Targets: endpoint.Targets{"1.1.1.1", "1.1.1.2"}},
|
||||
{DNSName: "service.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"1.1.1.1", "1.1.1.2"}},
|
||||
},
|
||||
false,
|
||||
},
|
||||
|
@ -79,7 +79,7 @@ func validateEndpoint(t *testing.T, endpoint, expected *endpoint.Endpoint) {
|
||||
}
|
||||
|
||||
// if non-empty record type is expected, check that it matches.
|
||||
if expected.RecordType != "" && endpoint.RecordType != expected.RecordType {
|
||||
if endpoint.RecordType != expected.RecordType {
|
||||
t.Errorf("RecordType expected %q, got %q", expected.RecordType, endpoint.RecordType)
|
||||
}
|
||||
|
||||
|
@ -90,8 +90,9 @@ func TestEndpointsFromRouteGroups(t *testing.T) {
|
||||
}),
|
||||
want: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "rg1.k8s.example",
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
DNSName: "rg1.k8s.example",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -113,12 +114,14 @@ func TestEndpointsFromRouteGroups(t *testing.T) {
|
||||
),
|
||||
want: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "rg1.k8s.example",
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
DNSName: "rg1.k8s.example",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
},
|
||||
{
|
||||
DNSName: "my.example",
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
DNSName: "my.example",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -140,8 +143,9 @@ func TestEndpointsFromRouteGroups(t *testing.T) {
|
||||
),
|
||||
want: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "rg1.k8s.example",
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
DNSName: "rg1.k8s.example",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -163,9 +167,10 @@ func TestEndpointsFromRouteGroups(t *testing.T) {
|
||||
),
|
||||
want: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "rg1.k8s.example",
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
RecordTTL: endpoint.TTL(2189),
|
||||
DNSName: "rg1.k8s.example",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
RecordTTL: endpoint.TTL(2189),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -185,8 +190,9 @@ func TestEndpointsFromRouteGroups(t *testing.T) {
|
||||
),
|
||||
want: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "rg1.k8s.example",
|
||||
Targets: endpoint.Targets([]string{"1.5.1.4"}),
|
||||
DNSName: "rg1.k8s.example",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets([]string{"1.5.1.4"}),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -207,12 +213,14 @@ func TestEndpointsFromRouteGroups(t *testing.T) {
|
||||
),
|
||||
want: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "rg1.k8s.example",
|
||||
Targets: endpoint.Targets([]string{"1.5.1.4"}),
|
||||
DNSName: "rg1.k8s.example",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets([]string{"1.5.1.4"}),
|
||||
},
|
||||
{
|
||||
DNSName: "rg1.k8s.example",
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
DNSName: "rg1.k8s.example",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -278,8 +286,9 @@ func TestRouteGroupsEndpoints(t *testing.T) {
|
||||
},
|
||||
want: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "rg1.k8s.example",
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
DNSName: "rg1.k8s.example",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -308,12 +317,14 @@ func TestRouteGroupsEndpoints(t *testing.T) {
|
||||
},
|
||||
want: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "rg1.k8s.example",
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
DNSName: "rg1.k8s.example",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
},
|
||||
{
|
||||
DNSName: "rg1.namespace1.example",
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
DNSName: "rg1.namespace1.example",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -341,8 +352,9 @@ func TestRouteGroupsEndpoints(t *testing.T) {
|
||||
},
|
||||
want: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "rg1.namespace1.example",
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
DNSName: "rg1.namespace1.example",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -370,8 +382,9 @@ func TestRouteGroupsEndpoints(t *testing.T) {
|
||||
},
|
||||
want: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "rg1.k8s.example",
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
DNSName: "rg1.k8s.example",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -400,9 +413,10 @@ func TestRouteGroupsEndpoints(t *testing.T) {
|
||||
},
|
||||
want: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "rg1.k8s.example",
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
RecordTTL: endpoint.TTL(2189),
|
||||
DNSName: "rg1.k8s.example",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
RecordTTL: endpoint.TTL(2189),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -430,12 +444,14 @@ func TestRouteGroupsEndpoints(t *testing.T) {
|
||||
},
|
||||
want: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "rg1.k8s.example",
|
||||
Targets: endpoint.Targets([]string{"1.5.1.4"}),
|
||||
DNSName: "rg1.k8s.example",
|
||||
RecordType: endpoint.RecordTypeA,
|
||||
Targets: endpoint.Targets([]string{"1.5.1.4"}),
|
||||
},
|
||||
{
|
||||
DNSName: "rg1.k8s.example",
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
DNSName: "rg1.k8s.example",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -495,20 +511,24 @@ func TestRouteGroupsEndpoints(t *testing.T) {
|
||||
},
|
||||
want: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "rg1.k8s.example",
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
DNSName: "rg1.k8s.example",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
},
|
||||
{
|
||||
DNSName: "rg2.k8s.example",
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
DNSName: "rg2.k8s.example",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
},
|
||||
{
|
||||
DNSName: "rg3.k8s.example",
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
DNSName: "rg3.k8s.example",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
},
|
||||
{
|
||||
DNSName: "rg.k8s.example",
|
||||
Targets: endpoint.Targets([]string{"lb2.example.org"}),
|
||||
DNSName: "rg.k8s.example",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets([]string{"lb2.example.org"}),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -575,8 +595,9 @@ func TestRouteGroupsEndpoints(t *testing.T) {
|
||||
},
|
||||
want: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "rg1.k8s.example",
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
DNSName: "rg1.k8s.example",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -643,12 +664,14 @@ func TestRouteGroupsEndpoints(t *testing.T) {
|
||||
},
|
||||
want: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "rg1.k8s.example",
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
DNSName: "rg1.k8s.example",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
},
|
||||
{
|
||||
DNSName: "rg2.k8s.example",
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
DNSName: "rg2.k8s.example",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -701,12 +724,14 @@ func TestRouteGroupsEndpoints(t *testing.T) {
|
||||
},
|
||||
want: []*endpoint.Endpoint{
|
||||
{
|
||||
DNSName: "rg1.k8s.example",
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
DNSName: "rg1.k8s.example",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
},
|
||||
{
|
||||
DNSName: "rg3.k8s.example",
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
DNSName: "rg3.k8s.example",
|
||||
RecordType: endpoint.RecordTypeCNAME,
|
||||
Targets: endpoint.Targets([]string{"lb.example.org"}),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user