Skip to content

Commit

Permalink
Fix connection in client.go
Browse files Browse the repository at this point in the history
  • Loading branch information
mugdha-adhav committed Mar 7, 2025
1 parent 7651cfb commit 43e1449
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/cri/client.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cri

import (
"context"
"time"

"google.golang.org/grpc"
Expand All @@ -18,12 +19,14 @@ func NewRemoteImageService(endpoint string, connectionTimeout time.Duration) (cr
return nil, err
}

// Use grpc.Dial with insecure credentials
conn, err := grpc.NewClient(
addr,
ctx, cancel := context.WithTimeout(context.Background(), connectionTimeout)
defer cancel()

conn, err := grpc.DialContext(ctx, addr,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithContextDialer(dialer),
grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(maxMsgSize)),
grpc.WithBlock(),
)

if err != nil {
Expand Down

0 comments on commit 43e1449

Please sign in to comment.