From 97d95604e0f2ac259d60257db0282561e5f52d03 Mon Sep 17 00:00:00 2001 From: Mrunal Patel Date: Thu, 5 May 2016 17:01:10 -0400 Subject: [PATCH] Update engine-api to 1fb8f09960cc32b9648495a422c960fb2a4f8a09 Signed-off-by: Mrunal Patel --- api/client/search.go | 2 +- hack/vendor.sh | 2 +- .../docker/engine-api/client/image_search.go | 9 ++++++ .../docker/engine-api/types/client.go | 1 + .../engine-api/types/container/host_config.go | 29 +++++++++++++++---- .../engine-api/types/registry/registry.go | 4 +-- 6 files changed, 37 insertions(+), 10 deletions(-) diff --git a/api/client/search.go b/api/client/search.go index 5abd8f75bd..5ee6b8b652 100644 --- a/api/client/search.go +++ b/api/client/search.go @@ -76,7 +76,7 @@ func (cli *DockerCli) CmdSearch(args ...string) error { } fmt.Fprint(w, "\t") - if res.IsAutomated || res.IsTrusted { + if res.IsAutomated { fmt.Fprint(w, "[OK]") } fmt.Fprint(w, "\n") diff --git a/hack/vendor.sh b/hack/vendor.sh index 798ba4fbc0..cf51b93168 100755 --- a/hack/vendor.sh +++ b/hack/vendor.sh @@ -25,7 +25,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 github.com/docker/go-units 651fc226e7441360384da338d0fd37f2440ffbe3 clone git github.com/docker/go-connections v0.2.0 -clone git github.com/docker/engine-api 009426d98aa84d199210a897dbb60bfee541877d +clone git github.com/docker/engine-api 1fb8f09960cc32b9648495a422c960fb2a4f8a09 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/image_search.go b/vendor/src/github.com/docker/engine-api/client/image_search.go index 3528bda6bd..571ba3df36 100644 --- a/vendor/src/github.com/docker/engine-api/client/image_search.go +++ b/vendor/src/github.com/docker/engine-api/client/image_search.go @@ -6,6 +6,7 @@ import ( "net/url" "github.com/docker/engine-api/types" + "github.com/docker/engine-api/types/filters" "github.com/docker/engine-api/types/registry" "golang.org/x/net/context" ) @@ -17,6 +18,14 @@ func (cli *Client) ImageSearch(ctx context.Context, term string, options types.I query := url.Values{} query.Set("term", term) + if options.Filters.Len() > 0 { + filterJSON, err := filters.ToParam(options.Filters) + if err != nil { + return results, err + } + query.Set("filters", filterJSON) + } + resp, err := cli.tryImageSearch(ctx, query, options.RegistryAuth) if resp.statusCode == http.StatusUnauthorized { newAuthHeader, privilegeErr := options.PrivilegeFunc() 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 8218b17420..fa3b2cfb45 100644 --- a/vendor/src/github.com/docker/engine-api/types/client.go +++ b/vendor/src/github.com/docker/engine-api/types/client.go @@ -206,6 +206,7 @@ type ImageRemoveOptions struct { type ImageSearchOptions struct { RegistryAuth string PrivilegeFunc RequestPrivilegeFunc + Filters filters.Args } // ImageTagOptions holds parameters to tag an image 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 39f6a22516..2446c1904d 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 @@ -136,30 +136,49 @@ func (n UTSMode) Valid() bool { return true } -// PidMode represents the pid stack of the container. +// PidMode represents the pid namespace of the container. type PidMode string -// IsPrivate indicates whether the container uses its private pid stack. +// IsPrivate indicates whether the container uses its own new pid namespace. func (n PidMode) IsPrivate() bool { - return !(n.IsHost()) + return !(n.IsHost() || n.IsContainer()) } -// IsHost indicates whether the container uses the host's pid stack. +// IsHost indicates whether the container uses the host's pid namespace. func (n PidMode) IsHost() bool { return n == "host" } -// Valid indicates whether the pid stack is valid. +// IsContainer indicates whether the container uses a container's pid namespace. +func (n PidMode) IsContainer() bool { + parts := strings.SplitN(string(n), ":", 2) + return len(parts) > 1 && parts[0] == "container" +} + +// Valid indicates whether the pid namespace is valid. func (n PidMode) Valid() bool { parts := strings.Split(string(n), ":") switch mode := parts[0]; mode { case "", "host": + case "container": + if len(parts) != 2 || parts[1] == "" { + return false + } default: return false } return true } +// Container returns the name of the container whose pid namespace is going to be used. +func (n PidMode) Container() string { + parts := strings.SplitN(string(n), ":", 2) + if len(parts) > 1 { + return parts[1] + } + return "" +} + // DeviceMapping represents the device mapping between the host and the container. type DeviceMapping struct { PathOnHost string diff --git a/vendor/src/github.com/docker/engine-api/types/registry/registry.go b/vendor/src/github.com/docker/engine-api/types/registry/registry.go index 8a6fe70ea7..d2aca6f024 100644 --- a/vendor/src/github.com/docker/engine-api/types/registry/registry.go +++ b/vendor/src/github.com/docker/engine-api/types/registry/registry.go @@ -78,12 +78,10 @@ type IndexInfo struct { type SearchResult struct { // StarCount indicates the number of stars this repository has StarCount int `json:"star_count"` - // IsOfficial indicates whether the result is an official repository or not + // IsOfficial is true if the result is from an official repository. IsOfficial bool `json:"is_official"` // Name is the name of the repository Name string `json:"name"` - // IsTrusted indicates whether the result is trusted - IsTrusted bool `json:"is_trusted"` // IsAutomated indicates whether the result is automated IsAutomated bool `json:"is_automated"` // Description is a textual description of the repository