mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Update engine-api to 1fb8f09960cc32b9648495a422c960fb2a4f8a09
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
parent
bb125650c9
commit
97d95604e0
6 changed files with 37 additions and 10 deletions
|
@ -76,7 +76,7 @@ func (cli *DockerCli) CmdSearch(args ...string) error {
|
||||||
|
|
||||||
}
|
}
|
||||||
fmt.Fprint(w, "\t")
|
fmt.Fprint(w, "\t")
|
||||||
if res.IsAutomated || res.IsTrusted {
|
if res.IsAutomated {
|
||||||
fmt.Fprint(w, "[OK]")
|
fmt.Fprint(w, "[OK]")
|
||||||
}
|
}
|
||||||
fmt.Fprint(w, "\n")
|
fmt.Fprint(w, "\n")
|
||||||
|
|
|
@ -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 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 009426d98aa84d199210a897dbb60bfee541877d
|
clone git github.com/docker/engine-api 1fb8f09960cc32b9648495a422c960fb2a4f8a09
|
||||||
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
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"github.com/docker/engine-api/types"
|
"github.com/docker/engine-api/types"
|
||||||
|
"github.com/docker/engine-api/types/filters"
|
||||||
"github.com/docker/engine-api/types/registry"
|
"github.com/docker/engine-api/types/registry"
|
||||||
"golang.org/x/net/context"
|
"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 := url.Values{}
|
||||||
query.Set("term", term)
|
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)
|
resp, err := cli.tryImageSearch(ctx, query, options.RegistryAuth)
|
||||||
if resp.statusCode == http.StatusUnauthorized {
|
if resp.statusCode == http.StatusUnauthorized {
|
||||||
newAuthHeader, privilegeErr := options.PrivilegeFunc()
|
newAuthHeader, privilegeErr := options.PrivilegeFunc()
|
||||||
|
|
|
@ -206,6 +206,7 @@ type ImageRemoveOptions struct {
|
||||||
type ImageSearchOptions struct {
|
type ImageSearchOptions struct {
|
||||||
RegistryAuth string
|
RegistryAuth string
|
||||||
PrivilegeFunc RequestPrivilegeFunc
|
PrivilegeFunc RequestPrivilegeFunc
|
||||||
|
Filters filters.Args
|
||||||
}
|
}
|
||||||
|
|
||||||
// ImageTagOptions holds parameters to tag an image
|
// ImageTagOptions holds parameters to tag an image
|
||||||
|
|
|
@ -136,30 +136,49 @@ func (n UTSMode) Valid() bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// PidMode represents the pid stack of the container.
|
// PidMode represents the pid namespace of the container.
|
||||||
type PidMode string
|
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 {
|
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 {
|
func (n PidMode) IsHost() bool {
|
||||||
return n == "host"
|
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 {
|
func (n PidMode) Valid() bool {
|
||||||
parts := strings.Split(string(n), ":")
|
parts := strings.Split(string(n), ":")
|
||||||
switch mode := parts[0]; mode {
|
switch mode := parts[0]; mode {
|
||||||
case "", "host":
|
case "", "host":
|
||||||
|
case "container":
|
||||||
|
if len(parts) != 2 || parts[1] == "" {
|
||||||
|
return false
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true
|
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.
|
// DeviceMapping represents the device mapping between the host and the container.
|
||||||
type DeviceMapping struct {
|
type DeviceMapping struct {
|
||||||
PathOnHost string
|
PathOnHost string
|
||||||
|
|
|
@ -78,12 +78,10 @@ type IndexInfo struct {
|
||||||
type SearchResult struct {
|
type SearchResult struct {
|
||||||
// StarCount indicates the number of stars this repository has
|
// StarCount indicates the number of stars this repository has
|
||||||
StarCount int `json:"star_count"`
|
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"`
|
IsOfficial bool `json:"is_official"`
|
||||||
// Name is the name of the repository
|
// Name is the name of the repository
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
// IsTrusted indicates whether the result is trusted
|
|
||||||
IsTrusted bool `json:"is_trusted"`
|
|
||||||
// IsAutomated indicates whether the result is automated
|
// IsAutomated indicates whether the result is automated
|
||||||
IsAutomated bool `json:"is_automated"`
|
IsAutomated bool `json:"is_automated"`
|
||||||
// Description is a textual description of the repository
|
// Description is a textual description of the repository
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue