Skip to content

Commit

Permalink
Fixes (#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
reshke authored Apr 5, 2024
1 parent 75c910a commit f50dc07
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion balancer/provider/balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func NewBalancer() (*BalancerImpl, error) {
threshold[i] = configThresholds[i]
threshold[metricsCount+i] = configThresholds[i]
}
conn, err := grpc.Dial(config.BalancerConfig().CoordinatorAddress, grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.NewClient(config.BalancerConfig().CoordinatorAddress, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/coordctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var (

func DialCoordinator(r *topology.Router) (*grpc.ClientConn, error) {
// TODO: add creds, remove WithInsecure
return grpc.Dial(r.Address, grpc.WithInsecure()) //nolint:all
return grpc.NewClient(r.Address, grpc.WithInsecure()) //nolint:all
}

var rootCmd = &cobra.Command{
Expand Down
2 changes: 1 addition & 1 deletion coordinator/provider/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func DialRouter(r *topology.Router) (*grpc.ClientConn, error) {
Str("router-id", r.ID).
Msg("dialing router")
// TODO: add creds
return grpc.Dial(r.Address, grpc.WithInsecure()) //nolint:all
return grpc.NewClient(r.Address, grpc.WithInsecure()) //nolint:all
}

type CoordinatorClient interface {
Expand Down
4 changes: 2 additions & 2 deletions router/console/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (l *LocalInstanceConsole) proxyProc(ctx context.Context, tstmt spqrparser.S
if err != nil {
return err
}
conn, err := grpc.Dial(coordAddr, grpc.WithInsecure()) //nolint:all
conn, err := grpc.NewClient(coordAddr, grpc.WithInsecure()) //nolint:all
if err != nil {
return err
}
Expand All @@ -107,7 +107,7 @@ func (l *LocalInstanceConsole) proxyProc(ctx context.Context, tstmt spqrparser.S
if err != nil {
return err
}
conn, err := grpc.Dial(coordAddr, grpc.WithInsecure()) //nolint:all
conn, err := grpc.NewClient(coordAddr, grpc.WithInsecure()) //nolint:all
if err != nil {
return err
}
Expand Down
4 changes: 3 additions & 1 deletion test/feature/spqr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -553,10 +553,12 @@ func (tctx *testContext) stepHostIsStopped(service string) error {
return false
}
addr := strings.Split(output, "\n")[1]
conn, err := grpc.Dial(addr, grpc.WithInsecure()) //nolint:all
conn, err := grpc.NewClient(addr, grpc.WithInsecure()) //nolint:all
if err != nil {
return false
}
defer conn.Close()

client := protos.NewRouterServiceClient(conn)
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
Expand Down

0 comments on commit f50dc07

Please sign in to comment.