From 09e30a6a639209814608b660311c6be525a3b8ea Mon Sep 17 00:00:00 2001 From: Daniel Smith Date: Wed, 14 Jan 2015 17:38:31 -0800 Subject: [PATCH] log on health checks --- pkg/registry/minion/healthy_registry.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkg/registry/minion/healthy_registry.go b/pkg/registry/minion/healthy_registry.go index 3524413ee3..a6d32607e0 100644 --- a/pkg/registry/minion/healthy_registry.go +++ b/pkg/registry/minion/healthy_registry.go @@ -26,6 +26,8 @@ import ( "github.com/GoogleCloudPlatform/kubernetes/pkg/labels" "github.com/GoogleCloudPlatform/kubernetes/pkg/util" "github.com/GoogleCloudPlatform/kubernetes/pkg/watch" + + "github.com/golang/glog" ) type HealthyRegistry struct { @@ -108,12 +110,16 @@ func (r *HealthyRegistry) checkMinion(node *api.Node) *api.Node { // This is called to fill the cache. func (r *HealthyRegistry) doCheck(key string) util.T { + var nodeStatus api.NodeConditionStatus switch status, err := r.client.HealthCheck(key); { 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: - return api.ConditionNone + nodeStatus = api.ConditionNone default: - return api.ConditionFull + nodeStatus = api.ConditionFull } + glog.V(3).Infof("HealthyRegistry: node %q status was %q", key, nodeStatus) + return nodeStatus }