Skip to content

Commit

Permalink
Merge pull request #6291 from sergelogvinov/non-azure-providerid
Browse files Browse the repository at this point in the history
Azure: skip non azure nodes
  • Loading branch information
k8s-ci-robot authored Jan 3, 2024
2 parents bb72e46 + c5c6356 commit f4891e3
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package azure
import (
"io"
"os"
"strings"

apiv1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
Expand Down Expand Up @@ -105,6 +106,12 @@ func (azure *AzureCloudProvider) NodeGroupForNode(node *apiv1.Node) (cloudprovid
klog.V(6).Infof("Skipping the search for node group for the node '%s' because it has no spec.ProviderID", node.ObjectMeta.Name)
return nil, nil
}

if !strings.HasPrefix(node.Spec.ProviderID, "azure://") {
klog.V(6).Infof("Wrong azure ProviderID for node %v, skipped", node.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 f4891e3

Please sign in to comment.