Merge pull request #23208 from vdemeester/update-engine-api

Bump engine api to 009ba16
This commit is contained in:
Alexander Morozov 2016-06-02 09:30:57 -07:00
commit cb8e7470be
10 changed files with 38 additions and 8 deletions

View File

@ -234,7 +234,7 @@ func (cli *DockerCli) CmdRun(args ...string) error {
} }
//start the container //start the container
if err := cli.client.ContainerStart(ctx, createResponse.ID, ""); err != nil { if err := cli.client.ContainerStart(ctx, createResponse.ID, types.ContainerStartOptions{}); err != nil {
// If we have holdHijackedConnection, we should notify // If we have holdHijackedConnection, we should notify
// holdHijackedConnection we are going to exit and wait // holdHijackedConnection we are going to exit and wait
// to avoid the terminal are not restored. // to avoid the terminal are not restored.

View File

@ -113,7 +113,7 @@ func (cli *DockerCli) CmdStart(args ...string) error {
}) })
// 3. Start the container. // 3. Start the container.
if err := cli.client.ContainerStart(ctx, container, ""); err != nil { if err := cli.client.ContainerStart(ctx, container, types.ContainerStartOptions{}); err != nil {
cancelFun() cancelFun()
<-cErr <-cErr
return err return err
@ -147,7 +147,7 @@ func (cli *DockerCli) CmdStart(args ...string) error {
func (cli *DockerCli) startContainersWithoutAttachments(ctx context.Context, containers []string) error { func (cli *DockerCli) startContainersWithoutAttachments(ctx context.Context, containers []string) error {
var failedContainers []string var failedContainers []string
for _, container := range containers { for _, container := range containers {
if err := cli.client.ContainerStart(ctx, container, ""); err != nil { if err := cli.client.ContainerStart(ctx, container, types.ContainerStartOptions{}); err != nil {
fmt.Fprintf(cli.err, "%s\n", err) fmt.Fprintf(cli.err, "%s\n", err)
failedContainers = append(failedContainers, container) failedContainers = append(failedContainers, container)
} else { } else {

View File

@ -60,7 +60,7 @@ clone git golang.org/x/net 78cb2c067747f08b343f20614155233ab4ea2ad3 https://gith
clone git golang.org/x/sys eb2c74142fd19a79b3f237334c7384d5167b1b46 https://github.com/golang/sys.git 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-units 651fc226e7441360384da338d0fd37f2440ffbe3
clone git github.com/docker/go-connections v0.2.0 clone git github.com/docker/go-connections v0.2.0
clone git github.com/docker/engine-api 6facb3f3c38717b8f618dcedc4c8ce20d1bfc61e clone git github.com/docker/engine-api 009ba1641d669613b38818f6f6385b0e74c5728f
clone git github.com/RackSec/srslog 259aed10dfa74ea2961eddd1d9847619f6e98837 clone git github.com/RackSec/srslog 259aed10dfa74ea2961eddd1d9847619f6e98837
clone git github.com/imdario/mergo 0.2.1 clone git github.com/imdario/mergo 0.2.1

View File

@ -4,12 +4,16 @@ import (
"net/url" "net/url"
"golang.org/x/net/context" "golang.org/x/net/context"
"github.com/docker/engine-api/types"
) )
// ContainerStart sends a request to the docker daemon to start a container. // ContainerStart sends a request to the docker daemon to start a container.
func (cli *Client) ContainerStart(ctx context.Context, containerID string, checkpointID string) error { func (cli *Client) ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error {
query := url.Values{} query := url.Values{}
query.Set("checkpoint", checkpointID) if len(options.CheckpointID) != 0 {
query.Set("checkpoint", options.CheckpointID)
}
resp, err := cli.post(ctx, "/containers/"+containerID+"/start", query, nil, nil) resp, err := cli.post(ctx, "/containers/"+containerID+"/start", query, nil, nil)
ensureReaderClosed(resp) ensureReaderClosed(resp)

View File

@ -2,6 +2,7 @@ package client
import ( import (
"encoding/json" "encoding/json"
"fmt"
"net/http" "net/http"
"net/url" "net/url"
@ -17,6 +18,7 @@ func (cli *Client) ImageSearch(ctx context.Context, term string, options types.I
var results []registry.SearchResult var results []registry.SearchResult
query := url.Values{} query := url.Values{}
query.Set("term", term) query.Set("term", term)
query.Set("limit", fmt.Sprintf("%d", options.Limit))
if options.Filters.Len() > 0 { if options.Filters.Len() > 0 {
filterJSON, err := filters.ToParam(options.Filters) filterJSON, err := filters.ToParam(options.Filters)

View File

@ -40,7 +40,7 @@ type APIClient interface {
ContainerRestart(ctx context.Context, container string, timeout int) error ContainerRestart(ctx context.Context, container string, timeout int) error
ContainerStatPath(ctx context.Context, container, path string) (types.ContainerPathStat, error) ContainerStatPath(ctx context.Context, container, path string) (types.ContainerPathStat, error)
ContainerStats(ctx context.Context, container string, stream bool) (io.ReadCloser, error) ContainerStats(ctx context.Context, container string, stream bool) (io.ReadCloser, error)
ContainerStart(ctx context.Context, container string, checkpointID string) error ContainerStart(ctx context.Context, container string, options types.ContainerStartOptions) error
ContainerStop(ctx context.Context, container string, timeout int) error ContainerStop(ctx context.Context, container string, timeout int) error
ContainerTop(ctx context.Context, container string, arguments []string) (types.ContainerProcessList, error) ContainerTop(ctx context.Context, container string, arguments []string) (types.ContainerProcessList, error)
ContainerUnpause(ctx context.Context, container string) error ContainerUnpause(ctx context.Context, container string) error

View File

@ -73,6 +73,11 @@ type ContainerRemoveOptions struct {
Force bool Force bool
} }
// ContainerStartOptions holds parameters to start containers.
type ContainerStartOptions struct {
CheckpointID string
}
// CopyToContainerOptions holds information // CopyToContainerOptions holds information
// about files to copy into a container // about files to copy into a container
type CopyToContainerOptions struct { type CopyToContainerOptions struct {
@ -213,6 +218,7 @@ type ImageSearchOptions struct {
RegistryAuth string RegistryAuth string
PrivilegeFunc RequestPrivilegeFunc PrivilegeFunc RequestPrivilegeFunc
Filters filters.Args Filters filters.Args
Limit int
} }
// ResizeOptions holds parameters to resize a tty. // ResizeOptions holds parameters to resize a tty.

View File

@ -309,6 +309,7 @@ type HostConfig struct {
UsernsMode UsernsMode // The user namespace to use for the container UsernsMode UsernsMode // The user namespace to use for the container
ShmSize int64 // Total shm memory usage ShmSize int64 // Total shm memory usage
Sysctls map[string]string `json:",omitempty"` // List of Namespaced sysctls used for the container Sysctls map[string]string `json:",omitempty"` // List of Namespaced sysctls used for the container
Runtime string `json:"runtime,omitempty"` // Runtime to use with this container
// Applicable to Windows // Applicable to Windows
ConsoleSize [2]int // Initial console size ConsoleSize [2]int // Initial console size

View File

@ -24,6 +24,11 @@ const (
ArchMIPSEL Arch = "SCMP_ARCH_MIPSEL" ArchMIPSEL Arch = "SCMP_ARCH_MIPSEL"
ArchMIPSEL64 Arch = "SCMP_ARCH_MIPSEL64" ArchMIPSEL64 Arch = "SCMP_ARCH_MIPSEL64"
ArchMIPSEL64N32 Arch = "SCMP_ARCH_MIPSEL64N32" ArchMIPSEL64N32 Arch = "SCMP_ARCH_MIPSEL64N32"
ArchPPC Arch = "SCMP_ARCH_PPC"
ArchPPC64 Arch = "SCMP_ARCH_PPC64"
ArchPPC64LE Arch = "SCMP_ARCH_PPC64LE"
ArchS390 Arch = "SCMP_ARCH_S390"
ArchS390X Arch = "SCMP_ARCH_S390X"
) )
// Action taken upon Seccomp rule match // Action taken upon Seccomp rule match

View File

@ -252,6 +252,8 @@ type Info struct {
ClusterStore string ClusterStore string
ClusterAdvertise string ClusterAdvertise string
SecurityOptions []string SecurityOptions []string
Runtimes map[string]Runtime
DefaultRuntime string
} }
// PluginsInfo is a temp struct holding Plugins name // PluginsInfo is a temp struct holding Plugins name
@ -476,3 +478,13 @@ type NetworkDisconnect struct {
type Checkpoint struct { type Checkpoint struct {
Name string // Name is the name of the checkpoint Name string // Name is the name of the checkpoint
} }
// DefaultRuntimeName is the reserved name/alias used to represent the
// OCI runtime being shipped with the docker daemon package.
var DefaultRuntimeName = "default"
// Runtime describes an OCI runtime
type Runtime struct {
Path string `json:"path"`
Args []string `json:"runtimeArgs,omitempty"`
}