From 91b92eba2fc39935a48d3e504f14e782a6b333be Mon Sep 17 00:00:00 2001 From: deads2k Date: Tue, 10 Mar 2015 14:22:43 -0400 Subject: [PATCH] eliminate wait with no nodes --- pkg/cloudprovider/controller/nodecontroller.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/cloudprovider/controller/nodecontroller.go b/pkg/cloudprovider/controller/nodecontroller.go index b164ddbef7339..9e6709bd23cfb 100644 --- a/pkg/cloudprovider/controller/nodecontroller.go +++ b/pkg/cloudprovider/controller/nodecontroller.go @@ -141,6 +141,10 @@ func (s *NodeController) Run(period time.Duration, syncNodeList, syncNodeStatus // RegisterNodes registers the given list of nodes, it keeps retrying for `retryCount` times. func (s *NodeController) RegisterNodes(nodes *api.NodeList, retryCount int, retryInterval time.Duration) error { + if len(nodes.Items) == 0 { + return nil + } + registered := util.NewStringSet() nodes = s.canonicalizeName(nodes) for i := 0; i < retryCount; i++ {