getExecutor gets the node by the name it matches within the runner config
(node string)
| 71 | |
| 72 | // getExecutor gets the node by the name it matches within the runner config |
| 73 | func (r *Runner) getExecutor(node string) Executor { |
| 74 | for _, n := range r.Nodes { |
| 75 | if n.Name == node { |
| 76 | switch n.Type { |
| 77 | case "ssh": |
| 78 | return NewSSHExecutor(n.Addr, n.User, WithIdentityFile(n.IdentityFile), WithPassword(n.Pass)) |
| 79 | case "local", "": |
| 80 | return NewLocalExecutor() |
| 81 | case "docker": |
| 82 | log.Println("Use docker executor") |
| 83 | return DockerExecutor{ |
| 84 | Image: n.Image, |
| 85 | Privileged: n.Privileged, |
| 86 | ExecUser: n.DockerExecUser, |
| 87 | RegistryPass: n.Pass, |
| 88 | RegistryUser: n.User, |
| 89 | } |
| 90 | default: |
| 91 | log.Fatal(fmt.Sprintf("Node type %s not found for node %s", n.Type, n.Name)) |
| 92 | } |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | log.Fatal(fmt.Sprintf("Node %s not found", node)) |
| 97 | return NewLocalExecutor() |
| 98 | } |
| 99 | |
| 100 | func executeRetryInterval(t TestCase) { |
| 101 | if t.Command.GetRetries() > 1 && t.Command.Interval != "" { |