Merge pull request #3501 from lavalamp/fix2

log on health checks
pull/6/head
Dawn Chen 2015-01-15 09:16:15 -08:00
commit 8509618311
1 changed files with 9 additions and 3 deletions

View File

@ -26,6 +26,8 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels" "github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util" "github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/GoogleCloudPlatform/kubernetes/pkg/watch" "github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
"github.com/golang/glog"
) )
type HealthyRegistry struct { type HealthyRegistry struct {
@ -108,12 +110,16 @@ func (r *HealthyRegistry) checkMinion(node *api.Node) *api.Node {
// This is called to fill the cache. // This is called to fill the cache.
func (r *HealthyRegistry) doCheck(key string) util.T { func (r *HealthyRegistry) doCheck(key string) util.T {
var nodeStatus api.NodeConditionStatus
switch status, err := r.client.HealthCheck(key); { switch status, err := r.client.HealthCheck(key); {
case err != nil: case err != nil:
return api.ConditionUnknown glog.V(2).Infof("HealthyRegistry: node %q health check error: %v", key, err)
nodeStatus = api.ConditionUnknown
case status == health.Unhealthy: case status == health.Unhealthy:
return api.ConditionNone nodeStatus = api.ConditionNone
default: default:
return api.ConditionFull nodeStatus = api.ConditionFull
} }
glog.V(3).Infof("HealthyRegistry: node %q status was %q", key, nodeStatus)
return nodeStatus
} }