rename sync back to process
This commit is contained in:
@@ -75,7 +75,7 @@ func (s *service) TouchOrganization(ctx context.Context, id gidx.PrefixedID) err
|
||||
}
|
||||
|
||||
relationshipChanges := s.processRelationships(ctx, organizationEvent, relationships)
|
||||
rolesChanged, assignmentsChanged := s.syncMemberships(ctx, relationships, false)
|
||||
rolesChanged, assignmentsChanged := s.processMemberships(ctx, relationships, false)
|
||||
|
||||
s.logger.Infow("organization sync complete",
|
||||
"resource.id", org.PrefixedID(),
|
||||
|
||||
@@ -10,9 +10,9 @@ import (
|
||||
"go.equinixmetal.net/infra9-metal-bridge/internal/permissions"
|
||||
)
|
||||
|
||||
// syncMemberships determines the changes between what is wanted and what is live and executes on the differences.
|
||||
// processMemberships determines the changes between what is wanted and what is live and executes on the differences.
|
||||
// If skipDeletions is true, no deletes will be executed.
|
||||
func (s *service) syncMemberships(ctx context.Context, relationships Relationships, skipDeletions bool) (int, int) {
|
||||
func (s *service) processMemberships(ctx context.Context, relationships Relationships, skipDeletions bool) (int, int) {
|
||||
if len(relationships.Memberships) == 0 {
|
||||
return 0, 0
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ func (s *service) TouchProject(ctx context.Context, id gidx.PrefixedID) error {
|
||||
}
|
||||
|
||||
relationshipChanges := s.processRelationships(ctx, projectEvent, relationships)
|
||||
rolesChanged, assignmentsChanged := s.syncMemberships(ctx, relationships, false)
|
||||
rolesChanged, assignmentsChanged := s.processMemberships(ctx, relationships, false)
|
||||
|
||||
s.logger.Infow("project sync complete",
|
||||
"resource.id", project.PrefixedID(),
|
||||
|
||||
@@ -48,7 +48,7 @@ func (s *service) AssignUser(ctx context.Context, userID gidx.PrefixedID, resour
|
||||
continue
|
||||
}
|
||||
|
||||
roles, assignments := s.syncMemberships(ctx, Relationships{
|
||||
roles, assignments := s.processMemberships(ctx, Relationships{
|
||||
Resource: prefixedID{resourceID},
|
||||
Memberships: []ResourceMemberships{
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user