From ac738d32e5fb4e9ffed2ff11dbe015b2ff15040c Mon Sep 17 00:00:00 2001 From: Luther Monson Date: Fri, 12 May 2023 09:35:16 -0700 Subject: [PATCH] f --- controllers/azuremanagedmachinepool_reconciler.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/controllers/azuremanagedmachinepool_reconciler.go b/controllers/azuremanagedmachinepool_reconciler.go index c386d18803ca..3b670fd43b53 100644 --- a/controllers/azuremanagedmachinepool_reconciler.go +++ b/controllers/azuremanagedmachinepool_reconciler.go @@ -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" @@ -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.