Skip to content

Commit 58422c6

Browse files
author
Aaron Lehmann
authored
Merge pull request #1497 from aaronlehmann/updater-check-service-changes
updater: Check entire service spec when deciding whether to replace ongoing update
2 parents 47e75e7 + f2ba23b commit 58422c6

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

manager/orchestrator/updater.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func (u *UpdateSupervisor) Update(ctx context.Context, cluster *api.Cluster, ser
4949
id := service.ID
5050

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

378-
func (u *Updater) isServiceDirty(service *api.Service) bool {
379-
return !reflect.DeepEqual(u.newService.Spec.Task, service.Spec.Task) ||
380-
!reflect.DeepEqual(u.newService.Spec.Endpoint, service.Spec.Endpoint)
381-
}
382-
383378
func (u *Updater) isSlotDirty(slot slot) bool {
384379
return len(slot) > 1 || (len(slot) == 1 && u.isTaskDirty(slot[0]))
385380
}

0 commit comments

Comments
 (0)