Skip to content

Commit

Permalink
hubble: Replace deprecated grpc.DialContext by grpc.NewClient
Browse files Browse the repository at this point in the history
This is to make the linting happy. Kindly note that we don't really need
dial context as per the below.

> NewClient creates a new gRPC "channel" for the target URI provided.  No I/O
> is performed.  Use of the ClientConn for RPCs will automatically cause it to
> connect.  Connect may be used to manually create a connection, but for most
> users this is unnecessary.

Signed-off-by: Tam Mach <tam.mach@cilium.io>
  • Loading branch information
sayboras authored and tklauser committed May 17, 2024
1 parent 3f7cec1 commit 9316d0a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions connectivity/check/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,10 +608,7 @@ func (ct *ConnectivityTest) report() error {
func (ct *ConnectivityTest) enableHubbleClient(ctx context.Context) error {
ct.Log("🔭 Enabling Hubble telescope...")

dialCtx, cancel := context.WithTimeout(ctx, 2*time.Second)
defer cancel()

c, err := grpc.DialContext(dialCtx, ct.params.HubbleServer, grpc.WithTransportCredentials(insecure.NewCredentials()))
c, err := grpc.NewClient(ct.params.HubbleServer, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
return err
}
Expand Down

0 comments on commit 9316d0a

Please sign in to comment.