From 5ebe819d8a34d3c1fb78c82c52ff437d36520a39 Mon Sep 17 00:00:00 2001 From: Masaki Muranaka Date: Sun, 4 Aug 2019 15:14:54 +0900 Subject: [PATCH] Ignore nodes that have no ProviderID. (kubernetes#2236) Signed-off-by: Masaki Muranaka --- .../cloudprovider/azure/azure_cloud_provider.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cluster-autoscaler/cloudprovider/azure/azure_cloud_provider.go b/cluster-autoscaler/cloudprovider/azure/azure_cloud_provider.go index 45e75cf5c2d5..896f9e004985 100644 --- a/cluster-autoscaler/cloudprovider/azure/azure_cloud_provider.go +++ b/cluster-autoscaler/cloudprovider/azure/azure_cloud_provider.go @@ -71,6 +71,10 @@ func (azure *AzureCloudProvider) NodeGroups() []cloudprovider.NodeGroup { // NodeGroupForNode returns the node group for the given node. func (azure *AzureCloudProvider) NodeGroupForNode(node *apiv1.Node) (cloudprovider.NodeGroup, error) { + if node.Spec.ProviderID == "" { + glog.V(6).Infof("Skipping to search for node group for the node '%s'. Because doesn't have spec.ProviderID.\n", node.ObjectMeta.Name) + return nil, nil + } glog.V(6).Infof("Searching for node group for the node: %s\n", node.Spec.ProviderID) ref := &azureRef{ Name: node.Spec.ProviderID,