Merge component 'engine' from git@github.com:moby/moby master
This commit is contained in:
@ -11,6 +11,9 @@ import (
|
||||
|
||||
// ConfigInspectWithRaw returns the config information with raw data
|
||||
func (cli *Client) ConfigInspectWithRaw(ctx context.Context, id string) (swarm.Config, []byte, error) {
|
||||
if id == "" {
|
||||
return swarm.Config{}, nil, objectNotFoundError{object: "config", id: id}
|
||||
}
|
||||
if err := cli.NewVersionError("1.30", "config inspect"); err != nil {
|
||||
return swarm.Config{}, nil, err
|
||||
}
|
||||
|
||||
@ -10,10 +10,34 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
func TestConfigInspectNotFound(t *testing.T) {
|
||||
client := &Client{
|
||||
client: newMockClient(errorMock(http.StatusNotFound, "Server error")),
|
||||
}
|
||||
|
||||
_, _, err := client.ConfigInspectWithRaw(context.Background(), "unknown")
|
||||
if err == nil || !IsErrNotFound(err) {
|
||||
t.Fatalf("expected a NotFoundError error, got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestConfigInspectWithEmptyID(t *testing.T) {
|
||||
client := &Client{
|
||||
client: newMockClient(func(req *http.Request) (*http.Response, error) {
|
||||
return nil, errors.New("should not make request")
|
||||
}),
|
||||
}
|
||||
_, _, err := client.ConfigInspectWithRaw(context.Background(), "")
|
||||
if !IsErrNotFound(err) {
|
||||
t.Fatalf("Expected NotFoundError, got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestConfigInspectUnsupported(t *testing.T) {
|
||||
client := &Client{
|
||||
version: "1.29",
|
||||
|
||||
@ -12,6 +12,9 @@ import (
|
||||
|
||||
// ContainerInspect returns the container information.
|
||||
func (cli *Client) ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error) {
|
||||
if containerID == "" {
|
||||
return types.ContainerJSON{}, objectNotFoundError{object: "container", id: containerID}
|
||||
}
|
||||
serverResp, err := cli.get(ctx, "/containers/"+containerID+"/json", nil, nil)
|
||||
if err != nil {
|
||||
return types.ContainerJSON{}, wrapResponseError(err, serverResp, "container", containerID)
|
||||
@ -25,6 +28,9 @@ func (cli *Client) ContainerInspect(ctx context.Context, containerID string) (ty
|
||||
|
||||
// ContainerInspectWithRaw returns the container information and its raw representation.
|
||||
func (cli *Client) ContainerInspectWithRaw(ctx context.Context, containerID string, getSize bool) (types.ContainerJSON, []byte, error) {
|
||||
if containerID == "" {
|
||||
return types.ContainerJSON{}, nil, objectNotFoundError{object: "container", id: containerID}
|
||||
}
|
||||
query := url.Values{}
|
||||
if getSize {
|
||||
query.Set("size", "1")
|
||||
|
||||
@ -10,6 +10,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
@ -35,6 +36,18 @@ func TestContainerInspectContainerNotFound(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerInspectWithEmptyID(t *testing.T) {
|
||||
client := &Client{
|
||||
client: newMockClient(func(req *http.Request) (*http.Response, error) {
|
||||
return nil, errors.New("should not make request")
|
||||
}),
|
||||
}
|
||||
_, _, err := client.ContainerInspectWithRaw(context.Background(), "", true)
|
||||
if !IsErrNotFound(err) {
|
||||
t.Fatalf("Expected NotFoundError, got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestContainerInspect(t *testing.T) {
|
||||
expectedURL := "/containers/container_id/json"
|
||||
client := &Client{
|
||||
|
||||
@ -12,6 +12,9 @@ import (
|
||||
func (cli *Client) DistributionInspect(ctx context.Context, image, encodedRegistryAuth string) (registrytypes.DistributionInspect, error) {
|
||||
// Contact the registry to retrieve digest and platform information
|
||||
var distributionInspect registrytypes.DistributionInspect
|
||||
if image == "" {
|
||||
return distributionInspect, objectNotFoundError{object: "distribution", id: image}
|
||||
}
|
||||
|
||||
if err := cli.NewVersionError("1.30", "distribution inspect"); err != nil {
|
||||
return distributionInspect, err
|
||||
|
||||
@ -4,6 +4,7 @@ import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
@ -16,3 +17,15 @@ func TestDistributionInspectUnsupported(t *testing.T) {
|
||||
_, err := client.DistributionInspect(context.Background(), "foobar:1.0", "")
|
||||
assert.EqualError(t, err, `"distribution inspect" requires API version 1.30, but the Docker daemon API version is 1.29`)
|
||||
}
|
||||
|
||||
func TestDistributionInspectWithEmptyID(t *testing.T) {
|
||||
client := &Client{
|
||||
client: newMockClient(func(req *http.Request) (*http.Response, error) {
|
||||
return nil, errors.New("should not make request")
|
||||
}),
|
||||
}
|
||||
_, err := client.DistributionInspect(context.Background(), "", "")
|
||||
if !IsErrNotFound(err) {
|
||||
t.Fatalf("Expected NotFoundError, got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,6 +11,9 @@ import (
|
||||
|
||||
// ImageInspectWithRaw returns the image information and its raw representation.
|
||||
func (cli *Client) ImageInspectWithRaw(ctx context.Context, imageID string) (types.ImageInspect, []byte, error) {
|
||||
if imageID == "" {
|
||||
return types.ImageInspect{}, nil, objectNotFoundError{object: "image", id: imageID}
|
||||
}
|
||||
serverResp, err := cli.get(ctx, "/images/"+imageID+"/json", nil, nil)
|
||||
if err != nil {
|
||||
return types.ImageInspect{}, nil, wrapResponseError(err, serverResp, "image", imageID)
|
||||
|
||||
@ -11,6 +11,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
@ -36,6 +37,18 @@ func TestImageInspectImageNotFound(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestImageInspectWithEmptyID(t *testing.T) {
|
||||
client := &Client{
|
||||
client: newMockClient(func(req *http.Request) (*http.Response, error) {
|
||||
return nil, errors.New("should not make request")
|
||||
}),
|
||||
}
|
||||
_, _, err := client.ImageInspectWithRaw(context.Background(), "")
|
||||
if !IsErrNotFound(err) {
|
||||
t.Fatalf("Expected NotFoundError, got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestImageInspect(t *testing.T) {
|
||||
expectedURL := "/images/image_id/json"
|
||||
expectedTags := []string{"tag1", "tag2"}
|
||||
|
||||
@ -18,6 +18,9 @@ func (cli *Client) NetworkInspect(ctx context.Context, networkID string, options
|
||||
|
||||
// NetworkInspectWithRaw returns the information for a specific network configured in the docker host and its raw representation.
|
||||
func (cli *Client) NetworkInspectWithRaw(ctx context.Context, networkID string, options types.NetworkInspectOptions) (types.NetworkResource, []byte, error) {
|
||||
if networkID == "" {
|
||||
return types.NetworkResource{}, nil, objectNotFoundError{object: "network", id: networkID}
|
||||
}
|
||||
var (
|
||||
networkResource types.NetworkResource
|
||||
resp serverResponse
|
||||
|
||||
@ -11,6 +11,7 @@ import (
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/network"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
@ -34,6 +35,18 @@ func TestNetworkInspectNotFoundError(t *testing.T) {
|
||||
assert.True(t, IsErrNotFound(err))
|
||||
}
|
||||
|
||||
func TestNetworkInspectWithEmptyID(t *testing.T) {
|
||||
client := &Client{
|
||||
client: newMockClient(func(req *http.Request) (*http.Response, error) {
|
||||
return nil, errors.New("should not make request")
|
||||
}),
|
||||
}
|
||||
_, _, err := client.NetworkInspectWithRaw(context.Background(), "", types.NetworkInspectOptions{})
|
||||
if !IsErrNotFound(err) {
|
||||
t.Fatalf("Expected NotFoundError, got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNetworkInspect(t *testing.T) {
|
||||
expectedURL := "/networks/network_id"
|
||||
client := &Client{
|
||||
|
||||
@ -11,6 +11,9 @@ import (
|
||||
|
||||
// NodeInspectWithRaw returns the node information.
|
||||
func (cli *Client) NodeInspectWithRaw(ctx context.Context, nodeID string) (swarm.Node, []byte, error) {
|
||||
if nodeID == "" {
|
||||
return swarm.Node{}, nil, objectNotFoundError{object: "node", id: nodeID}
|
||||
}
|
||||
serverResp, err := cli.get(ctx, "/nodes/"+nodeID, nil, nil)
|
||||
if err != nil {
|
||||
return swarm.Node{}, nil, wrapResponseError(err, serverResp, "node", nodeID)
|
||||
|
||||
@ -10,6 +10,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
@ -35,6 +36,18 @@ func TestNodeInspectNodeNotFound(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestNodeInspectWithEmptyID(t *testing.T) {
|
||||
client := &Client{
|
||||
client: newMockClient(func(req *http.Request) (*http.Response, error) {
|
||||
return nil, errors.New("should not make request")
|
||||
}),
|
||||
}
|
||||
_, _, err := client.NodeInspectWithRaw(context.Background(), "")
|
||||
if !IsErrNotFound(err) {
|
||||
t.Fatalf("Expected NotFoundError, got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNodeInspect(t *testing.T) {
|
||||
expectedURL := "/nodes/node_id"
|
||||
client := &Client{
|
||||
|
||||
@ -11,6 +11,9 @@ import (
|
||||
|
||||
// PluginInspectWithRaw inspects an existing plugin
|
||||
func (cli *Client) PluginInspectWithRaw(ctx context.Context, name string) (*types.Plugin, []byte, error) {
|
||||
if name == "" {
|
||||
return nil, nil, objectNotFoundError{object: "plugin", id: name}
|
||||
}
|
||||
resp, err := cli.get(ctx, "/plugins/"+name+"/json", nil, nil)
|
||||
if err != nil {
|
||||
return nil, nil, wrapResponseError(err, resp, "plugin", name)
|
||||
|
||||
@ -10,6 +10,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
@ -24,6 +25,18 @@ func TestPluginInspectError(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestPluginInspectWithEmptyID(t *testing.T) {
|
||||
client := &Client{
|
||||
client: newMockClient(func(req *http.Request) (*http.Response, error) {
|
||||
return nil, errors.New("should not make request")
|
||||
}),
|
||||
}
|
||||
_, _, err := client.PluginInspectWithRaw(context.Background(), "")
|
||||
if !IsErrNotFound(err) {
|
||||
t.Fatalf("Expected NotFoundError, got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPluginInspect(t *testing.T) {
|
||||
expectedURL := "/plugins/plugin_name"
|
||||
client := &Client{
|
||||
|
||||
@ -14,6 +14,9 @@ func (cli *Client) SecretInspectWithRaw(ctx context.Context, id string) (swarm.S
|
||||
if err := cli.NewVersionError("1.25", "secret inspect"); err != nil {
|
||||
return swarm.Secret{}, nil, err
|
||||
}
|
||||
if id == "" {
|
||||
return swarm.Secret{}, nil, objectNotFoundError{object: "secret", id: id}
|
||||
}
|
||||
resp, err := cli.get(ctx, "/secrets/"+id, nil, nil)
|
||||
if err != nil {
|
||||
return swarm.Secret{}, nil, wrapResponseError(err, resp, "secret", id)
|
||||
|
||||
@ -10,6 +10,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
@ -47,6 +48,18 @@ func TestSecretInspectSecretNotFound(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestSecretInspectWithEmptyID(t *testing.T) {
|
||||
client := &Client{
|
||||
client: newMockClient(func(req *http.Request) (*http.Response, error) {
|
||||
return nil, errors.New("should not make request")
|
||||
}),
|
||||
}
|
||||
_, _, err := client.SecretInspectWithRaw(context.Background(), "")
|
||||
if !IsErrNotFound(err) {
|
||||
t.Fatalf("Expected NotFoundError, got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSecretInspect(t *testing.T) {
|
||||
expectedURL := "/v1.25/secrets/secret_id"
|
||||
client := &Client{
|
||||
|
||||
@ -14,6 +14,9 @@ import (
|
||||
|
||||
// ServiceInspectWithRaw returns the service information and the raw data.
|
||||
func (cli *Client) ServiceInspectWithRaw(ctx context.Context, serviceID string, opts types.ServiceInspectOptions) (swarm.Service, []byte, error) {
|
||||
if serviceID == "" {
|
||||
return swarm.Service{}, nil, objectNotFoundError{object: "service", id: serviceID}
|
||||
}
|
||||
query := url.Values{}
|
||||
query.Set("insertDefaults", fmt.Sprintf("%v", opts.InsertDefaults))
|
||||
serverResp, err := cli.get(ctx, "/services/"+serviceID, query, nil)
|
||||
|
||||
@ -11,6 +11,7 @@ import (
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
@ -36,6 +37,18 @@ func TestServiceInspectServiceNotFound(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestServiceInspectWithEmptyID(t *testing.T) {
|
||||
client := &Client{
|
||||
client: newMockClient(func(req *http.Request) (*http.Response, error) {
|
||||
return nil, errors.New("should not make request")
|
||||
}),
|
||||
}
|
||||
_, _, err := client.ServiceInspectWithRaw(context.Background(), "", types.ServiceInspectOptions{})
|
||||
if !IsErrNotFound(err) {
|
||||
t.Fatalf("Expected NotFoundError, got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestServiceInspect(t *testing.T) {
|
||||
expectedURL := "/services/service_id"
|
||||
client := &Client{
|
||||
|
||||
@ -11,6 +11,9 @@ import (
|
||||
|
||||
// TaskInspectWithRaw returns the task information and its raw representation..
|
||||
func (cli *Client) TaskInspectWithRaw(ctx context.Context, taskID string) (swarm.Task, []byte, error) {
|
||||
if taskID == "" {
|
||||
return swarm.Task{}, nil, objectNotFoundError{object: "task", id: taskID}
|
||||
}
|
||||
serverResp, err := cli.get(ctx, "/tasks/"+taskID, nil, nil)
|
||||
if err != nil {
|
||||
return swarm.Task{}, nil, wrapResponseError(err, serverResp, "task", taskID)
|
||||
|
||||
@ -10,6 +10,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
@ -24,6 +25,18 @@ func TestTaskInspectError(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestTaskInspectWithEmptyID(t *testing.T) {
|
||||
client := &Client{
|
||||
client: newMockClient(func(req *http.Request) (*http.Response, error) {
|
||||
return nil, errors.New("should not make request")
|
||||
}),
|
||||
}
|
||||
_, _, err := client.TaskInspectWithRaw(context.Background(), "")
|
||||
if !IsErrNotFound(err) {
|
||||
t.Fatalf("Expected NotFoundError, got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTaskInspect(t *testing.T) {
|
||||
expectedURL := "/tasks/task_id"
|
||||
client := &Client{
|
||||
|
||||
@ -4,7 +4,6 @@ import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"path"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"golang.org/x/net/context"
|
||||
@ -18,15 +17,12 @@ func (cli *Client) VolumeInspect(ctx context.Context, volumeID string) (types.Vo
|
||||
|
||||
// VolumeInspectWithRaw returns the information about a specific volume in the docker host and its raw representation
|
||||
func (cli *Client) VolumeInspectWithRaw(ctx context.Context, volumeID string) (types.Volume, []byte, error) {
|
||||
// The empty ID needs to be handled here because with an empty ID the
|
||||
// request url will not contain a trailing / which calls the volume list API
|
||||
// instead of volume inspect
|
||||
if volumeID == "" {
|
||||
return types.Volume{}, nil, objectNotFoundError{object: "volume", id: volumeID}
|
||||
}
|
||||
|
||||
var volume types.Volume
|
||||
resp, err := cli.get(ctx, path.Join("/volumes", volumeID), nil, nil)
|
||||
resp, err := cli.get(ctx, "/volumes/"+volumeID, nil, nil)
|
||||
if err != nil {
|
||||
return volume, nil, wrapResponseError(err, resp, "volume", volumeID)
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ import (
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/internal/testutil"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"golang.org/x/net/context"
|
||||
@ -35,20 +36,15 @@ func TestVolumeInspectNotFound(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestVolumeInspectWithEmptyID(t *testing.T) {
|
||||
expectedURL := "/volumes/"
|
||||
|
||||
client := &Client{
|
||||
client: newMockClient(func(req *http.Request) (*http.Response, error) {
|
||||
assert.Equal(t, req.URL.Path, expectedURL)
|
||||
return &http.Response{
|
||||
StatusCode: http.StatusNotFound,
|
||||
Body: ioutil.NopCloser(bytes.NewReader(nil)),
|
||||
}, nil
|
||||
return nil, errors.New("should not make request")
|
||||
}),
|
||||
}
|
||||
_, err := client.VolumeInspect(context.Background(), "")
|
||||
testutil.ErrorContains(t, err, "No such volume: ")
|
||||
|
||||
_, _, err := client.VolumeInspectWithRaw(context.Background(), "")
|
||||
if !IsErrNotFound(err) {
|
||||
t.Fatalf("Expected NotFoundError, got %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestVolumeInspect(t *testing.T) {
|
||||
|
||||
@ -266,7 +266,7 @@ func (daemon *Daemon) setRWLayer(container *container.Container) error {
|
||||
|
||||
rwLayerOpts := &layer.CreateRWLayerOpts{
|
||||
MountLabel: container.MountLabel,
|
||||
InitFunc: daemon.getLayerInit(),
|
||||
InitFunc: setupInitLayer(daemon.idMappings),
|
||||
StorageOpt: container.HostConfig.StorageOpt,
|
||||
}
|
||||
|
||||
|
||||
@ -32,7 +32,6 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
// register graph drivers
|
||||
_ "github.com/docker/docker/daemon/graphdriver/register"
|
||||
"github.com/docker/docker/daemon/initlayer"
|
||||
"github.com/docker/docker/daemon/stats"
|
||||
dmetadata "github.com/docker/docker/distribution/metadata"
|
||||
"github.com/docker/docker/distribution/xfer"
|
||||
@ -41,7 +40,6 @@ import (
|
||||
"github.com/docker/docker/layer"
|
||||
"github.com/docker/docker/libcontainerd"
|
||||
"github.com/docker/docker/migrate/v1"
|
||||
"github.com/docker/docker/pkg/containerfs"
|
||||
"github.com/docker/docker/pkg/idtools"
|
||||
"github.com/docker/docker/pkg/locker"
|
||||
"github.com/docker/docker/pkg/plugingetter"
|
||||
@ -1141,11 +1139,6 @@ func prepareTempDir(rootDir string, rootIDs idtools.IDPair) (string, error) {
|
||||
return tmpDir, idtools.MkdirAllAndChown(tmpDir, 0700, rootIDs)
|
||||
}
|
||||
|
||||
func (daemon *Daemon) setupInitLayer(initPath containerfs.ContainerFS) error {
|
||||
rootIDs := daemon.idMappings.RootPair()
|
||||
return initlayer.Setup(initPath, rootIDs)
|
||||
}
|
||||
|
||||
func (daemon *Daemon) setGenericResources(conf *config.Config) error {
|
||||
genericResources, err := config.ParseGenericResources(conf.NodeGenericResources)
|
||||
if err != nil {
|
||||
|
||||
@ -23,7 +23,7 @@ import (
|
||||
containertypes "github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/container"
|
||||
"github.com/docker/docker/daemon/config"
|
||||
"github.com/docker/docker/image"
|
||||
"github.com/docker/docker/daemon/initlayer"
|
||||
"github.com/docker/docker/opts"
|
||||
"github.com/docker/docker/pkg/containerfs"
|
||||
"github.com/docker/docker/pkg/idtools"
|
||||
@ -1000,8 +1000,10 @@ func removeDefaultBridgeInterface() {
|
||||
}
|
||||
}
|
||||
|
||||
func (daemon *Daemon) getLayerInit() func(containerfs.ContainerFS) error {
|
||||
return daemon.setupInitLayer
|
||||
func setupInitLayer(idMappings *idtools.IDMappings) func(containerfs.ContainerFS) error {
|
||||
return func(initPath containerfs.ContainerFS) error {
|
||||
return initlayer.Setup(initPath, idMappings.RootPair())
|
||||
}
|
||||
}
|
||||
|
||||
// Parse the remapped root (user namespace) option, which can be one of:
|
||||
@ -1357,17 +1359,6 @@ func (daemon *Daemon) setDefaultIsolation() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func rootFSToAPIType(rootfs *image.RootFS) types.RootFS {
|
||||
var layers []string
|
||||
for _, l := range rootfs.DiffIDs {
|
||||
layers = append(layers, l.String())
|
||||
}
|
||||
return types.RootFS{
|
||||
Type: rootfs.Type,
|
||||
Layers: layers,
|
||||
}
|
||||
}
|
||||
|
||||
// setupDaemonProcess sets various settings for the daemon's process
|
||||
func setupDaemonProcess(config *config.Config) error {
|
||||
// setup the daemons oom_score_adj
|
||||
|
||||
@ -11,7 +11,6 @@ import (
|
||||
containertypes "github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/container"
|
||||
"github.com/docker/docker/daemon/config"
|
||||
"github.com/docker/docker/image"
|
||||
"github.com/docker/docker/pkg/containerfs"
|
||||
"github.com/docker/docker/pkg/fileutils"
|
||||
"github.com/docker/docker/pkg/idtools"
|
||||
@ -54,7 +53,7 @@ func parseSecurityOpt(container *container.Container, config *containertypes.Hos
|
||||
return nil
|
||||
}
|
||||
|
||||
func (daemon *Daemon) getLayerInit() func(containerfs.ContainerFS) error {
|
||||
func setupInitLayer(idMappings *idtools.IDMappings) func(containerfs.ContainerFS) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -629,17 +628,6 @@ func (daemon *Daemon) setDefaultIsolation() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func rootFSToAPIType(rootfs *image.RootFS) types.RootFS {
|
||||
var layers []string
|
||||
for _, l := range rootfs.DiffIDs {
|
||||
layers = append(layers, l.String())
|
||||
}
|
||||
return types.RootFS{
|
||||
Type: rootfs.Type,
|
||||
Layers: layers,
|
||||
}
|
||||
}
|
||||
|
||||
func setupDaemonProcess(config *config.Config) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import (
|
||||
|
||||
"github.com/docker/distribution/reference"
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/image"
|
||||
"github.com/docker/docker/layer"
|
||||
"github.com/docker/docker/pkg/system"
|
||||
"github.com/pkg/errors"
|
||||
@ -90,3 +91,14 @@ func (daemon *Daemon) LookupImage(name string) (*types.ImageInspect, error) {
|
||||
|
||||
return imageInspect, nil
|
||||
}
|
||||
|
||||
func rootFSToAPIType(rootfs *image.RootFS) types.RootFS {
|
||||
var layers []string
|
||||
for _, l := range rootfs.DiffIDs {
|
||||
layers = append(layers, l.String())
|
||||
}
|
||||
return types.RootFS{
|
||||
Type: rootfs.Type,
|
||||
Layers: layers,
|
||||
}
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ google.golang.org/genproto d80a6e20e776b0b17a324d0ba1ab50a39c8e8944
|
||||
# containerd
|
||||
github.com/containerd/containerd 3fa104f843ec92328912e042b767d26825f202aa
|
||||
github.com/containerd/fifo fbfb6a11ec671efbe94ad1c12c2e98773f19e1e6
|
||||
github.com/containerd/continuity 992a5f112bd2211d0983a1cc8562d2882848f3a3
|
||||
github.com/containerd/continuity d8fb8589b0e8e85b8c8bbaa8840226d0dfeb7371
|
||||
github.com/containerd/cgroups c0710c92e8b3a44681d1321dcfd1360fc5c6c089
|
||||
github.com/containerd/console 84eeaae905fa414d03e07bcd6c8d3f19e7cf180e
|
||||
github.com/containerd/go-runc 4f6e87ae043f859a38255247b49c9abc262d002f
|
||||
|
||||
3
components/engine/vendor/github.com/containerd/continuity/fs/stat_linux.go
generated
vendored
3
components/engine/vendor/github.com/containerd/continuity/fs/stat_linux.go
generated
vendored
@ -22,5 +22,6 @@ func StatMtime(st *syscall.Stat_t) syscall.Timespec {
|
||||
|
||||
// StatATimeAsTime returns st.Atim as a time.Time
|
||||
func StatATimeAsTime(st *syscall.Stat_t) time.Time {
|
||||
return time.Unix(st.Atim.Sec, st.Atim.Nsec)
|
||||
// The int64 conversions ensure the line compiles for 32-bit systems as well.
|
||||
return time.Unix(int64(st.Atim.Sec), int64(st.Atim.Nsec)) // nolint: unconvert
|
||||
}
|
||||
|
||||
7
components/engine/vendor/github.com/containerd/continuity/sysx/xattr_openbsd.go
generated
vendored
Normal file
7
components/engine/vendor/github.com/containerd/continuity/sysx/xattr_openbsd.go
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
package sysx
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var unsupported = errors.New("extended attributes unsupported on OpenBSD")
|
||||
2
components/engine/vendor/github.com/containerd/continuity/sysx/xattr_unsupported.go
generated
vendored
2
components/engine/vendor/github.com/containerd/continuity/sysx/xattr_unsupported.go
generated
vendored
@ -1,4 +1,4 @@
|
||||
// +build freebsd solaris
|
||||
// +build freebsd openbsd solaris
|
||||
|
||||
package sysx
|
||||
|
||||
|
||||
Reference in New Issue
Block a user