mirror of
https://github.com/docker/cli.git
synced 2026-08-28 02:24:15 -05:00
Fix more grpc list message sizes
There are a few more places, apparently, that List operations against Swarm exist, besides just in the List methods. This increases the max received message size in those places. Signed-off-by: Drew Erny <drew.erny@docker.com> (cherry picked from commit a84a78e9767d82abd4744dad9ce4fb3f64141a8f) Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: 41da428d065ab15fd2d8aba1fbd0d0056136a43b Component: engine
This commit is contained in:
committed by
Sebastiaan van Stijn
parent
33b4c4329e
commit
66b09eef75
@@ -58,6 +58,7 @@ import (
|
||||
swarmnode "github.com/docker/swarmkit/node"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
const swarmDirName = "swarm"
|
||||
@@ -399,7 +400,10 @@ func (c *Cluster) Cleanup() {
|
||||
func managerStats(client swarmapi.ControlClient, currentNodeID string) (current bool, reachable int, unreachable int, err error) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancel()
|
||||
nodes, err := client.ListNodes(ctx, &swarmapi.ListNodesRequest{})
|
||||
nodes, err := client.ListNodes(
|
||||
ctx, &swarmapi.ListNodesRequest{},
|
||||
grpc.MaxCallRecvMsgSize(defaultRecvSizeForListResponse),
|
||||
)
|
||||
if err != nil {
|
||||
return false, 0, 0, err
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import (
|
||||
swarmnode "github.com/docker/swarmkit/node"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
// Init initializes new cluster from user provided request.
|
||||
@@ -442,7 +443,10 @@ func (c *Cluster) Info() types.Info {
|
||||
|
||||
info.Cluster = &swarm.ClusterInfo
|
||||
|
||||
if r, err := state.controlClient.ListNodes(ctx, &swarmapi.ListNodesRequest{}); err != nil {
|
||||
if r, err := state.controlClient.ListNodes(
|
||||
ctx, &swarmapi.ListNodesRequest{},
|
||||
grpc.MaxCallRecvMsgSize(defaultRecvSizeForListResponse),
|
||||
); err != nil {
|
||||
info.Error = err.Error()
|
||||
} else {
|
||||
info.Nodes = len(r.Nodes)
|
||||
|
||||
Reference in New Issue
Block a user