mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 12:41:58 +00:00
refactor pkg/probe ProbeRunners to interfaces and move global probers into kubelet field for testability
This commit is contained in:
@@ -27,12 +27,16 @@ import (
|
||||
)
|
||||
|
||||
func New() TCPProber {
|
||||
return TCPProber{}
|
||||
return tcpProber{}
|
||||
}
|
||||
|
||||
type TCPProber struct{}
|
||||
type TCPProber interface {
|
||||
Probe(host string, port int, timeout time.Duration) (probe.Result, error)
|
||||
}
|
||||
|
||||
func (pr TCPProber) Probe(host string, port int, timeout time.Duration) (probe.Result, error) {
|
||||
type tcpProber struct{}
|
||||
|
||||
func (pr tcpProber) Probe(host string, port int, timeout time.Duration) (probe.Result, error) {
|
||||
return DoTCPProbe(net.JoinHostPort(host, strconv.Itoa(port)), timeout)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user