@@ -55,7 +55,6 @@ type Provider struct {
5555 Tags map [string ]* string
5656}
5757
58- var _ clusterapi.PreProvider = (* Provider )(nil )
5958var _ clusterapi.InfraReadyProvider = (* Provider )(nil )
6059var _ clusterapi.PostProvider = (* Provider )(nil )
6160var _ clusterapi.IgnitionProvider = (* Provider )(nil )
@@ -83,8 +82,8 @@ func (p Provider) ProvisionTimeout() time.Duration {
8382// in the status and should use the API load balancer when gathering bootstrap log bundles.
8483func (* Provider ) PublicGatherEndpoint () clusterapi.GatherEndpoint { return clusterapi .APILoadBalancer }
8584
86- // PreProvision is called before provisioning using CAPI controllers has begun .
87- func (p * Provider ) PreProvision (ctx context.Context , in clusterapi.PreProvisionInput ) error {
85+ // InfraReady is called once the installer infrastructure is ready .
86+ func (p * Provider ) InfraReady (ctx context.Context , in clusterapi.InfraReadyInput ) error {
8887 session , err := in .InstallConfig .Azure .Session ()
8988 if err != nil {
9089 return fmt .Errorf ("failed to get session: %w" , err )
@@ -127,7 +126,7 @@ func (p *Provider) PreProvision(ctx context.Context, in clusterapi.PreProvisionI
127126 securityGroupName ,
128127 armnetwork.SecurityGroup {
129128 Location : to .Ptr (platform .Region ),
130- Tags : tags ,
129+ Tags : p . Tags ,
131130 },
132131 nil )
133132 if err != nil {
@@ -140,21 +139,6 @@ func (p *Provider) PreProvision(ctx context.Context, in clusterapi.PreProvisionI
140139 logrus .Infof ("nsg=%s" , * nsg .ID )
141140 }
142141
143- return nil
144- }
145-
146- // InfraReady is called once the installer infrastructure is ready.
147- func (p * Provider ) InfraReady (ctx context.Context , in clusterapi.InfraReadyInput ) error {
148- session , err := in .InstallConfig .Azure .Session ()
149- if err != nil {
150- return fmt .Errorf ("failed to get session: %w" , err )
151- }
152-
153- installConfig := in .InstallConfig .Config
154- platform := installConfig .Platform .Azure
155- subscriptionID := session .Credentials .SubscriptionID
156- cloudConfiguration := session .CloudConfig
157-
158142 var architecture armcompute.Architecture
159143 if installConfig .ControlPlane .Architecture == types .ArchitectureARM64 {
160144 architecture = armcompute .ArchitectureArm64
@@ -199,14 +183,6 @@ func (p *Provider) InfraReady(ctx context.Context, in clusterapi.InfraReadyInput
199183 return fmt .Errorf ("image length is not aligned on a 512 byte boundary" )
200184 }
201185
202- userTags := platform .UserTags
203- tags := make (map [string ]* string , len (userTags )+ 1 )
204- tags [fmt .Sprintf ("kubernetes.io_cluster.%s" , in .InfraID )] = ptr .To ("owned" )
205- for k , v := range userTags {
206- tags [k ] = ptr .To (v )
207- }
208-
209- tokenCredential := session .TokenCreds
210186 storageURL := fmt .Sprintf ("https://%s.blob.%s" , storageAccountName , session .Environment .StorageEndpointSuffix )
211187 blobURL := fmt .Sprintf ("%s/%s/%s" , storageURL , containerName , blobName )
212188
0 commit comments