diff --git a/hack/vendor.sh b/hack/vendor.sh index 27d2023034..851019dc0d 100755 --- a/hack/vendor.sh +++ b/hack/vendor.sh @@ -24,7 +24,7 @@ clone git golang.org/x/net 47990a1ba55743e6ef1affd3a14e5bac8553615d https://gith clone git golang.org/x/sys eb2c74142fd19a79b3f237334c7384d5167b1b46 https://github.com/golang/sys.git clone git github.com/docker/go-units 651fc226e7441360384da338d0fd37f2440ffbe3 clone git github.com/docker/go-connections v0.2.0 -clone git github.com/docker/engine-api e37a82dfcea64559ca6a581776253c01d83357d9 +clone git github.com/docker/engine-api 8924d6900370b4c7e7984be5adc61f50a80d7537 clone git github.com/RackSec/srslog 259aed10dfa74ea2961eddd1d9847619f6e98837 clone git github.com/imdario/mergo 0.2.1 diff --git a/vendor/src/github.com/docker/engine-api/client/container_wait.go b/vendor/src/github.com/docker/engine-api/client/container_wait.go index 8736b0dbb5..c26ff3f378 100644 --- a/vendor/src/github.com/docker/engine-api/client/container_wait.go +++ b/vendor/src/github.com/docker/engine-api/client/container_wait.go @@ -8,7 +8,7 @@ import ( "github.com/docker/engine-api/types" ) -// ContainerWait pauses execution util a container exits. +// ContainerWait pauses execution until a container exits. // It returns the API status code as response of its readiness. func (cli *Client) ContainerWait(ctx context.Context, containerID string) (int, error) { resp, err := cli.post(ctx, "/containers/"+containerID+"/wait", nil, nil, nil) diff --git a/vendor/src/github.com/docker/engine-api/client/hijack.go b/vendor/src/github.com/docker/engine-api/client/hijack.go index 8102d481b4..dbd91ef629 100644 --- a/vendor/src/github.com/docker/engine-api/client/hijack.go +++ b/vendor/src/github.com/docker/engine-api/client/hijack.go @@ -46,8 +46,7 @@ func (cli *Client) postHijacked(ctx context.Context, path string, query url.Valu req.Header.Set("Connection", "Upgrade") req.Header.Set("Upgrade", "tcp") - tlsConfig := cli.transport.TLSConfig() - conn, err := dial(cli.proto, cli.addr, tlsConfig) + conn, err := dial(cli.proto, cli.addr, cli.transport.TLSConfig()) if err != nil { if strings.Contains(err.Error(), "connection refused") { return types.HijackedResponse{}, fmt.Errorf("Cannot connect to the Docker daemon. Is 'docker daemon' running on this host?") @@ -69,11 +68,11 @@ func (cli *Client) postHijacked(ctx context.Context, path string, query url.Valu defer clientconn.Close() // Server hijacks the connection, error 'connection closed' expected - clientconn.Do(req) + _, err = clientconn.Do(req) rwc, br := clientconn.Hijack() - return types.HijackedResponse{Conn: rwc, Reader: br}, nil + return types.HijackedResponse{Conn: rwc, Reader: br}, err } func tlsDial(network, addr string, config *tls.Config) (net.Conn, error) { @@ -126,6 +125,21 @@ func tlsDialWithDialer(dialer *net.Dialer, network, addr string, config *tls.Con tcpConn.SetKeepAlivePeriod(30 * time.Second) } + colonPos := strings.LastIndex(addr, ":") + if colonPos == -1 { + colonPos = len(addr) + } + hostname := addr[:colonPos] + + // If no ServerName is set, infer the ServerName + // from the hostname we're connecting to. + if config.ServerName == "" { + // Make a copy to avoid polluting argument or default. + c := *config + c.ServerName = hostname + config = &c + } + conn := tls.Client(rawConn, config) if timeout == 0 { diff --git a/vendor/src/github.com/docker/engine-api/client/transport/transport.go b/vendor/src/github.com/docker/engine-api/client/transport/transport.go index 9e0095f3e4..ff28af1855 100644 --- a/vendor/src/github.com/docker/engine-api/client/transport/transport.go +++ b/vendor/src/github.com/docker/engine-api/client/transport/transport.go @@ -4,7 +4,6 @@ package transport import ( "fmt" "net/http" - "strings" "github.com/docker/go-connections/sockets" ) @@ -35,10 +34,6 @@ func NewTransportWithHTTP(proto, addr string, client *http.Client) (Client, erro } } - if transport.TLSClientConfig != nil && transport.TLSClientConfig.ServerName == "" { - transport.TLSClientConfig.ServerName = hostname(addr) - } - return &apiTransport{ Client: client, tlsInfo: &tlsInfo{transport.TLSClientConfig}, @@ -59,12 +54,4 @@ func defaultTransport(proto, addr string) *http.Transport { return tr } -func hostname(addr string) string { - colonPos := strings.LastIndex(addr, ":") - if colonPos == -1 { - return addr - } - return addr[:colonPos] -} - var _ Client = &apiTransport{} diff --git a/vendor/src/github.com/docker/engine-api/types/client.go b/vendor/src/github.com/docker/engine-api/types/client.go index 00fc97054e..975a5bb639 100644 --- a/vendor/src/github.com/docker/engine-api/types/client.go +++ b/vendor/src/github.com/docker/engine-api/types/client.go @@ -103,7 +103,7 @@ func (h *HijackedResponse) Close() { h.Conn.Close() } -// CloseWriter is an interface that implement structs +// CloseWriter is an interface that implements structs // that close input streams to prevent from writing. type CloseWriter interface { CloseWrite() error diff --git a/vendor/src/github.com/docker/engine-api/types/container/host_config.go b/vendor/src/github.com/docker/engine-api/types/container/host_config.go index 0b2af65145..7ad634b6da 100644 --- a/vendor/src/github.com/docker/engine-api/types/container/host_config.go +++ b/vendor/src/github.com/docker/engine-api/types/container/host_config.go @@ -236,10 +236,11 @@ type Resources struct { Ulimits []*units.Ulimit // List of ulimits to be set in the container // Applicable to Windows - CPUCount int64 `json:"CpuCount"` // CPU count - CPUPercent int64 `json:"CpuPercent"` // CPU percent - MaximumIOps uint64 // Maximum IOps for the container system drive - MaximumIOBps uint64 // Maximum IO in bytes per second for the container system drive + CPUCount int64 `json:"CpuCount"` // CPU count + CPUPercent int64 `json:"CpuPercent"` // CPU percent + IOMaximumIOps uint64 // Maximum IOps for the container system drive + IOMaximumBandwidth uint64 // Maximum IO in bytes per second for the container system drive + NetworkMaximumBandwidth uint64 // Maximum bandwidth of the network endpoint in bytes per second } // UpdateConfig holds the mutable attributes of a Container. diff --git a/vendor/src/github.com/docker/engine-api/types/stats.go b/vendor/src/github.com/docker/engine-api/types/stats.go index 55081ae4d2..1434033410 100644 --- a/vendor/src/github.com/docker/engine-api/types/stats.go +++ b/vendor/src/github.com/docker/engine-api/types/stats.go @@ -8,7 +8,7 @@ import "time" type ThrottlingData struct { // Number of periods with throttling active Periods uint64 `json:"periods"` - // Number of periods when the container hit its throttling limit. + // Number of periods when the container hits its throttling limit. ThrottledPeriods uint64 `json:"throttled_periods"` // Aggregate time the container was throttled for in nanoseconds. ThrottledTime uint64 `json:"throttled_time"`