mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
c0d2f7b338
Signed-off-by: Daniel Nephin <dnephin@docker.com>
20 lines
534 B
Go
20 lines
534 B
Go
package main
|
|
|
|
import "github.com/go-check/check"
|
|
|
|
func (s *DockerSwarmSuite) getDaemon(c *check.C, nodeID string) *SwarmDaemon {
|
|
s.daemonsLock.Lock()
|
|
defer s.daemonsLock.Unlock()
|
|
for _, d := range s.daemons {
|
|
if d.NodeID == nodeID {
|
|
return d
|
|
}
|
|
}
|
|
c.Fatalf("could not find node with id: %s", nodeID)
|
|
return nil
|
|
}
|
|
|
|
// nodeCmd executes a command on a given node via the normal docker socket
|
|
func (s *DockerSwarmSuite) nodeCmd(c *check.C, id string, args ...string) (string, error) {
|
|
return s.getDaemon(c, id).Cmd(args...)
|
|
}
|