Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
luthermonson committed May 12, 2023
1 parent b61303d commit ac738d3
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions controllers/azuremanagedmachinepool_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"time"

"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-11-01/compute"
azureautorest "github.com/Azure/go-autorest/autorest/azure"
"github.com/pkg/errors"
azprovider "sigs.k8s.io/cloud-provider-azure/pkg/provider"
"sigs.k8s.io/cluster-api-provider-azure/azure"
Expand Down Expand Up @@ -90,15 +89,11 @@ func newAzureManagedMachinePoolService(scope *scope.ManagedMachinePoolScope) (*a
// scaleSetAuthorizer takes a scope and determines if a regional authorizer is needed for scale sets
// see https://github.com/kubernetes-sigs/cluster-api-provider-azure/pull/1850 for context on region based authorizer.
func scaleSetAuthorizer(scope *scope.ManagedMachinePoolScope) (azure.Authorizer, error) {
if scope.Location() == "" {
return scope, nil // no location so use default
if scope.ControlPlane.Spec.AzureEnvironment == azure.PublicCloudName {
return azure.WithRegionalBaseURI(scope, scope.Location()) // public cloud supports regional end points
}

if scope.ControlPlane.Spec.AzureEnvironment == azureautorest.USGovernmentCloud.Name {
return scope, nil // no region support in usgovcloud
}

return azure.WithRegionalBaseURI(scope, scope.Location())
return scope, nil
}

// Reconcile reconciles all the services in a predetermined order.
Expand Down

0 comments on commit ac738d3

Please sign in to comment.