mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #21053 from WeiZhang555/vendor-engine-api
Vendor docker/engine-api
This commit is contained in:
commit
9bfdb93e3a
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 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 7f6071353fc48f69d2328c4ebe8f3bd0f7c75da4
|
clone git github.com/docker/engine-api 9bab0d5b73872e53dfadfa055dcc519e57b09439
|
||||||
clone git github.com/RackSec/srslog 6eb773f331e46fbba8eecb8e794e635e75fc04de
|
clone git github.com/RackSec/srslog 6eb773f331e46fbba8eecb8e794e635e75fc04de
|
||||||
clone git github.com/imdario/mergo 0.2.1
|
clone git github.com/imdario/mergo 0.2.1
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// +build windows darwin
|
|
||||||
|
|
||||||
package client
|
package client
|
||||||
|
|
||||||
// DefaultDockerHost defines os specific default if DOCKER_HOST is unset
|
// 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"`
|
Email string `json:"email,omitempty"`
|
||||||
|
|
||||||
ServerAddress string `json:"serveraddress,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"`
|
RegistryToken string `json:"registrytoken,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -239,6 +239,7 @@ type HostConfig struct {
|
||||||
NetworkMode NetworkMode // Network mode to use for the container
|
NetworkMode NetworkMode // Network mode to use for the container
|
||||||
PortBindings nat.PortMap // Port mapping between the exposed port (container) and the host
|
PortBindings nat.PortMap // Port mapping between the exposed port (container) and the host
|
||||||
RestartPolicy RestartPolicy // Restart policy to be used for the container
|
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
|
VolumeDriver string // Name of the volume driver used to mount volumes
|
||||||
VolumesFrom []string // List of volumes to take from other container
|
VolumesFrom []string // List of volumes to take from other container
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package container
|
package container
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -79,20 +78,6 @@ func (n NetworkMode) NetworkName() string {
|
||||||
return ""
|
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
|
//UserDefined indicates user-created network
|
||||||
func (n NetworkMode) UserDefined() string {
|
func (n NetworkMode) UserDefined() string {
|
||||||
if n.IsUserDefined() {
|
if n.IsUserDefined() {
|
||||||
|
|
|
@ -46,7 +46,7 @@ type EndpointSettings struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NetworkingConfig represents the container's networking configuration for each of its interfaces
|
// 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 {
|
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 {
|
type AuthResponse struct {
|
||||||
// Status is the authentication status
|
// Status is the authentication status
|
||||||
Status string `json:"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:
|
// ContainerWaitResponse contains response of Remote API:
|
||||||
|
|
Loading…
Add table
Reference in a new issue