mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-12 12:48:51 +00:00
rename probe.Status to probe.Result.
This commit is contained in:
@@ -38,7 +38,7 @@ type HTTPProber struct {
|
||||
}
|
||||
|
||||
// Probe returns a ProbeRunner capable of running an http check.
|
||||
func (pr *HTTPProber) Probe(host string, port int, path string, timeout time.Duration) (probe.Status, error) {
|
||||
func (pr *HTTPProber) Probe(host string, port int, path string, timeout time.Duration) (probe.Result, error) {
|
||||
return DoHTTPProbe(formatURL(host, port, path), &http.Client{Timeout: timeout, Transport: pr.transport})
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ type HTTPGetInterface interface {
|
||||
// If the HTTP response code is successful (i.e. 400 > code >= 200), it returns Success.
|
||||
// If the HTTP response code is unsuccessful or HTTP communication fails, it returns Failure.
|
||||
// This is exported because some other packages may want to do direct HTTP probes.
|
||||
func DoHTTPProbe(url string, client HTTPGetInterface) (probe.Status, error) {
|
||||
func DoHTTPProbe(url string, client HTTPGetInterface) (probe.Result, error) {
|
||||
res, err := client.Get(url)
|
||||
if err != nil {
|
||||
glog.V(1).Infof("HTTP probe error: %v", err)
|
||||
|
@@ -54,7 +54,7 @@ func TestHTTPProbeChecker(t *testing.T) {
|
||||
prober := New()
|
||||
testCases := []struct {
|
||||
handler func(w http.ResponseWriter)
|
||||
health probe.Status
|
||||
health probe.Result
|
||||
}{
|
||||
// The probe will be filled in below. This is primarily testing that an HTTP GET happens.
|
||||
{handleReq(http.StatusOK), probe.Success},
|
||||
|
Reference in New Issue
Block a user