Skip to content

Commit

Permalink
Ignore nodes that have no ProviderID. (kubernetes#2236)
Browse files Browse the repository at this point in the history
Signed-off-by: Masaki Muranaka <[email protected]>
  • Loading branch information
monaka authored and mikkeloscar committed Aug 24, 2022
1 parent a809e6a commit 422d628
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 422d628

Please sign in to comment.