Skip to content

Commit

Permalink
Merge pull request #1497 from aaronlehmann/updater-check-service-changes
Browse files Browse the repository at this point in the history
updater: Check entire service spec when deciding whether to replace ongoing update
  • Loading branch information
aaronlehmann authored Sep 6, 2016
2 parents 47e75e7 + f2ba23b commit 58422c6
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions manager/orchestrator/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (u *UpdateSupervisor) Update(ctx context.Context, cluster *api.Cluster, ser
id := service.ID

if update, ok := u.updates[id]; ok {
if !update.isServiceDirty(service) {
if reflect.DeepEqual(service.Spec, update.newService.Spec) {
// There's already an update working towards this goal.
return
}
Expand Down Expand Up @@ -375,11 +375,6 @@ func (u *Updater) isTaskDirty(t *api.Task) bool {
(t.Endpoint != nil && !reflect.DeepEqual(u.newService.Spec.Endpoint, t.Endpoint.Spec))
}

func (u *Updater) isServiceDirty(service *api.Service) bool {
return !reflect.DeepEqual(u.newService.Spec.Task, service.Spec.Task) ||
!reflect.DeepEqual(u.newService.Spec.Endpoint, service.Spec.Endpoint)
}

func (u *Updater) isSlotDirty(slot slot) bool {
return len(slot) > 1 || (len(slot) == 1 && u.isTaskDirty(slot[0]))
}
Expand Down

0 comments on commit 58422c6

Please sign in to comment.