rename sync back to process

This commit is contained in:
Mike Mason
2023-07-18 13:23:49 +00:00
parent 99baf40c20
commit 05762f5d75
4 changed files with 5 additions and 5 deletions

View File

@@ -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(),

View File

@@ -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
}

View File

@@ -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(),

View File

@@ -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{
{