mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 20:50:24 +00:00
rename probe.Status to probe.Result.
This commit is contained in:
@@ -32,7 +32,7 @@ func New() TCPProber {
|
||||
|
||||
type TCPProber struct{}
|
||||
|
||||
func (pr TCPProber) Probe(host string, port int, timeout time.Duration) (probe.Status, error) {
|
||||
func (pr TCPProber) Probe(host string, port int, timeout time.Duration) (probe.Result, error) {
|
||||
return DoTCPProbe(net.JoinHostPort(host, strconv.Itoa(port)), timeout)
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ func (pr TCPProber) Probe(host string, port int, timeout time.Duration) (probe.S
|
||||
// If the socket can be opened, it returns Success
|
||||
// If the socket fails to open, it returns Failure.
|
||||
// This is exported because some other packages may want to do direct TCP probes.
|
||||
func DoTCPProbe(addr string, timeout time.Duration) (probe.Status, error) {
|
||||
func DoTCPProbe(addr string, timeout time.Duration) (probe.Result, error) {
|
||||
conn, err := net.DialTimeout("tcp", addr, timeout)
|
||||
if err != nil {
|
||||
return probe.Failure, nil
|
||||
|
@@ -31,7 +31,7 @@ import (
|
||||
func TestTcpHealthChecker(t *testing.T) {
|
||||
prober := New()
|
||||
tests := []struct {
|
||||
expectedStatus probe.Status
|
||||
expectedStatus probe.Result
|
||||
usePort bool
|
||||
expectError bool
|
||||
}{
|
||||
|
Reference in New Issue
Block a user