Vendor docker/engine-api
Vendor docker/engine-api 9bab0d5b73872e53dfadfa055dcc519e57b09439 Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
This commit is contained in:
parent
0771230daa
commit
f446771f0b
9 changed files with 18 additions and 57 deletions
|
@ -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 7f6071353fc48f69d2328c4ebe8f3bd0f7c75da4
|
||||
clone git github.com/docker/engine-api 9bab0d5b73872e53dfadfa055dcc519e57b09439
|
||||
clone git github.com/RackSec/srslog 6eb773f331e46fbba8eecb8e794e635e75fc04de
|
||||
clone git github.com/imdario/mergo 0.2.1
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
// +build windows darwin
|
||||
|
||||
package client
|
||||
|
||||
// DefaultDockerHost defines os specific default if DOCKER_HOST is unset
|
4
vendor/src/github.com/docker/engine-api/client/client_windows.go
vendored
Normal file
4
vendor/src/github.com/docker/engine-api/client/client_windows.go
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
package client
|
||||
|
||||
// DefaultDockerHost defines os specific default if DOCKER_HOST is unset
|
||||
const DefaultDockerHost = "npipe:////./pipe/docker_engine"
|
|
@ -1,37 +0,0 @@
|
|||
// +build test
|
||||
|
||||
package transport
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/tls"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type mockClient struct {
|
||||
*tlsInfo
|
||||
do func(*http.Request) (*http.Response, error)
|
||||
}
|
||||
|
||||
// NewMockClient returns a mocked client that runs the function supplied as `client.Do` call
|
||||
func NewMockClient(tlsConfig *tls.Config, doer func(*http.Request) (*http.Response, error)) Client {
|
||||
return mockClient{
|
||||
tlsInfo: &tlsInfo{tlsConfig},
|
||||
do: doer,
|
||||
}
|
||||
}
|
||||
|
||||
// Do executes the supplied function for the mock.
|
||||
func (m mockClient) Do(req *http.Request) (*http.Response, error) {
|
||||
return m.do(req)
|
||||
}
|
||||
|
||||
func ErrorMock(statusCode int, message string) func(req *http.Request) (*http.Response, error) {
|
||||
return func(req *http.Request) (*http.Response, error) {
|
||||
return &http.Response{
|
||||
StatusCode: statusCode,
|
||||
Body: ioutil.NopCloser(bytes.NewReader([]byte(message))),
|
||||
}, nil
|
||||
}
|
||||
}
|
|
@ -12,5 +12,11 @@ type AuthConfig struct {
|
|||
Email string `json:"email,omitempty"`
|
||||
|
||||
ServerAddress string `json:"serveraddress,omitempty"`
|
||||
|
||||
// IdentityToken is used to authenticate the user and get
|
||||
// an access token for the registry.
|
||||
IdentityToken string `json:"identitytoken,omitempty"`
|
||||
|
||||
// RegistryToken is a bearer token to be sent to a registry
|
||||
RegistryToken string `json:"registrytoken,omitempty"`
|
||||
}
|
||||
|
|
|
@ -239,6 +239,7 @@ type HostConfig struct {
|
|||
NetworkMode NetworkMode // Network mode to use for the container
|
||||
PortBindings nat.PortMap // Port mapping between the exposed port (container) and the host
|
||||
RestartPolicy RestartPolicy // Restart policy to be used for the container
|
||||
AutoRemove bool // Automatically remove container when it exits
|
||||
VolumeDriver string // Name of the volume driver used to mount volumes
|
||||
VolumesFrom []string // List of volumes to take from other container
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package container
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
@ -79,20 +78,6 @@ func (n NetworkMode) NetworkName() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
// ValidateIsolation performs platform specific validation of the
|
||||
// isolation technology in the hostconfig structure. Windows supports 'default' (or
|
||||
// blank), 'process', or 'hyperv'.
|
||||
func ValidateIsolation(hc *HostConfig) error {
|
||||
// We may not be passed a host config, such as in the case of docker commit
|
||||
if hc == nil {
|
||||
return nil
|
||||
}
|
||||
if !hc.Isolation.IsValid() {
|
||||
return fmt.Errorf("invalid --isolation: %q. Windows supports 'default', 'process', or 'hyperv'", hc.Isolation)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
//UserDefined indicates user-created network
|
||||
func (n NetworkMode) UserDefined() string {
|
||||
if n.IsUserDefined() {
|
||||
|
|
|
@ -46,7 +46,7 @@ type EndpointSettings struct {
|
|||
}
|
||||
|
||||
// NetworkingConfig represents the container's networking configuration for each of its interfaces
|
||||
// Carries the networink configs specified in the `docker run` and `docker network connect` commands
|
||||
// Carries the networking configs specified in the `docker run` and `docker network connect` commands
|
||||
type NetworkingConfig struct {
|
||||
EndpointsConfig map[string]*EndpointSettings // Endpoint configs for each conencting network
|
||||
EndpointsConfig map[string]*EndpointSettings // Endpoint configs for each connecting network
|
||||
}
|
||||
|
|
|
@ -39,6 +39,10 @@ type ContainerUpdateResponse struct {
|
|||
type AuthResponse struct {
|
||||
// Status is the authentication status
|
||||
Status string `json:"Status"`
|
||||
|
||||
// IdentityToken is an opaque token used for authenticating
|
||||
// a user after a successful login.
|
||||
IdentityToken string `json:"IdentityToken,omitempty"`
|
||||
}
|
||||
|
||||
// ContainerWaitResponse contains response of Remote API:
|
||||
|
|
Loading…
Reference in a new issue