Skip to content

Commit

Permalink
Merge pull request #4224 from nawazkh/update_natgateways_to_aso
Browse files Browse the repository at this point in the history
remove redundant natgateway's Service struct
  • Loading branch information
k8s-ci-robot authored Nov 6, 2023
2 parents 2887cd2 + c4abb7c commit a6d376b
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions azure/services/natgateways/natgateways.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,13 @@ type NatGatewayScope interface {
NatGatewaySpecs() []azure.ASOResourceSpecGetter[*asonetworkv1.NatGateway]
}

// Service provides operations on azure resources.
type Service struct {
Scope NatGatewayScope
*aso.Service[*asonetworkv1.NatGateway, NatGatewayScope]
}

// New creates a new service.
func New(scope NatGatewayScope) *Service {
func New(scope NatGatewayScope) *aso.Service[*asonetworkv1.NatGateway, NatGatewayScope] {
svc := aso.NewService[*asonetworkv1.NatGateway, NatGatewayScope](serviceName, scope)
svc.Specs = scope.NatGatewaySpecs()
svc.ConditionType = infrav1.NATGatewaysReadyCondition
svc.PostCreateOrUpdateResourceHook = postCreateOrUpdateResourceHook
return &Service{
Scope: scope,
Service: svc,
}
return svc
}

func postCreateOrUpdateResourceHook(_ context.Context, scope NatGatewayScope, result *asonetworkv1.NatGateway, err error) error {
Expand Down

0 comments on commit a6d376b

Please sign in to comment.