Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
mvbrock committed Jan 10, 2025
1 parent ae6bba6 commit aafeb05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
5 changes: 0 additions & 5 deletions lib/msgraph/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ type GroupMember interface {
isGroupMember()
}

type Membership struct {
Type string `json:"@odata.type"`
ID string `json:"id"`
}

type DirectoryObject struct {
ID *string `json:"id,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
Expand Down
11 changes: 3 additions & 8 deletions lib/srv/discovery/fetchers/azure-sync/memberships.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (

const parallelism = 10 //nolint:unused // invoked in a dependent PR

// expandMemberships adds membership data to AzurePrincipal objects by querying the Graph API for group memberships
func expandMemberships(ctx context.Context, cli *msgraph.Client, principals []*accessgraphv1alpha.AzurePrincipal) ([]*accessgraphv1alpha.AzurePrincipal, error) { //nolint:unused // invoked in a dependent PR
eg, _ := errgroup.WithContext(ctx)
eg.SetLimit(parallelism)
Expand All @@ -47,12 +48,6 @@ func expandMemberships(ctx context.Context, cli *msgraph.Client, principals []*a
})
}
_ = eg.Wait()
var errs []error
for chErr := range errCh {
errs = append(errs, chErr)
}
if len(errs) > 0 {
return nil, trace.NewAggregate(errs...)
}
return principals, nil
close(errCh)
return principals, trace.NewAggregateFromChannel(errCh, ctx)
}

0 comments on commit aafeb05

Please sign in to comment.