From 4b79572f8eae92afcf0ddb794275024c2dac15b2 Mon Sep 17 00:00:00 2001 From: hzliangmingqiang Date: Tue, 29 Sep 2015 14:43:04 +0800 Subject: [PATCH] eliminate misleading code --- pkg/controller/node/nodecontroller.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/controller/node/nodecontroller.go b/pkg/controller/node/nodecontroller.go index 9ba1524e1a3..1ed075e0faf 100644 --- a/pkg/controller/node/nodecontroller.go +++ b/pkg/controller/node/nodecontroller.go @@ -457,7 +457,10 @@ func (nc *NodeController) tryUpdateNodeStatus(node *api.Node) (time.Duration, ap // - if 'LastProbeTime' have gone back in time its probably an error, currently we ignore it, // - currently only correct Ready State transition outside of Node Controller is marking it ready by Kubelet, we don't check // if that's the case, but it does not seem necessary. - savedCondition := nc.getCondition(&savedNodeStatus.status, api.NodeReady) + var savedCondition *api.NodeCondition + if found { + savedCondition = nc.getCondition(&savedNodeStatus.status, api.NodeReady) + } observedCondition := nc.getCondition(&node.Status, api.NodeReady) if !found { glog.Warningf("Missing timestamp for Node %s. Assuming now as a timestamp.", node.Name)