mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-16 22:53:22 +00:00
Merge pull request #3695 from mikedanese/ready
refactor pkg/health into more reusable pkg/probe
This commit is contained in:
@@ -22,8 +22,8 @@ import (
|
||||
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/health"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/probe"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
|
||||
|
||||
@@ -115,7 +115,7 @@ func (r *HealthyRegistry) doCheck(key string) util.T {
|
||||
case err != nil:
|
||||
glog.V(2).Infof("HealthyRegistry: node %q health check error: %v", key, err)
|
||||
nodeStatus = api.ConditionUnknown
|
||||
case status == health.Unhealthy:
|
||||
case status == probe.Failure:
|
||||
nodeStatus = api.ConditionNone
|
||||
default:
|
||||
nodeStatus = api.ConditionFull
|
||||
|
@@ -22,15 +22,15 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/health"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/probe"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/registrytest"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
||||
)
|
||||
|
||||
type alwaysYes struct{}
|
||||
|
||||
func (alwaysYes) HealthCheck(host string) (health.Status, error) {
|
||||
return health.Healthy, nil
|
||||
func (alwaysYes) HealthCheck(host string) (probe.Status, error) {
|
||||
return probe.Success, nil
|
||||
}
|
||||
|
||||
func TestBasicDelegation(t *testing.T) {
|
||||
@@ -75,11 +75,11 @@ type notMinion struct {
|
||||
minion string
|
||||
}
|
||||
|
||||
func (n *notMinion) HealthCheck(host string) (health.Status, error) {
|
||||
func (n *notMinion) HealthCheck(host string) (probe.Status, error) {
|
||||
if host != n.minion {
|
||||
return health.Healthy, nil
|
||||
return probe.Success, nil
|
||||
} else {
|
||||
return health.Unhealthy, nil
|
||||
return probe.Failure, nil
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user