Skip to content

Commit

Permalink
allocator: Update unallocatedServices properly after service updates
Browse files Browse the repository at this point in the history
If a service update caused the service to be successfully allocated,
that service should be removed from unallocatedServices.

If the allocation was unsuccessful, unallocatedServices should be
updated to contain the latest version of the service.

Signed-off-by: Aaron Lehmann <[email protected]>
  • Loading branch information
aaronlehmann committed Mar 8, 2017
1 parent e4762bc commit 92e74a2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions manager/allocator/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,9 @@ func (a *Allocator) doNetworkAlloc(ctx context.Context, ev events.Event) {
return a.commitAllocatedService(ctx, batch, s)
}); err != nil {
log.G(ctx).WithError(err).Errorf("Failed to commit allocation during update for service %s", s.ID)
nc.unallocatedServices[s.ID] = s
} else {
delete(nc.unallocatedServices, s.ID)
}
case state.EventDeleteService:
s := v.Service.Copy()
Expand Down

0 comments on commit 92e74a2

Please sign in to comment.