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>
... | ... |
@@ -58,6 +58,7 @@ import ( |
58 | 58 |
swarmnode "github.com/docker/swarmkit/node" |
59 | 59 |
"github.com/pkg/errors" |
60 | 60 |
"github.com/sirupsen/logrus" |
61 |
+ "google.golang.org/grpc" |
|
61 | 62 |
) |
62 | 63 |
|
63 | 64 |
const swarmDirName = "swarm" |
... | ... |
@@ -399,7 +400,10 @@ func (c *Cluster) Cleanup() { |
399 | 399 |
func managerStats(client swarmapi.ControlClient, currentNodeID string) (current bool, reachable int, unreachable int, err error) { |
400 | 400 |
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) |
401 | 401 |
defer cancel() |
402 |
- nodes, err := client.ListNodes(ctx, &swarmapi.ListNodesRequest{}) |
|
402 |
+ nodes, err := client.ListNodes( |
|
403 |
+ ctx, &swarmapi.ListNodesRequest{}, |
|
404 |
+ grpc.MaxCallRecvMsgSize(defaultRecvSizeForListResponse), |
|
405 |
+ ) |
|
403 | 406 |
if err != nil { |
404 | 407 |
return false, 0, 0, err |
405 | 408 |
} |
... | ... |
@@ -19,6 +19,7 @@ import ( |
19 | 19 |
swarmnode "github.com/docker/swarmkit/node" |
20 | 20 |
"github.com/pkg/errors" |
21 | 21 |
"github.com/sirupsen/logrus" |
22 |
+ "google.golang.org/grpc" |
|
22 | 23 |
) |
23 | 24 |
|
24 | 25 |
// Init initializes new cluster from user provided request. |
... | ... |
@@ -449,7 +450,10 @@ func (c *Cluster) Info() types.Info { |
449 | 449 |
|
450 | 450 |
info.Cluster = &swarm.ClusterInfo |
451 | 451 |
|
452 |
- if r, err := state.controlClient.ListNodes(ctx, &swarmapi.ListNodesRequest{}); err != nil { |
|
452 |
+ if r, err := state.controlClient.ListNodes( |
|
453 |
+ ctx, &swarmapi.ListNodesRequest{}, |
|
454 |
+ grpc.MaxCallRecvMsgSize(defaultRecvSizeForListResponse), |
|
455 |
+ ); err != nil { |
|
453 | 456 |
info.Error = err.Error() |
454 | 457 |
} else { |
455 | 458 |
info.Nodes = len(r.Nodes) |