github.com/sams1990/dockerrepo@v17.12.1-ce-rc2+incompatible/integration-cli/daemon_swarm_hack_test.go (about)

     1  package main
     2  
     3  import (
     4  	"github.com/docker/docker/integration-cli/daemon"
     5  	"github.com/go-check/check"
     6  )
     7  
     8  func (s *DockerSwarmSuite) getDaemon(c *check.C, nodeID string) *daemon.Swarm {
     9  	s.daemonsLock.Lock()
    10  	defer s.daemonsLock.Unlock()
    11  	for _, d := range s.daemons {
    12  		if d.NodeID == nodeID {
    13  			return d
    14  		}
    15  	}
    16  	c.Fatalf("could not find node with id: %s", nodeID)
    17  	return nil
    18  }
    19  
    20  // nodeCmd executes a command on a given node via the normal docker socket
    21  func (s *DockerSwarmSuite) nodeCmd(c *check.C, id string, args ...string) (string, error) {
    22  	return s.getDaemon(c, id).Cmd(args...)
    23  }