From 338d3c50bd7ad9c0ac8e6a1d1d768ff6c9b201bf 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 2a112ecd61fc..0ebf8b0a7658 100644 --- a/cluster-autoscaler/cloudprovider/azure/azure_cloud_provider.go +++ b/cluster-autoscaler/cloudprovider/azure/azure_cloud_provider.go @@ -74,6 +74,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,