mirror of
				https://github.com/moby/moby.git
				synced 2022-11-09 12:21:53 -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 a84a78e976)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
			
			
This commit is contained in:
		
							parent
							
								
									37d9901e0f
								
							
						
					
					
						commit
						3fd0be03f0
					
				
					 2 changed files with 10 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -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.
 | 
			
		||||
| 
						 | 
				
			
			@ -449,7 +450,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)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue