vndr swarmkit to bring in fix for PullOptions
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
diff --git a/vendor.conf b/vendor.conf
index e365a9a..76b5ae5 100644
--- a/vendor.conf
+++ b/vendor.conf
@@ -108,7 +108,7 @@
github.com/tonistiigi/fifo 1405643975692217d6720f8b54aeee1bf2cd5cf4
# cluster
-github.com/docker/swarmkit a0a7f6f663c35c92ddcd73e2c1b97b0f4ed8caf3
+github.com/docker/swarmkit bf3d9a21fa618289839963138923b1534103486a
github.com/gogo/protobuf v0.4
github.com/cloudflare/cfssl 7fb22c8cba7ecaf98e4082d22d65800cf45e042a
github.com/google/certificate-transparency d90e65c3a07988180c5b1ece71791c0b6506826e
diff --git a/vendor/github.com/docker/swarmkit/manager/orchestrator/task.go b/vendor/github.com/docker/swarmkit/manager/orchestrator/task.go
index 32a22d5..0a4218f 100644
--- a/vendor/github.com/docker/swarmkit/manager/orchestrator/task.go
+++ b/vendor/github.com/docker/swarmkit/manager/orchestrator/task.go
@@ -67,7 +67,29 @@
return false
}
- return !reflect.DeepEqual(s.Spec.Task, t.Spec) ||
+ // Make a deep copy of the service and task spec for the comparison.
+ serviceTaskSpec := *s.Spec.Task.Copy()
+
+ // For non-failed tasks with a container spec runtime that have already
+ // pulled the required image (i.e., current state is between READY and
+ // RUNNING inclusively), ignore the value of the `PullOptions` field by
+ // setting the copied service to have the same PullOptions value as the
+ // task. A difference in only the `PullOptions` field should not cause
+ // a running (or ready to run) task to be considered 'dirty' when we
+ // handle updates.
+ // See https://github.com/docker/swarmkit/issues/971
+ currentState := t.Status.State
+ // Ignore PullOpts if the task is desired to be in a "runnable" state
+ // and its last known current state is between READY and RUNNING in
+ // which case we know that the task either successfully pulled its
+ // container image or didn't need to.
+ ignorePullOpts := t.DesiredState <= api.TaskStateRunning && currentState >= api.TaskStateReady && currentState <= api.TaskStateRunning
+ if ignorePullOpts && serviceTaskSpec.GetContainer() != nil && t.Spec.GetContainer() != nil {
+ // Modify the service's container spec.
+ serviceTaskSpec.GetContainer().PullOptions = t.Spec.GetContainer().PullOptions
+ }
+
+ return !reflect.DeepEqual(serviceTaskSpec, t.Spec) ||
(t.Endpoint != nil && !reflect.DeepEqual(s.Spec.Endpoint, t.Endpoint.Spec))
}