mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
59e55dcdd0
goimports -w \ -- "./integration-cli/daemon" "./pkg/discovery" "./pkg/discovery/file" "./pkg/discovery/kv" "./pkg/discovery/memory" "./pkg/discovery/nodes" "./integration-cli" \ && \ gofmt -w -s \ -- "./integration-cli/daemon" "./pkg/discovery" "./pkg/discovery/file" "./pkg/discovery/kv" "./pkg/discovery/memory" "./pkg/discovery/nodes" "./integration-cli" Signed-off-by: Tibor Vass <tibor@docker.com>
24 lines
581 B
Go
24 lines
581 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/docker/docker/integration-cli/daemon"
|
|
)
|
|
|
|
func (s *DockerSwarmSuite) getDaemon(c *testing.T, nodeID string) *daemon.Daemon {
|
|
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 *testing.T, id string, args ...string) (string, error) {
|
|
return s.getDaemon(c, id).Cmd(args...)
|
|
}
|