Skip to content

Commit

Permalink
Merge pull request #927 from qiutongs/fix-grpc-size
Browse files Browse the repository at this point in the history
Use same grpc max message size as Kubelet
  • Loading branch information
k8s-ci-robot authored May 10, 2022
2 parents d82b602 + 132b50d commit 29d1f6f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/crictl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ import (

const (
defaultTimeout = 2 * time.Second
// use same message size as cri remote client in kubelet.
maxMsgSize = 1024 * 1024 * 16
)

var (
Expand Down Expand Up @@ -115,7 +117,7 @@ func getConnection(endPoints []string) (*grpc.ClientConn, error) {
logrus.Error(err)
continue
}
conn, err = grpc.Dial(addr, grpc.WithInsecure(), grpc.WithBlock(), grpc.WithTimeout(Timeout), grpc.WithContextDialer(dialer))
conn, err = grpc.Dial(addr, grpc.WithInsecure(), grpc.WithBlock(), grpc.WithTimeout(Timeout), grpc.WithContextDialer(dialer), grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(maxMsgSize)))
if err != nil {
errMsg := errors.Wrapf(err, "connect endpoint '%s', make sure you are running as root and the endpoint has been started", endPoint)
if indx == endPointsLen-1 {
Expand Down

0 comments on commit 29d1f6f

Please sign in to comment.