1
0
mirror of https://github.com/rancher/rke.git synced 2025-05-07 07:47:41 +00:00
rke/hosts/local.go
Bill Maxwell f0d1689889 Use SSH Agent
This defaults to using the SSH Agent or a passwordless key file.
It also refactors the Dialer methods a bit to simplify and decouple
the host object from the dialer.
2018-02-26 16:49:56 -07:00

20 lines
454 B
Go

package hosts
import (
"fmt"
"net"
)
func LocalHealthcheckFactory(h *Host) (func(network, address string) (net.Conn, error), error) {
dialer, err := newDialer(h, "health")
return dialer.DialHealthcheckLocally, err
}
func (d *dialer) DialHealthcheckLocally(network, addr string) (net.Conn, error) {
conn, err := net.Dial(network, addr)
if err != nil {
return nil, fmt.Errorf("Failed to dial address [%s]: %v", addr, err)
}
return conn, err
}