Skip to content

Commit

Permalink
fix: use current local dns resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
mloiseleur committed Apr 19, 2024
1 parent 9ff2223 commit cbd281f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions source/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ func testServiceSourceNewServiceSource(t *testing.T) {

// testServiceSourceEndpoints tests that various services generate the correct endpoints.
func testServiceSourceEndpoints(t *testing.T) {
exampleDotComIP4, err := net.DefaultResolver.LookupNetIP(context.Background(), "ip4", "example.com")
assert.NoError(t, err)
exampleDotComIP6, err := net.DefaultResolver.LookupNetIP(context.Background(), "ip6", "example.com")
assert.NoError(t, err)

t.Parallel()

for _, tc := range []struct {
Expand Down Expand Up @@ -406,8 +411,8 @@ func testServiceSourceEndpoints(t *testing.T) {
serviceTypesFilter: []string{},
resolveLoadBalancerHostname: true,
expected: []*endpoint.Endpoint{
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{"93.184.215.14"}},
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeAAAA, Targets: endpoint.Targets{"2606:2800:21f:cb07:6820:80da:af6b:8b2c"}},
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeA, Targets: endpoint.Targets{exampleDotComIP4[0].String()}},
{DNSName: "foo.example.org", RecordType: endpoint.RecordTypeAAAA, Targets: endpoint.Targets{exampleDotComIP6[0].String()}},
},
},
{
Expand Down

0 comments on commit cbd281f

Please sign in to comment.