Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettladley committed Oct 23, 2024
1 parent d2a2968 commit 2a6c0e0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/agent/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func client(t *testing.T, agent *agent.Agent, tlsConfig *tls.Config) api.LogClie
opts := []grpc.DialOption{grpc.WithTransportCredentials(tlsCreds)}
rpcAddr, err := agent.Config.RPCAddr()
require.NoError(t, err)
conn, err := grpc.Dial(fmt.Sprintf(
conn, err := grpc.NewClient(fmt.Sprintf(
"%s:///%s",
loadbalance.Name,
rpcAddr,
Expand Down
9 changes: 7 additions & 2 deletions internal/loadbalance/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,15 @@ func (r *Resolver) ResolveNow(resolver.ResolveNowOptions) {
),
})
}
r.clientConn.UpdateState(resolver.State{
if err := r.clientConn.UpdateState(resolver.State{
Addresses: addrs,
ServiceConfig: r.serviceConfig,
})
}); err != nil {
r.logger.Error(
"failed to update state",
zap.Error(err),
)
}
}

func (r *Resolver) Close() {
Expand Down
7 changes: 6 additions & 1 deletion internal/loadbalance/resolver_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package loadbalance_test

import (
"fmt"
"net"
"net/url"
"testing"
Expand Down Expand Up @@ -37,7 +38,11 @@ func TestResolver(t *testing.T) {
}, grpc.Creds(serverCreds))
require.NoError(t, err)

go srv.Serve(l)
go func() {
if err := srv.Serve(l); err != nil {
panic(fmt.Errorf("failed to serve: %w", err))
}
}()

conn := &clientConn{}
tlsConfig, err = config.SetupTLSConfig(config.TLSConfig{
Expand Down

0 comments on commit 2a6c0e0

Please sign in to comment.