Skip to content

Commit ec2a6aa

Browse files
committed
refactor: resolve changes from offerings refactor revamp
1 parent 7fc258b commit ec2a6aa

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pkg/providers/instance/aksmachineinstance.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ type DefaultAKSMachineProvider struct {
131131
clusterName string
132132
aksMachinesPoolName string // Only support one AKS machine pool at a time, for now.
133133
aksMachinesPoolLocation string
134-
errorHandling *offerings.CloudErrorHandling
134+
errorHandling *offerings.CloudErrorHandler
135135
}
136136

137137
func NewAKSMachineProvider(
@@ -155,10 +155,7 @@ func NewAKSMachineProvider(
155155
clusterName: clusterName,
156156
aksMachinesPoolName: aksMachinesPoolName,
157157
aksMachinesPoolLocation: aksMachinesPoolLocation,
158-
errorHandling: &offerings.CloudErrorHandling{
159-
UnavailableOfferings: offeringsCache,
160-
CloudErrorHandlers: offerings.DefaultCloudErrorHandlers(),
161-
},
158+
errorHandling: offerings.NewCloudErrorHandler(offeringsCache),
162159
}
163160

164161
return provider
@@ -494,7 +491,7 @@ func (p *DefaultAKSMachineProvider) handleMachineProvisioningError(ctx context.C
494491
return fmt.Errorf("failed to get instance type %q: %w, provisioning error left unhandled: code=%s, message=%s", instanceType.Name, skuErr, lo.FromPtr(innerError.Code), lo.FromPtr(innerError.Message))
495492
}
496493

497-
handledError := p.errorHandling.HandleCloudError(ctx, sku, instanceType, zone, capacityType, innerError)
494+
handledError := p.errorHandling.Handle(ctx, sku, instanceType, zone, capacityType, innerError)
498495
if handledError != nil {
499496
// If error is handled, return it (wrapped)
500497
return fmt.Errorf("failed to create AKS machine %q during %s, handled provisioning error: %w", aksMachineName, phase, handledError)

0 commit comments

Comments
 (0)