mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Vendor engine-api with pull fixes
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
This commit is contained in:
parent
e385faa35b
commit
ba901bb062
12 changed files with 49 additions and 12 deletions
|
@ -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 a2999dbd3471ffe167f2aec7dccb9fa9b016dcbc
|
clone git github.com/docker/engine-api b7e5e1ecd6121d7b643d607f20ced0cb5c93739c
|
||||||
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
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ type Client struct {
|
||||||
addr string
|
addr string
|
||||||
// basePath holds the path to prepend to the requests.
|
// basePath holds the path to prepend to the requests.
|
||||||
basePath string
|
basePath string
|
||||||
// transport is the interface to sends request with, it implements transport.Client.
|
// transport is the interface to send request with, it implements transport.Client.
|
||||||
transport transport.Client
|
transport transport.Client
|
||||||
// version of the server to talk to.
|
// version of the server to talk to.
|
||||||
version string
|
version string
|
||||||
|
|
|
@ -27,7 +27,7 @@ func (cli *Client) ImagePull(ctx context.Context, ref string, options types.Imag
|
||||||
|
|
||||||
query := url.Values{}
|
query := url.Values{}
|
||||||
query.Set("fromImage", repository)
|
query.Set("fromImage", repository)
|
||||||
if tag != "" {
|
if tag != "" && !options.All {
|
||||||
query.Set("tag", tag)
|
query.Set("tag", tag)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@ import (
|
||||||
|
|
||||||
distreference "github.com/docker/distribution/reference"
|
distreference "github.com/docker/distribution/reference"
|
||||||
"github.com/docker/engine-api/types"
|
"github.com/docker/engine-api/types"
|
||||||
"github.com/docker/engine-api/types/reference"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// ImagePush requests the docker host to push an image to a remote registry.
|
// ImagePush requests the docker host to push an image to a remote registry.
|
||||||
|
@ -27,7 +26,10 @@ func (cli *Client) ImagePush(ctx context.Context, ref string, options types.Imag
|
||||||
return nil, errors.New("cannot push a digest reference")
|
return nil, errors.New("cannot push a digest reference")
|
||||||
}
|
}
|
||||||
|
|
||||||
tag := reference.GetTagFromNamedRef(distributionRef)
|
var tag = ""
|
||||||
|
if nameTaggedRef, isNamedTagged := distributionRef.(distreference.NamedTagged); isNamedTagged {
|
||||||
|
tag = nameTaggedRef.Tag()
|
||||||
|
}
|
||||||
|
|
||||||
query := url.Values{}
|
query := url.Values{}
|
||||||
query.Set("tag", tag)
|
query.Set("tag", tag)
|
||||||
|
|
|
@ -85,6 +85,11 @@ func (cli *Client) sendClientRequest(ctx context.Context, method, path string, q
|
||||||
}
|
}
|
||||||
|
|
||||||
req, err := cli.newRequest(method, path, query, body, headers)
|
req, err := cli.newRequest(method, path, query, body, headers)
|
||||||
|
if cli.proto == "unix" || cli.proto == "npipe" {
|
||||||
|
// For local communications, it doesn't matter what the host is. We just
|
||||||
|
// need a valid and meaningful host name. (See #189)
|
||||||
|
req.Host = "docker"
|
||||||
|
}
|
||||||
req.URL.Host = cli.addr
|
req.URL.Host = cli.addr
|
||||||
req.URL.Scheme = cli.transport.Scheme()
|
req.URL.Scheme = cli.transport.Scheme()
|
||||||
|
|
||||||
|
|
27
vendor/src/github.com/docker/engine-api/client/transport/cancellable/LICENSE
vendored
Normal file
27
vendor/src/github.com/docker/engine-api/client/transport/cancellable/LICENSE
vendored
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
Copyright (c) 2009 The Go Authors. All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are
|
||||||
|
met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above
|
||||||
|
copyright notice, this list of conditions and the following disclaimer
|
||||||
|
in the documentation and/or other materials provided with the
|
||||||
|
distribution.
|
||||||
|
* Neither the name of Google Inc. nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived from
|
||||||
|
this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@ -178,6 +178,7 @@ type ImageLoadResponse struct {
|
||||||
|
|
||||||
// ImagePullOptions holds information to pull images.
|
// ImagePullOptions holds information to pull images.
|
||||||
type ImagePullOptions struct {
|
type ImagePullOptions struct {
|
||||||
|
All bool
|
||||||
RegistryAuth string // RegistryAuth is the base64 encoded credentials for the registry
|
RegistryAuth string // RegistryAuth is the base64 encoded credentials for the registry
|
||||||
PrivilegeFunc RequestPrivilegeFunc
|
PrivilegeFunc RequestPrivilegeFunc
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ type ContainerCommitConfig struct {
|
||||||
Config *container.Config
|
Config *container.Config
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExecConfig is a small subset of the Config struct that hold the configuration
|
// ExecConfig is a small subset of the Config struct that holds the configuration
|
||||||
// for the exec feature of docker.
|
// for the exec feature of docker.
|
||||||
type ExecConfig struct {
|
type ExecConfig struct {
|
||||||
User string // User that will run the command
|
User string // User that will run the command
|
||||||
|
|
|
@ -25,7 +25,7 @@ func (i Isolation) IsDefault() bool {
|
||||||
// IpcMode represents the container ipc stack.
|
// IpcMode represents the container ipc stack.
|
||||||
type IpcMode string
|
type IpcMode string
|
||||||
|
|
||||||
// IsPrivate indicates whether the container uses it's private ipc stack.
|
// IsPrivate indicates whether the container uses its private ipc stack.
|
||||||
func (n IpcMode) IsPrivate() bool {
|
func (n IpcMode) IsPrivate() bool {
|
||||||
return !(n.IsHost() || n.IsContainer())
|
return !(n.IsHost() || n.IsContainer())
|
||||||
}
|
}
|
||||||
|
@ -186,7 +186,7 @@ func (rp *RestartPolicy) IsAlways() bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsOnFailure indicates whether the container has the "on-failure" restart policy.
|
// IsOnFailure indicates whether the container has the "on-failure" restart policy.
|
||||||
// This means the contain will automatically restart of exiting with a non-zero exit status.
|
// This means the container will automatically restart of exiting with a non-zero exit status.
|
||||||
func (rp *RestartPolicy) IsOnFailure() bool {
|
func (rp *RestartPolicy) IsOnFailure() bool {
|
||||||
return rp.Name == "on-failure"
|
return rp.Name == "on-failure"
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
distreference "github.com/docker/distribution/reference"
|
distreference "github.com/docker/distribution/reference"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Parse parses the given references and return the repository and
|
// Parse parses the given references and returns the repository and
|
||||||
// tag (if present) from it. If there is an error during parsing, it will
|
// tag (if present) from it. If there is an error during parsing, it will
|
||||||
// return an error.
|
// return an error.
|
||||||
func Parse(ref string) (string, string, error) {
|
func Parse(ref string) (string, string, error) {
|
||||||
|
@ -18,7 +18,7 @@ func Parse(ref string) (string, string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetTagFromNamedRef returns a tag from the specified reference.
|
// GetTagFromNamedRef returns a tag from the specified reference.
|
||||||
// This function is necessary as long as the docker "server" api make the distinction between repository
|
// This function is necessary as long as the docker "server" api makes the distinction between repository
|
||||||
// and tags.
|
// and tags.
|
||||||
func GetTagFromNamedRef(ref distreference.Named) string {
|
func GetTagFromNamedRef(ref distreference.Named) string {
|
||||||
var tag string
|
var tag string
|
||||||
|
@ -27,6 +27,8 @@ func GetTagFromNamedRef(ref distreference.Named) string {
|
||||||
tag = x.Digest().String()
|
tag = x.Digest().String()
|
||||||
case distreference.NamedTagged:
|
case distreference.NamedTagged:
|
||||||
tag = x.Tag()
|
tag = x.Tag()
|
||||||
|
default:
|
||||||
|
tag = "latest"
|
||||||
}
|
}
|
||||||
return tag
|
return tag
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ type SearchResult struct {
|
||||||
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"`
|
||||||
// IsOfficial indicates whether the result is trusted
|
// IsTrusted indicates whether the result is trusted
|
||||||
IsTrusted bool `json:"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"`
|
||||||
|
|
|
@ -27,7 +27,7 @@ type ContainerConfig struct {
|
||||||
VolumeDriver string
|
VolumeDriver string
|
||||||
}
|
}
|
||||||
|
|
||||||
// StatsJSON is a backcompatibility struct used in Stats for API prior to 1.21
|
// StatsJSON is a backcompatibility struct used in Stats for APIs prior to 1.21
|
||||||
type StatsJSON struct {
|
type StatsJSON struct {
|
||||||
types.Stats
|
types.Stats
|
||||||
Network types.NetworkStats `json:"network,omitempty"`
|
Network types.NetworkStats `json:"network,omitempty"`
|
||||||
|
|
Loading…
Add table
Reference in a new issue