summaryrefslogtreecommitdiff
path: root/internal/clients
diff options
context:
space:
mode:
Diffstat (limited to 'internal/clients')
-rw-r--r--internal/clients/baseclient.go6
-rw-r--r--internal/clients/remote/connection.go4
2 files changed, 5 insertions, 5 deletions
diff --git a/internal/clients/baseclient.go b/internal/clients/baseclient.go
index 725910a..75da187 100644
--- a/internal/clients/baseclient.go
+++ b/internal/clients/baseclient.go
@@ -27,7 +27,7 @@ type baseClient struct {
// SSH auth methods to use to connect to the remote servers.
sshAuthMethods []gossh.AuthMethod
// To deal with SSH host keys
- hostKeyCallback *client.HostKeyCallback
+ hostKeyCallback client.HostKeyCallback
// Throttle how fast we initiate SSH connections concurrently
throttleCh chan struct{}
// Retry connection upon failure?
@@ -40,7 +40,7 @@ func (c *baseClient) init(maker maker) {
logger.Info("Initiating base client")
c.maker = maker
- c.sshAuthMethods, c.hostKeyCallback = client.InitSSHAuthMethods(c.Args, c.throttleCh)
+ c.sshAuthMethods, c.hostKeyCallback = client.InitSSHAuthMethods(c.Args.SSHAuthMethods, c.Args.SSHHostKeyCallback, c.Args.TrustAllHosts, c.throttleCh)
discoveryService := discovery.New(c.Discovery, c.ServersStr, discovery.Shuffle)
@@ -107,7 +107,7 @@ func (c *baseClient) start(ctx context.Context, active chan struct{}, i int, con
}
}
-func (c *baseClient) makeConnection(server string, sshAuthMethods []gossh.AuthMethod, hostKeyCallback *client.HostKeyCallback) *remote.Connection {
+func (c *baseClient) makeConnection(server string, sshAuthMethods []gossh.AuthMethod, hostKeyCallback client.HostKeyCallback) *remote.Connection {
conn := remote.NewConnection(server, c.UserName, sshAuthMethods, hostKeyCallback)
conn.Handler = c.maker.makeHandler(server)
conn.Commands = c.maker.makeCommands()
diff --git a/internal/clients/remote/connection.go b/internal/clients/remote/connection.go
index 71639b1..f95c6a6 100644
--- a/internal/clients/remote/connection.go
+++ b/internal/clients/remote/connection.go
@@ -33,11 +33,11 @@ type Connection struct {
// Is it a persistent connection or a one-off?
isOneOff bool
// To deal with SSH server host keys
- hostKeyCallback *client.HostKeyCallback
+ hostKeyCallback client.HostKeyCallback
}
// NewConnection returns a new connection.
-func NewConnection(server string, userName string, authMethods []ssh.AuthMethod, hostKeyCallback *client.HostKeyCallback) *Connection {
+func NewConnection(server string, userName string, authMethods []ssh.AuthMethod, hostKeyCallback client.HostKeyCallback) *Connection {
logger.Debug(server, "Creating new connection")
c := Connection{