From 220896494839fa6e6d1f118ccb7388be46bb3860 Mon Sep 17 00:00:00 2001 From: Chelsea Holland Komlo Date: Wed, 29 Nov 2017 14:33:01 -0500 Subject: [PATCH] Support StopTimeout for Docker tasksw Update github.com/fsouza/go-dockerclient --- client/driver/docker.go | 11 ++++++----- vendor/github.com/fsouza/go-dockerclient/container.go | 1 + vendor/github.com/fsouza/go-dockerclient/network.go | 2 +- vendor/vendor.json | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/client/driver/docker.go b/client/driver/docker.go index 05653f538..867336c1a 100644 --- a/client/driver/docker.go +++ b/client/driver/docker.go @@ -1047,11 +1047,12 @@ func (d *DockerDriver) createContainerConfig(ctx *ExecContext, task *structs.Tas } config := &docker.Config{ - Image: d.imageID, - Hostname: driverConfig.Hostname, - User: task.User, - Tty: driverConfig.TTY, - OpenStdin: driverConfig.Interactive, + Image: d.imageID, + Hostname: driverConfig.Hostname, + User: task.User, + Tty: driverConfig.TTY, + OpenStdin: driverConfig.Interactive, + StopTimeout: int(task.KillTimeout), } if driverConfig.WorkDir != "" { diff --git a/vendor/github.com/fsouza/go-dockerclient/container.go b/vendor/github.com/fsouza/go-dockerclient/container.go index 3137c56a2..f59bf38b6 100644 --- a/vendor/github.com/fsouza/go-dockerclient/container.go +++ b/vendor/github.com/fsouza/go-dockerclient/container.go @@ -300,6 +300,7 @@ type Config struct { ExposedPorts map[Port]struct{} `json:"ExposedPorts,omitempty" yaml:"ExposedPorts,omitempty" toml:"ExposedPorts,omitempty"` PublishService string `json:"PublishService,omitempty" yaml:"PublishService,omitempty" toml:"PublishService,omitempty"` StopSignal string `json:"StopSignal,omitempty" yaml:"StopSignal,omitempty" toml:"StopSignal,omitempty"` + StopTimeout int `json:"StopTimeout,omitempty" yaml:"StopTimeout,omitempty" toml:"StopTimeout,omitempty"` Env []string `json:"Env,omitempty" yaml:"Env,omitempty" toml:"Env,omitempty"` Cmd []string `json:"Cmd" yaml:"Cmd" toml:"Cmd"` Healthcheck *HealthConfig `json:"Healthcheck,omitempty" yaml:"Healthcheck,omitempty" toml:"Healthcheck,omitempty"` diff --git a/vendor/github.com/fsouza/go-dockerclient/network.go b/vendor/github.com/fsouza/go-dockerclient/network.go index b79b67cd5..155c52c78 100644 --- a/vendor/github.com/fsouza/go-dockerclient/network.go +++ b/vendor/github.com/fsouza/go-dockerclient/network.go @@ -112,7 +112,7 @@ func (c *Client) NetworkInfo(id string) (*Network, error) { type CreateNetworkOptions struct { Name string `json:"Name" yaml:"Name" toml:"Name"` Driver string `json:"Driver" yaml:"Driver" toml:"Driver"` - IPAM IPAMOptions `json:"IPAM" yaml:"IPAM" toml:"IPAM"` + IPAM *IPAMOptions `json:"IPAM,omitempty" yaml:"IPAM" toml:"IPAM"` Options map[string]interface{} `json:"Options" yaml:"Options" toml:"Options"` Labels map[string]string `json:"Labels" yaml:"Labels" toml:"Labels"` CheckDuplicate bool `json:"CheckDuplicate" yaml:"CheckDuplicate" toml:"CheckDuplicate"` diff --git a/vendor/vendor.json b/vendor/vendor.json index ec333239a..e7f74a01e 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -561,10 +561,10 @@ "revisionTime": "2016-07-19T20:45:16Z" }, { - "checksumSHA1": "Fo+DksVXnYQULqol7d07WDAtSMg=", + "checksumSHA1": "E+wmSQrc/BXzgITrbNAbUzljoiM=", "path": "github.com/fsouza/go-dockerclient", - "revision": "f06d891e0d0f000caf614fa8c670985434ae2df2", - "revisionTime": "2017-11-14T14:45:54Z" + "revision": "5ffdfff51ec0eba739b1039e65ba3625ef25f7c0", + "revisionTime": "2017-11-23T03:37:03Z" }, { "comment": "v1.8.5-2-g6ec4abd",