Skip to content

Commit

Permalink
Merge pull request #46 from KnutZuidema/fix/deprecated-resolver-addre…
Browse files Browse the repository at this point in the history
…ss-type

fix: remove usage of deprecated Type attribute of resolver.Address
  • Loading branch information
sercand authored Sep 19, 2023
2 parents 8092c78 + 4a71cf9 commit 74dbfd0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ func (k *kResolver) makeAddresses(e Endpoints) ([]resolver.Address, string) {

for _, address := range subset.Addresses {
newAddrs = append(newAddrs, resolver.Address{
Type: resolver.Backend,
Addr: net.JoinHostPort(address.IP, port),
ServerName: fmt.Sprintf("%s.%s", k.target.serviceName, k.target.serviceNamespace),
Metadata: nil,
Expand Down
7 changes: 3 additions & 4 deletions builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ func (fc *fakeConn) NewAddress(addresses []resolver.Address) {
fc.found = append(fc.found, a.Addr)
fmt.Printf("%d, address: %s\n", i, a.Addr)
fmt.Printf("%d, servername: %s\n", i, a.ServerName)
fmt.Printf("%d, type: %+v\n", i, a.Type)
}
fc.cmp <- struct{}{}
}
Expand All @@ -63,9 +62,9 @@ func TestBuilder(t *testing.T) {
if len(fc.found) == 0 {
t.Fatal("could not found endpoints")
}
// fmt.Printf("ResolveNow \n")
// rs.ResolveNow(resolver.ResolveNowOptions{})
// <-fc.cmp
// fmt.Printf("ResolveNow \n")
// rs.ResolveNow(resolver.ResolveNowOptions{})
// <-fc.cmp

}

Expand Down

0 comments on commit 74dbfd0

Please sign in to comment.