1
0
mirror of https://github.com/rancher/rke.git synced 2025-07-31 22:56:19 +00:00
rke/hosts/local.go
galal-hussein 8685523038 Add local option to deploy/remove kubernetes on local machine
Remove insecure port from kube-api

Use cluster.yml config

Pass config dir to cluster up/remove
2018-01-12 20:46:09 +02:00

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
}