Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove redundant natgateway's Service struct #4224

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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] {

Check warning on line 39 in azure/services/natgateways/natgateways.go

View check run for this annotation

Codecov / codecov/patch

azure/services/natgateways/natgateways.go#L39

Added line #L39 was not covered by tests
nojnhuh marked this conversation as resolved.
Show resolved Hide resolved
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

Check warning on line 44 in azure/services/natgateways/natgateways.go

View check run for this annotation

Codecov / codecov/patch

azure/services/natgateways/natgateways.go#L44

Added line #L44 was not covered by tests
}

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