From 73d38f19392422f40678fff39d8b6601cb64f57b 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 1503603d1b02..6f67491a30d2 100644 --- a/cluster-autoscaler/cloudprovider/azure/azure_cloud_provider.go +++ b/cluster-autoscaler/cloudprovider/azure/azure_cloud_provider.go @@ -91,6 +91,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 == "" { + klog.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 + } klog.V(6).Infof("Searching for node group for the node: %s\n", node.Spec.ProviderID) ref := &azureRef{ Name: node.Spec.ProviderID,