From 52f2c25c695e11eccfd9eb5a3106a6e331f40c32 Mon Sep 17 00:00:00 2001 From: Eli Uriegas Date: Tue, 19 Dec 2017 18:11:40 +0000 Subject: [PATCH] bump swarmkit to 7598f7a Signed-off-by: Eli Uriegas --- components/engine/vendor.conf | 2 +- .../manager/allocator/cnmallocator/networkallocator.go | 5 +++++ .../manager/orchestrator/taskreaper/task_reaper.go | 10 ++++++---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/components/engine/vendor.conf b/components/engine/vendor.conf index f59f9cf1439..6b3c1660d4f 100644 --- a/components/engine/vendor.conf +++ b/components/engine/vendor.conf @@ -114,7 +114,7 @@ github.com/dmcgowan/go-tar go1.10 github.com/stevvooe/ttrpc 76e68349ad9ab4d03d764c713826d31216715e4f # cluster -github.com/docker/swarmkit 4429c763170d9ca96929249353c3270c19e7d39e +github.com/docker/swarmkit 7598f7a937de4ad0a856012bd548009ceeb0d10e github.com/gogo/protobuf v0.4 github.com/cloudflare/cfssl 7fb22c8cba7ecaf98e4082d22d65800cf45e042a github.com/google/certificate-transparency d90e65c3a07988180c5b1ece71791c0b6506826e diff --git a/components/engine/vendor/github.com/docker/swarmkit/manager/allocator/cnmallocator/networkallocator.go b/components/engine/vendor/github.com/docker/swarmkit/manager/allocator/cnmallocator/networkallocator.go index 53f9ffbeee6..b89e72ed6e8 100644 --- a/components/engine/vendor/github.com/docker/swarmkit/manager/allocator/cnmallocator/networkallocator.go +++ b/components/engine/vendor/github.com/docker/swarmkit/manager/allocator/cnmallocator/networkallocator.go @@ -404,6 +404,11 @@ func (na *cnmNetworkAllocator) IsServiceAllocated(s *api.Service, flags ...func( vipLoop: for _, vip := range s.Endpoint.VirtualIPs { if na.IsVIPOnIngressNetwork(vip) && networkallocator.IsIngressNetworkNeeded(s) { + // This checks the condition when ingress network is needed + // but allocation has not been done. + if _, ok := na.services[s.ID]; !ok { + return false + } continue vipLoop } for _, net := range specNetworks { diff --git a/components/engine/vendor/github.com/docker/swarmkit/manager/orchestrator/taskreaper/task_reaper.go b/components/engine/vendor/github.com/docker/swarmkit/manager/orchestrator/taskreaper/task_reaper.go index bcef801f63e..d7027838330 100644 --- a/components/engine/vendor/github.com/docker/swarmkit/manager/orchestrator/taskreaper/task_reaper.go +++ b/components/engine/vendor/github.com/docker/swarmkit/manager/orchestrator/taskreaper/task_reaper.go @@ -96,10 +96,10 @@ func (tr *TaskReaper) Run(ctx context.Context) { // Serviceless tasks can be cleaned up right away since they are not attached to a service. tr.cleanup = append(tr.cleanup, t.ID) } - // tasks with desired state REMOVE that have progressed beyond SHUTDOWN can be cleaned up + // tasks with desired state REMOVE that have progressed beyond COMPLETE can be cleaned up // right away for _, t := range removeTasks { - if t.Status.State >= api.TaskStateShutdown { + if t.Status.State >= api.TaskStateCompleted { tr.cleanup = append(tr.cleanup, t.ID) } } @@ -138,10 +138,10 @@ func (tr *TaskReaper) Run(ctx context.Context) { if t.Status.State >= api.TaskStateOrphaned && t.ServiceID == "" { tr.cleanup = append(tr.cleanup, t.ID) } - // add tasks that have progressed beyond SHUTDOWN and have desired state REMOVE. These + // add tasks that have progressed beyond COMPLETE and have desired state REMOVE. These // tasks are associated with slots that were removed as part of a service scale down // or service removal. - if t.DesiredState == api.TaskStateRemove && t.Status.State >= api.TaskStateShutdown { + if t.DesiredState == api.TaskStateRemove && t.Status.State >= api.TaskStateCompleted { tr.cleanup = append(tr.cleanup, t.ID) } case api.EventUpdateCluster: @@ -282,6 +282,8 @@ func (tr *TaskReaper) tick() { // Stop stops the TaskReaper and waits for the main loop to exit. func (tr *TaskReaper) Stop() { + // TODO(dperny) calling stop on the task reaper twice will cause a panic + // because we try to close a channel that will already have been closed. close(tr.stopChan) <-tr.doneChan }