Skip to content

Commit

Permalink
fix: remove usage of deprecated Type attribute of resolver.Address
Browse files Browse the repository at this point in the history
The type attribute has been removed in more recent versions of gRPC. The usage here is not required and the may be removed.

See: grpc/grpc-go#6451
  • Loading branch information
KnutZuidema committed Sep 19, 2023
1 parent 8092c78 commit 4a71cf9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion builder.go
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
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 4a71cf9

Please sign in to comment.