diff options
| author | Paul Bütow <pbuetow@mimecast.com> | 2020-02-11 13:10:26 +0000 |
|---|---|---|
| committer | Paul Bütow <pbuetow@mimecast.com> | 2020-02-11 13:10:26 +0000 |
| commit | ecf7c86bc2f64068e6256ac1b9738c712a9858e9 (patch) | |
| tree | 1ed536ad81a3c87c21eebd1438792ee91ce969e0 /internal/clients | |
| parent | 410ca88465f065f244f88c1d4089cb0fa4a45799 (diff) | |
more on scheduled jobs and ssh callbacks
Diffstat (limited to 'internal/clients')
| -rw-r--r-- | internal/clients/baseclient.go | 6 | ||||
| -rw-r--r-- | internal/clients/remote/connection.go | 4 |
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{ |
