mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-16 06:32:32 +00:00
rename probe.Healthy to probe.Success and renam probe.Unhealthy to probe.Failure.
This commit is contained in:
@@ -57,10 +57,10 @@ func (s *Server) check(client httpGet) (probe.Status, string, error) {
|
||||
return probe.Unknown, string(data), err
|
||||
}
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return probe.Unhealthy, string(data),
|
||||
return probe.Failure, string(data),
|
||||
fmt.Errorf("unhealthy http status code: %d (%s)", resp.StatusCode, resp.Status)
|
||||
}
|
||||
return probe.Healthy, string(data), nil
|
||||
return probe.Success, string(data), nil
|
||||
}
|
||||
|
||||
type ServerStatus struct {
|
||||
|
@@ -59,8 +59,8 @@ func TestValidate(t *testing.T) {
|
||||
expectErr bool
|
||||
}{
|
||||
{fmt.Errorf("test error"), "", probe.Unknown, 500 /*ignored*/, true},
|
||||
{nil, "foo", probe.Healthy, 200, false},
|
||||
{nil, "foo", probe.Unhealthy, 500, true},
|
||||
{nil, "foo", probe.Success, 200, false},
|
||||
{nil, "foo", probe.Failure, 500, true},
|
||||
}
|
||||
|
||||
s := Server{Addr: "foo.com", Port: 8080, Path: "/healthz"}
|
||||
|
Reference in New Issue
Block a user