Browse code

Increase max recv gRPC message size for nodes and secrets

Increases the max recieved gRPC message size for Node and Secret list
operations. This has already been done for the other swarm types, but
was not done for these.

Signed-off-by: Drew Erny <drew.erny@docker.com>
(cherry picked from commit a0903e1fa3eca32065c7dbfda8d1e0879cbfbb8f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Drew Erny authored on 2019/06/04 01:33:01
Showing 2 changed files
... ...
@@ -8,6 +8,7 @@ import (
8 8
 	"github.com/docker/docker/daemon/cluster/convert"
9 9
 	"github.com/docker/docker/errdefs"
10 10
 	swarmapi "github.com/docker/swarmkit/api"
11
+	"google.golang.org/grpc"
11 12
 )
12 13
 
13 14
 // GetNodes returns a list of all nodes known to a cluster.
... ...
@@ -30,7 +31,9 @@ func (c *Cluster) GetNodes(options apitypes.NodeListOptions) ([]types.Node, erro
30 30
 
31 31
 	r, err := state.controlClient.ListNodes(
32 32
 		ctx,
33
-		&swarmapi.ListNodesRequest{Filters: filters})
33
+		&swarmapi.ListNodesRequest{Filters: filters},
34
+		grpc.MaxCallRecvMsgSize(defaultRecvSizeForListResponse),
35
+	)
34 36
 	if err != nil {
35 37
 		return nil, err
36 38
 	}
... ...
@@ -7,6 +7,7 @@ import (
7 7
 	types "github.com/docker/docker/api/types/swarm"
8 8
 	"github.com/docker/docker/daemon/cluster/convert"
9 9
 	swarmapi "github.com/docker/swarmkit/api"
10
+	"google.golang.org/grpc"
10 11
 )
11 12
 
12 13
 // GetSecret returns a secret from a managed swarm cluster
... ...
@@ -44,7 +45,9 @@ func (c *Cluster) GetSecrets(options apitypes.SecretListOptions) ([]types.Secret
44 44
 	defer cancel()
45 45
 
46 46
 	r, err := state.controlClient.ListSecrets(ctx,
47
-		&swarmapi.ListSecretsRequest{Filters: filters})
47
+		&swarmapi.ListSecretsRequest{Filters: filters},
48
+		grpc.MaxCallRecvMsgSize(defaultRecvSizeForListResponse),
49
+	)
48 50
 	if err != nil {
49 51
 		return nil, err
50 52
 	}