@@ -41,36 +41,28 @@ import (
4141
4242// AROMachinePoolScopeParams defines the input parameters used to create a new Scope.
4343type AROMachinePoolScopeParams struct {
44- AzureClients
45- Client client.Client
46- Cluster * clusterv1.Cluster
47- MachinePool * clusterv1.MachinePool
48- ControlPlane * cplane.AROControlPlane
49- AROMachinePool * v1beta2.AROMachinePool
50- Cache * AROMachinePoolCache
51- Timeouts azure.AsyncReconciler
52- CredentialCache azure.CredentialCache
53- AROControlPlaneScope * AROControlPlaneScope
44+ Client client.Client
45+ Cluster * clusterv1.Cluster
46+ MachinePool * clusterv1.MachinePool
47+ ControlPlane * cplane.AROControlPlane
48+ AROMachinePool * v1beta2.AROMachinePool
49+ Cache * AROMachinePoolCache
50+ Timeouts azure.AsyncReconciler
5451}
5552
5653// NewAROMachinePoolScope creates a new Scope from the supplied parameters.
5754// This is meant to be called for each reconcile iteration.
5855func NewAROMachinePoolScope (ctx context.Context , params AROMachinePoolScopeParams ) (* AROMachinePoolScope , error ) {
59- ctx , _ , done := tele .StartSpanWithLogger (ctx , "azure.aroMachinePoolScope.NewAROMachinePoolScope" )
56+ _ , _ , done := tele .StartSpanWithLogger (ctx , "azure.aroMachinePoolScope.NewAROMachinePoolScope" )
6057 defer done ()
6158
6259 if params .AROMachinePool == nil {
6360 return nil , errors .New ("failed to generate new scope from nil AROMachinePool" )
6461 }
6562
66- credentialsProvider , err := NewAzureCredentialsProvider (ctx , params .CredentialCache , params .Client , params .ControlPlane .Spec .IdentityRef , params .AROMachinePool .Namespace )
67- if err != nil {
68- return nil , errors .Wrap (err , "failed to init credentials provider" )
69- }
70- err = params .AzureClients .setCredentialsWithProvider (ctx , params .ControlPlane .Spec .SubscriptionID , params .ControlPlane .Spec .AzureEnvironment , credentialsProvider )
71- if err != nil {
72- return nil , errors .Wrap (err , "failed to configure azure settings and credentials for Identity" )
73- }
63+ // AROMachinePool no longer requires Azure credentials
64+ // ProviderIDList is populated from workload cluster nodes instead of Azure VM API
65+ // ASO handles all Azure operations via its own authentication (serviceoperator.azure.com/credential-from annotations)
7466
7567 if params .Cache == nil {
7668 params .Cache = & AROMachinePoolCache {}
@@ -89,7 +81,6 @@ func NewAROMachinePoolScope(ctx context.Context, params AROMachinePoolScopeParam
8981 Client : params .Client ,
9082 patchHelper : helper ,
9183 cache : params .Cache ,
92- AzureClients : params .AzureClients ,
9384 Cluster : params .Cluster ,
9485 MachinePool : params .MachinePool ,
9586 ControlPlane : params .ControlPlane ,
@@ -106,7 +97,6 @@ type AROMachinePoolScope struct {
10697 capiMachinePoolPatchHelper * patch.Helper
10798 cache * AROMachinePoolCache
10899
109- AzureClients
110100 Cluster * clusterv1.Cluster
111101 ControlPlane * cplane.AROControlPlane
112102 MachinePool * clusterv1.MachinePool
@@ -218,11 +208,6 @@ func (s *AROMachinePoolScope) UpdatePatchStatus(condition clusterv1.ConditionTyp
218208type AROMachinePoolCache struct {
219209}
220210
221- // BaseURI returns the Azure ResourceManagerEndpoint.
222- func (s * AROMachinePoolScope ) BaseURI () string {
223- return s .ResourceManagerEndpoint
224- }
225-
226211// GetClient returns the controller-runtime client.
227212func (s * AROMachinePoolScope ) GetClient () client.Client {
228213 return s .Client
0 commit comments