diff --git a/azure/services/groups/groups.go b/azure/services/groups/groups.go index 5074ba41445..2221dc7816e 100644 --- a/azure/services/groups/groups.go +++ b/azure/services/groups/groups.go @@ -53,19 +53,13 @@ func New(scope GroupScope) *Service { } } -// isGroupManaged returns true if the ASO ResourceGroup was created by CAPZ, -// meaning that the resource group's lifecycle is managed. -func (s *Service) isGroupManaged(ctx context.Context, spec azure.ASOResourceSpecGetter[*asoresourcesv1.ResourceGroup]) (bool, error) { - return aso.IsManaged(ctx, s.Scope.GetClient(), spec, s.Scope.ClusterName()) -} - // IsManaged returns false if the resource group is -// true and reconciled by ASO, meaning that we can rely on a single resource +// managed and reconciled by ASO, meaning that we can rely on a single resource // group delete operation as opposed to deleting every individual resource. func (s *Service) IsManaged(ctx context.Context) (bool, error) { // Unless all resource groups are managed by CAPZ and reconciled by ASO, resources need to be deleted individually. for _, spec := range s.Specs { - managed, err := s.isGroupManaged(ctx, spec) + managed, err := aso.IsManaged(ctx, s.Scope.GetClient(), spec, s.Scope.ClusterName()) if err != nil || !managed { return managed, err }