Files
moby/integration-cli/daemon_swarm_hack_test.go
Matthieu MOREL 9b5d8cd186 fix thelper linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-05 21:42:05 +00:00

25 lines
581 B
Go

package main
import (
"testing"
"github.com/docker/docker/integration-cli/daemon"
)
func (s *DockerSwarmSuite) getDaemon(t *testing.T, nodeID string) *daemon.Daemon {
s.daemonsLock.Lock()
defer s.daemonsLock.Unlock()
for _, d := range s.daemons {
if d.NodeID() == nodeID {
return d
}
}
t.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(t *testing.T, id string, args ...string) (string, error) {
return s.getDaemon(t, id).Cmd(args...)
}