mirror of
https://github.com/rancher/rke.git
synced 2025-07-31 22:56:19 +00:00
Remove insecure port from kube-api Use cluster.yml config Pass config dir to cluster up/remove
22 lines
502 B
Go
22 lines
502 B
Go
package hosts
|
|
|
|
import (
|
|
"fmt"
|
|
"net"
|
|
)
|
|
|
|
func LocalHealthcheckFactory(h *Host) (func(network, address string) (net.Conn, error), error) {
|
|
dialer := &dialer{
|
|
host: h,
|
|
}
|
|
return dialer.DialHealthcheckLocally, nil
|
|
}
|
|
|
|
func (d *dialer) DialHealthcheckLocally(network, addr string) (net.Conn, error) {
|
|
conn, err := net.Dial("tcp", fmt.Sprintf("localhost:%d", d.host.LocalConnPort))
|
|
if err != nil {
|
|
return nil, fmt.Errorf("Failed to dial address [%s]: %v", d.host.Address, err)
|
|
}
|
|
return conn, err
|
|
}
|