mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 18:31:15 +00:00
Updates Docker Engine API
This commit is contained in:
parent
f818cbeaed
commit
bf2ced837c
@ -19,7 +19,7 @@ go_library(
|
|||||||
],
|
],
|
||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = [
|
deps = [
|
||||||
"//vendor/github.com/docker/engine-api/types:go_default_library",
|
"//vendor/github.com/docker/docker/api/types:go_default_library",
|
||||||
"//vendor/github.com/golang/glog:go_default_library",
|
"//vendor/github.com/golang/glog:go_default_library",
|
||||||
"//vendor/k8s.io/api/core/v1:go_default_library",
|
"//vendor/k8s.io/api/core/v1:go_default_library",
|
||||||
"//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library",
|
"//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library",
|
||||||
@ -35,7 +35,7 @@ go_test(
|
|||||||
],
|
],
|
||||||
library = ":go_default_library",
|
library = ":go_default_library",
|
||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = ["//vendor/github.com/docker/engine-api/types:go_default_library"],
|
deps = ["//vendor/github.com/docker/docker/api/types:go_default_library"],
|
||||||
)
|
)
|
||||||
|
|
||||||
filegroup(
|
filegroup(
|
||||||
|
@ -26,7 +26,7 @@ import (
|
|||||||
|
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
|
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
"k8s.io/api/core/v1"
|
"k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/sets"
|
"k8s.io/apimachinery/pkg/util/sets"
|
||||||
)
|
)
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestUrlsMatch(t *testing.T) {
|
func TestUrlsMatch(t *testing.T) {
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -55,11 +55,11 @@ go_library(
|
|||||||
"//pkg/util/hash:go_default_library",
|
"//pkg/util/hash:go_default_library",
|
||||||
"//pkg/util/term:go_default_library",
|
"//pkg/util/term:go_default_library",
|
||||||
"//vendor/github.com/blang/semver:go_default_library",
|
"//vendor/github.com/blang/semver:go_default_library",
|
||||||
|
"//vendor/github.com/docker/docker/api/types:go_default_library",
|
||||||
|
"//vendor/github.com/docker/docker/api/types/container:go_default_library",
|
||||||
|
"//vendor/github.com/docker/docker/api/types/filters:go_default_library",
|
||||||
|
"//vendor/github.com/docker/docker/api/types/strslice:go_default_library",
|
||||||
"//vendor/github.com/docker/docker/pkg/jsonmessage:go_default_library",
|
"//vendor/github.com/docker/docker/pkg/jsonmessage:go_default_library",
|
||||||
"//vendor/github.com/docker/engine-api/types:go_default_library",
|
|
||||||
"//vendor/github.com/docker/engine-api/types/container:go_default_library",
|
|
||||||
"//vendor/github.com/docker/engine-api/types/filters:go_default_library",
|
|
||||||
"//vendor/github.com/docker/engine-api/types/strslice:go_default_library",
|
|
||||||
"//vendor/github.com/docker/go-connections/nat:go_default_library",
|
"//vendor/github.com/docker/go-connections/nat:go_default_library",
|
||||||
"//vendor/github.com/golang/glog:go_default_library",
|
"//vendor/github.com/golang/glog:go_default_library",
|
||||||
"//vendor/k8s.io/api/core/v1:go_default_library",
|
"//vendor/k8s.io/api/core/v1:go_default_library",
|
||||||
@ -107,9 +107,9 @@ go_test(
|
|||||||
"//pkg/kubelet/util/cache:go_default_library",
|
"//pkg/kubelet/util/cache:go_default_library",
|
||||||
"//pkg/security/apparmor:go_default_library",
|
"//pkg/security/apparmor:go_default_library",
|
||||||
"//vendor/github.com/blang/semver:go_default_library",
|
"//vendor/github.com/blang/semver:go_default_library",
|
||||||
|
"//vendor/github.com/docker/docker/api/types:go_default_library",
|
||||||
|
"//vendor/github.com/docker/docker/api/types/container:go_default_library",
|
||||||
"//vendor/github.com/docker/docker/pkg/jsonmessage:go_default_library",
|
"//vendor/github.com/docker/docker/pkg/jsonmessage:go_default_library",
|
||||||
"//vendor/github.com/docker/engine-api/types:go_default_library",
|
|
||||||
"//vendor/github.com/docker/engine-api/types/container:go_default_library",
|
|
||||||
"//vendor/github.com/docker/go-connections/nat:go_default_library",
|
"//vendor/github.com/docker/go-connections/nat:go_default_library",
|
||||||
"//vendor/github.com/golang/mock/gomock:go_default_library",
|
"//vendor/github.com/golang/mock/gomock:go_default_library",
|
||||||
"//vendor/github.com/stretchr/testify/assert:go_default_library",
|
"//vendor/github.com/stretchr/testify/assert:go_default_library",
|
||||||
|
@ -21,7 +21,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
|
|
||||||
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
||||||
"k8s.io/kubernetes/pkg/kubelet/dockershim/libdocker"
|
"k8s.io/kubernetes/pkg/kubelet/dockershim/libdocker"
|
||||||
@ -30,7 +30,7 @@ import (
|
|||||||
// This file contains helper functions to convert docker API types to runtime
|
// This file contains helper functions to convert docker API types to runtime
|
||||||
// API types, or vice versa.
|
// API types, or vice versa.
|
||||||
|
|
||||||
func imageToRuntimeAPIImage(image *dockertypes.Image) (*runtimeapi.Image, error) {
|
func imageToRuntimeAPIImage(image *dockertypes.ImageSummary) (*runtimeapi.Image, error) {
|
||||||
if image == nil {
|
if image == nil {
|
||||||
return nil, fmt.Errorf("unable to convert a nil pointer to a runtime API image")
|
return nil, fmt.Errorf("unable to convert a nil pointer to a runtime API image")
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ package dockershim
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
||||||
|
@ -22,10 +22,10 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
dockercontainer "github.com/docker/engine-api/types/container"
|
dockercontainer "github.com/docker/docker/api/types/container"
|
||||||
dockerfilters "github.com/docker/engine-api/types/filters"
|
dockerfilters "github.com/docker/docker/api/types/filters"
|
||||||
dockerstrslice "github.com/docker/engine-api/types/strslice"
|
dockerstrslice "github.com/docker/docker/api/types/strslice"
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
|
|
||||||
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
||||||
@ -36,8 +36,8 @@ import (
|
|||||||
func (ds *dockerService) ListContainers(filter *runtimeapi.ContainerFilter) ([]*runtimeapi.Container, error) {
|
func (ds *dockerService) ListContainers(filter *runtimeapi.ContainerFilter) ([]*runtimeapi.Container, error) {
|
||||||
opts := dockertypes.ContainerListOptions{All: true}
|
opts := dockertypes.ContainerListOptions{All: true}
|
||||||
|
|
||||||
opts.Filter = dockerfilters.NewArgs()
|
opts.Filters = dockerfilters.NewArgs()
|
||||||
f := newDockerFilter(&opts.Filter)
|
f := newDockerFilter(&opts.Filters)
|
||||||
// Add filter to get *only* (non-sandbox) containers.
|
// Add filter to get *only* (non-sandbox) containers.
|
||||||
f.AddLabel(containerTypeLabelKey, containerTypeLabelContainer)
|
f.AddLabel(containerTypeLabelKey, containerTypeLabelContainer)
|
||||||
|
|
||||||
@ -249,7 +249,7 @@ func (ds *dockerService) StartContainer(containerID string) error {
|
|||||||
|
|
||||||
// StopContainer stops a running container with a grace period (i.e., timeout).
|
// StopContainer stops a running container with a grace period (i.e., timeout).
|
||||||
func (ds *dockerService) StopContainer(containerID string, timeout int64) error {
|
func (ds *dockerService) StopContainer(containerID string, timeout int64) error {
|
||||||
return ds.client.StopContainer(containerID, int(timeout))
|
return ds.client.StopContainer(containerID, time.Duration(timeout)*time.Second)
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoveContainer removes the container.
|
// RemoveContainer removes the container.
|
||||||
|
@ -23,7 +23,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ func TestContainerStatus(t *testing.T) {
|
|||||||
Annotations: config.Annotations,
|
Annotations: config.Annotations,
|
||||||
}
|
}
|
||||||
|
|
||||||
fDocker.InjectImages([]dockertypes.Image{{ID: imageName}})
|
fDocker.InjectImages([]dockertypes.ImageSummary{{ID: imageName}})
|
||||||
|
|
||||||
// Create the container.
|
// Create the container.
|
||||||
fClock.SetTime(time.Now().Add(-1 * time.Hour))
|
fClock.SetTime(time.Now().Add(-1 * time.Hour))
|
||||||
|
@ -20,8 +20,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
"github.com/docker/docker/pkg/jsonmessage"
|
"github.com/docker/docker/pkg/jsonmessage"
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
|
||||||
|
|
||||||
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
||||||
"k8s.io/kubernetes/pkg/kubelet/dockershim/libdocker"
|
"k8s.io/kubernetes/pkg/kubelet/dockershim/libdocker"
|
||||||
@ -34,7 +34,7 @@ func (ds *dockerService) ListImages(filter *runtimeapi.ImageFilter) ([]*runtimea
|
|||||||
opts := dockertypes.ImageListOptions{}
|
opts := dockertypes.ImageListOptions{}
|
||||||
if filter != nil {
|
if filter != nil {
|
||||||
if imgSpec := filter.GetImage(); imgSpec != nil {
|
if imgSpec := filter.GetImage(); imgSpec != nil {
|
||||||
opts.MatchName = imgSpec.Image
|
opts.Filters.Add("reference", imgSpec.Image)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,8 +20,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
"github.com/docker/docker/pkg/jsonmessage"
|
"github.com/docker/docker/pkg/jsonmessage"
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
||||||
|
@ -22,8 +22,8 @@ import (
|
|||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
dockerfilters "github.com/docker/engine-api/types/filters"
|
dockerfilters "github.com/docker/docker/api/types/filters"
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/util/sets"
|
"k8s.io/apimachinery/pkg/util/sets"
|
||||||
@ -155,9 +155,9 @@ func (ds *dockerService) checkLegacyCleanup() (bool, error) {
|
|||||||
// ListLegacyPodSandbox only lists all legacy pod sandboxes.
|
// ListLegacyPodSandbox only lists all legacy pod sandboxes.
|
||||||
func (ds *dockerService) ListLegacyPodSandbox(filter *runtimeapi.PodSandboxFilter) ([]*runtimeapi.PodSandbox, error) {
|
func (ds *dockerService) ListLegacyPodSandbox(filter *runtimeapi.PodSandboxFilter) ([]*runtimeapi.PodSandbox, error) {
|
||||||
// By default, list all containers whether they are running or not.
|
// By default, list all containers whether they are running or not.
|
||||||
opts := dockertypes.ContainerListOptions{All: true, Filter: dockerfilters.NewArgs()}
|
opts := dockertypes.ContainerListOptions{All: true, Filters: dockerfilters.NewArgs()}
|
||||||
filterOutReadySandboxes := false
|
filterOutReadySandboxes := false
|
||||||
f := newDockerFilter(&opts.Filter)
|
f := newDockerFilter(&opts.Filters)
|
||||||
if filter != nil {
|
if filter != nil {
|
||||||
if filter.Id != "" {
|
if filter.Id != "" {
|
||||||
f.Add("id", filter.Id)
|
f.Add("id", filter.Id)
|
||||||
@ -218,8 +218,8 @@ func (ds *dockerService) ListLegacyPodSandbox(filter *runtimeapi.PodSandboxFilte
|
|||||||
|
|
||||||
// ListLegacyPodSandbox only lists all legacy containers.
|
// ListLegacyPodSandbox only lists all legacy containers.
|
||||||
func (ds *dockerService) ListLegacyContainers(filter *runtimeapi.ContainerFilter) ([]*runtimeapi.Container, error) {
|
func (ds *dockerService) ListLegacyContainers(filter *runtimeapi.ContainerFilter) ([]*runtimeapi.Container, error) {
|
||||||
opts := dockertypes.ContainerListOptions{All: true, Filter: dockerfilters.NewArgs()}
|
opts := dockertypes.ContainerListOptions{All: true, Filters: dockerfilters.NewArgs()}
|
||||||
f := newDockerFilter(&opts.Filter)
|
f := newDockerFilter(&opts.Filters)
|
||||||
|
|
||||||
if filter != nil {
|
if filter != nil {
|
||||||
if filter.Id != "" {
|
if filter.Id != "" {
|
||||||
|
@ -19,7 +19,7 @@ package dockershim
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
dockercontainer "github.com/docker/engine-api/types/container"
|
dockercontainer "github.com/docker/docker/api/types/container"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
|
@ -20,10 +20,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
dockercontainer "github.com/docker/engine-api/types/container"
|
dockercontainer "github.com/docker/docker/api/types/container"
|
||||||
dockerfilters "github.com/docker/engine-api/types/filters"
|
dockerfilters "github.com/docker/docker/api/types/filters"
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
|
|
||||||
utilerrors "k8s.io/apimachinery/pkg/util/errors"
|
utilerrors "k8s.io/apimachinery/pkg/util/errors"
|
||||||
@ -41,13 +42,15 @@ const (
|
|||||||
// Various default sandbox resources requests/limits.
|
// Various default sandbox resources requests/limits.
|
||||||
defaultSandboxCPUshares int64 = 2
|
defaultSandboxCPUshares int64 = 2
|
||||||
|
|
||||||
// Termination grace period
|
|
||||||
defaultSandboxGracePeriod int = 10
|
|
||||||
|
|
||||||
// Name of the underlying container runtime
|
// Name of the underlying container runtime
|
||||||
runtimeName = "docker"
|
runtimeName = "docker"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
// Termination grace period
|
||||||
|
defaultSandboxGracePeriod = time.Duration(10) * time.Second
|
||||||
|
)
|
||||||
|
|
||||||
// Returns whether the sandbox network is ready, and whether the sandbox is known
|
// Returns whether the sandbox network is ready, and whether the sandbox is known
|
||||||
func (ds *dockerService) getNetworkReady(podSandboxID string) (bool, bool) {
|
func (ds *dockerService) getNetworkReady(podSandboxID string) (bool, bool) {
|
||||||
ds.networkReadyLock.Lock()
|
ds.networkReadyLock.Lock()
|
||||||
@ -250,8 +253,8 @@ func (ds *dockerService) RemovePodSandbox(podSandboxID string) error {
|
|||||||
var errs []error
|
var errs []error
|
||||||
opts := dockertypes.ContainerListOptions{All: true}
|
opts := dockertypes.ContainerListOptions{All: true}
|
||||||
|
|
||||||
opts.Filter = dockerfilters.NewArgs()
|
opts.Filters = dockerfilters.NewArgs()
|
||||||
f := newDockerFilter(&opts.Filter)
|
f := newDockerFilter(&opts.Filters)
|
||||||
f.AddLabel(sandboxIDLabelKey, podSandboxID)
|
f.AddLabel(sandboxIDLabelKey, podSandboxID)
|
||||||
|
|
||||||
containers, err := ds.client.ListContainers(opts)
|
containers, err := ds.client.ListContainers(opts)
|
||||||
@ -414,8 +417,8 @@ func (ds *dockerService) ListPodSandbox(filter *runtimeapi.PodSandboxFilter) ([]
|
|||||||
opts := dockertypes.ContainerListOptions{All: true}
|
opts := dockertypes.ContainerListOptions{All: true}
|
||||||
filterOutReadySandboxes := false
|
filterOutReadySandboxes := false
|
||||||
|
|
||||||
opts.Filter = dockerfilters.NewArgs()
|
opts.Filters = dockerfilters.NewArgs()
|
||||||
f := newDockerFilter(&opts.Filter)
|
f := newDockerFilter(&opts.Filters)
|
||||||
// Add filter to select only sandbox containers.
|
// Add filter to select only sandbox containers.
|
||||||
f.AddLabel(containerTypeLabelKey, containerTypeLabelSandbox)
|
f.AddLabel(containerTypeLabelKey, containerTypeLabelSandbox)
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/blang/semver"
|
"github.com/blang/semver"
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
|
|
||||||
"k8s.io/api/core/v1"
|
"k8s.io/api/core/v1"
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/blang/semver"
|
"github.com/blang/semver"
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
"github.com/golang/mock/gomock"
|
"github.com/golang/mock/gomock"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
@ -25,7 +25,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
|
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
|
|
||||||
@ -140,7 +140,7 @@ func attachContainer(client libdocker.Interface, containerID string, stdin io.Re
|
|||||||
// Have to start this before the call to client.AttachToContainer because client.AttachToContainer is a blocking
|
// Have to start this before the call to client.AttachToContainer because client.AttachToContainer is a blocking
|
||||||
// call :-( Otherwise, resize events don't get processed and the terminal never resizes.
|
// call :-( Otherwise, resize events don't get processed and the terminal never resizes.
|
||||||
kubecontainer.HandleResizing(resize, func(size remotecommand.TerminalSize) {
|
kubecontainer.HandleResizing(resize, func(size remotecommand.TerminalSize) {
|
||||||
client.ResizeContainerTTY(containerID, int(size.Height), int(size.Width))
|
client.ResizeContainerTTY(containerID, uint(size.Height), uint(size.Width))
|
||||||
})
|
})
|
||||||
|
|
||||||
// TODO(random-liu): Do we really use the *Logs* field here?
|
// TODO(random-liu): Do we really use the *Logs* field here?
|
||||||
|
@ -23,7 +23,7 @@ import (
|
|||||||
"os/exec"
|
"os/exec"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
|
|
||||||
"k8s.io/client-go/tools/remotecommand"
|
"k8s.io/client-go/tools/remotecommand"
|
||||||
@ -150,7 +150,7 @@ func (*NativeExecHandler) ExecInContainer(client libdocker.Interface, container
|
|||||||
// Have to start this before the call to client.StartExec because client.StartExec is a blocking
|
// Have to start this before the call to client.StartExec because client.StartExec is a blocking
|
||||||
// call :-( Otherwise, resize events don't get processed and the terminal never resizes.
|
// call :-( Otherwise, resize events don't get processed and the terminal never resizes.
|
||||||
kubecontainer.HandleResizing(resize, func(size remotecommand.TerminalSize) {
|
kubecontainer.HandleResizing(resize, func(size remotecommand.TerminalSize) {
|
||||||
client.ResizeExecTTY(execObj.ID, int(size.Height), int(size.Width))
|
client.ResizeExecTTY(execObj.ID, uint(size.Height), uint(size.Width))
|
||||||
})
|
})
|
||||||
|
|
||||||
startOpts := dockertypes.ExecStartCheck{Detach: false, Tty: tty}
|
startOpts := dockertypes.ExecStartCheck{Detach: false, Tty: tty}
|
||||||
|
@ -25,8 +25,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/blang/semver"
|
"github.com/blang/semver"
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
dockerfilters "github.com/docker/engine-api/types/filters"
|
dockercontainer "github.com/docker/docker/api/types/container"
|
||||||
|
dockerfilters "github.com/docker/docker/api/types/filters"
|
||||||
dockernat "github.com/docker/go-connections/nat"
|
dockernat "github.com/docker/go-connections/nat"
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
|
|
||||||
@ -152,8 +153,8 @@ func generateMountBindings(mounts []*runtimeapi.Mount) []string {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
func makePortsAndBindings(pm []*runtimeapi.PortMapping) (map[dockernat.Port]struct{}, map[dockernat.Port][]dockernat.PortBinding) {
|
func makePortsAndBindings(pm []*runtimeapi.PortMapping) (dockernat.PortSet, map[dockernat.Port][]dockernat.PortBinding) {
|
||||||
exposedPorts := map[dockernat.Port]struct{}{}
|
exposedPorts := dockernat.PortSet{}
|
||||||
portBindings := map[dockernat.Port][]dockernat.PortBinding{}
|
portBindings := map[dockernat.Port][]dockernat.PortBinding{}
|
||||||
for _, port := range pm {
|
for _, port := range pm {
|
||||||
exteriorPort := port.HostPort
|
exteriorPort := port.HostPort
|
||||||
@ -280,7 +281,7 @@ func getUserFromImageUser(imageUser string) (*int64, string) {
|
|||||||
// In that case we have to create the container with a randomized name.
|
// In that case we have to create the container with a randomized name.
|
||||||
// TODO(random-liu): Remove this work around after docker 1.11 is deprecated.
|
// TODO(random-liu): Remove this work around after docker 1.11 is deprecated.
|
||||||
// TODO(#33189): Monitor the tests to see if the fix is sufficient.
|
// TODO(#33189): Monitor the tests to see if the fix is sufficient.
|
||||||
func recoverFromCreationConflictIfNeeded(client libdocker.Interface, createConfig dockertypes.ContainerCreateConfig, err error) (*dockertypes.ContainerCreateResponse, error) {
|
func recoverFromCreationConflictIfNeeded(client libdocker.Interface, createConfig dockertypes.ContainerCreateConfig, err error) (*dockercontainer.ContainerCreateCreatedBody, error) {
|
||||||
matches := conflictRE.FindStringSubmatch(err.Error())
|
matches := conflictRE.FindStringSubmatch(err.Error())
|
||||||
if len(matches) != 2 {
|
if len(matches) != 2 {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -28,8 +28,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/blang/semver"
|
"github.com/blang/semver"
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
dockercontainer "github.com/docker/engine-api/types/container"
|
dockercontainer "github.com/docker/docker/api/types/container"
|
||||||
"k8s.io/api/core/v1"
|
"k8s.io/api/core/v1"
|
||||||
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
||||||
)
|
)
|
||||||
|
@ -25,7 +25,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/blang/semver"
|
"github.com/blang/semver"
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
dockernat "github.com/docker/go-connections/nat"
|
dockernat "github.com/docker/go-connections/nat"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
@ -218,7 +218,7 @@ func TestEnsureSandboxImageExists(t *testing.T) {
|
|||||||
t.Logf("TestCase: %q", desc)
|
t.Logf("TestCase: %q", desc)
|
||||||
_, fakeDocker, _ := newTestDockerService()
|
_, fakeDocker, _ := newTestDockerService()
|
||||||
if test.injectImage {
|
if test.injectImage {
|
||||||
images := []dockertypes.Image{{ID: sandboxImage}}
|
images := []dockertypes.ImageSummary{{ID: sandboxImage}}
|
||||||
fakeDocker.InjectImages(images)
|
fakeDocker.InjectImages(images)
|
||||||
if test.imgNeedsAuth {
|
if test.imgNeedsAuth {
|
||||||
fakeDocker.MakeImagesPrivate(images, authConfig)
|
fakeDocker.MakeImagesPrivate(images, authConfig)
|
||||||
@ -243,7 +243,7 @@ func TestEnsureSandboxImageExists(t *testing.T) {
|
|||||||
func TestMakePortsAndBindings(t *testing.T) {
|
func TestMakePortsAndBindings(t *testing.T) {
|
||||||
for desc, test := range map[string]struct {
|
for desc, test := range map[string]struct {
|
||||||
pm []*runtimeapi.PortMapping
|
pm []*runtimeapi.PortMapping
|
||||||
exposedPorts map[dockernat.Port]struct{}
|
exposedPorts dockernat.PortSet
|
||||||
portmappings map[dockernat.Port][]dockernat.PortBinding
|
portmappings map[dockernat.Port][]dockernat.PortBinding
|
||||||
}{
|
}{
|
||||||
"no port mapping": {
|
"no port mapping": {
|
||||||
|
@ -20,7 +20,7 @@ package dockershim
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/blang/semver"
|
"github.com/blang/semver"
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
||||||
)
|
)
|
||||||
|
@ -22,9 +22,9 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/blang/semver"
|
"github.com/blang/semver"
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
dockercontainer "github.com/docker/engine-api/types/container"
|
dockercontainer "github.com/docker/docker/api/types/container"
|
||||||
dockerfilters "github.com/docker/engine-api/types/filters"
|
dockerfilters "github.com/docker/docker/api/types/filters"
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
"k8s.io/api/core/v1"
|
"k8s.io/api/core/v1"
|
||||||
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
||||||
|
@ -19,7 +19,7 @@ go_test(
|
|||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = [
|
deps = [
|
||||||
"//pkg/util/hash:go_default_library",
|
"//pkg/util/hash:go_default_library",
|
||||||
"//vendor/github.com/docker/engine-api/types:go_default_library",
|
"//vendor/github.com/docker/docker/api/types:go_default_library",
|
||||||
"//vendor/github.com/stretchr/testify/assert:go_default_library",
|
"//vendor/github.com/stretchr/testify/assert:go_default_library",
|
||||||
"//vendor/k8s.io/api/core/v1:go_default_library",
|
"//vendor/k8s.io/api/core/v1:go_default_library",
|
||||||
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
|
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
|
||||||
@ -42,11 +42,11 @@ go_library(
|
|||||||
"//pkg/kubelet/metrics:go_default_library",
|
"//pkg/kubelet/metrics:go_default_library",
|
||||||
"//vendor/github.com/docker/distribution/digest:go_default_library",
|
"//vendor/github.com/docker/distribution/digest:go_default_library",
|
||||||
"//vendor/github.com/docker/distribution/reference:go_default_library",
|
"//vendor/github.com/docker/distribution/reference:go_default_library",
|
||||||
|
"//vendor/github.com/docker/docker/api/types:go_default_library",
|
||||||
|
"//vendor/github.com/docker/docker/api/types/container:go_default_library",
|
||||||
|
"//vendor/github.com/docker/docker/client:go_default_library",
|
||||||
"//vendor/github.com/docker/docker/pkg/jsonmessage:go_default_library",
|
"//vendor/github.com/docker/docker/pkg/jsonmessage:go_default_library",
|
||||||
"//vendor/github.com/docker/docker/pkg/stdcopy:go_default_library",
|
"//vendor/github.com/docker/docker/pkg/stdcopy:go_default_library",
|
||||||
"//vendor/github.com/docker/engine-api/client:go_default_library",
|
|
||||||
"//vendor/github.com/docker/engine-api/types:go_default_library",
|
|
||||||
"//vendor/github.com/docker/engine-api/types/container:go_default_library",
|
|
||||||
"//vendor/github.com/golang/glog:go_default_library",
|
"//vendor/github.com/golang/glog:go_default_library",
|
||||||
"//vendor/golang.org/x/net/context:go_default_library",
|
"//vendor/golang.org/x/net/context:go_default_library",
|
||||||
"//vendor/k8s.io/api/core/v1:go_default_library",
|
"//vendor/k8s.io/api/core/v1:go_default_library",
|
||||||
|
@ -20,8 +20,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
dockerapi "github.com/docker/engine-api/client"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockercontainer "github.com/docker/docker/api/types/container"
|
||||||
|
dockerapi "github.com/docker/docker/client"
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -44,25 +45,25 @@ const (
|
|||||||
type Interface interface {
|
type Interface interface {
|
||||||
ListContainers(options dockertypes.ContainerListOptions) ([]dockertypes.Container, error)
|
ListContainers(options dockertypes.ContainerListOptions) ([]dockertypes.Container, error)
|
||||||
InspectContainer(id string) (*dockertypes.ContainerJSON, error)
|
InspectContainer(id string) (*dockertypes.ContainerJSON, error)
|
||||||
CreateContainer(dockertypes.ContainerCreateConfig) (*dockertypes.ContainerCreateResponse, error)
|
CreateContainer(dockertypes.ContainerCreateConfig) (*dockercontainer.ContainerCreateCreatedBody, error)
|
||||||
StartContainer(id string) error
|
StartContainer(id string) error
|
||||||
StopContainer(id string, timeout int) error
|
StopContainer(id string, timeout time.Duration) error
|
||||||
RemoveContainer(id string, opts dockertypes.ContainerRemoveOptions) error
|
RemoveContainer(id string, opts dockertypes.ContainerRemoveOptions) error
|
||||||
InspectImageByRef(imageRef string) (*dockertypes.ImageInspect, error)
|
InspectImageByRef(imageRef string) (*dockertypes.ImageInspect, error)
|
||||||
InspectImageByID(imageID string) (*dockertypes.ImageInspect, error)
|
InspectImageByID(imageID string) (*dockertypes.ImageInspect, error)
|
||||||
ListImages(opts dockertypes.ImageListOptions) ([]dockertypes.Image, error)
|
ListImages(opts dockertypes.ImageListOptions) ([]dockertypes.ImageSummary, error)
|
||||||
PullImage(image string, auth dockertypes.AuthConfig, opts dockertypes.ImagePullOptions) error
|
PullImage(image string, auth dockertypes.AuthConfig, opts dockertypes.ImagePullOptions) error
|
||||||
RemoveImage(image string, opts dockertypes.ImageRemoveOptions) ([]dockertypes.ImageDelete, error)
|
RemoveImage(image string, opts dockertypes.ImageRemoveOptions) ([]dockertypes.ImageDelete, error)
|
||||||
ImageHistory(id string) ([]dockertypes.ImageHistory, error)
|
ImageHistory(id string) ([]dockertypes.ImageHistory, error)
|
||||||
Logs(string, dockertypes.ContainerLogsOptions, StreamOptions) error
|
Logs(string, dockertypes.ContainerLogsOptions, StreamOptions) error
|
||||||
Version() (*dockertypes.Version, error)
|
Version() (*dockertypes.Version, error)
|
||||||
Info() (*dockertypes.Info, error)
|
Info() (*dockertypes.Info, error)
|
||||||
CreateExec(string, dockertypes.ExecConfig) (*dockertypes.ContainerExecCreateResponse, error)
|
CreateExec(string, dockertypes.ExecConfig) (*dockertypes.IDResponse, error)
|
||||||
StartExec(string, dockertypes.ExecStartCheck, StreamOptions) error
|
StartExec(string, dockertypes.ExecStartCheck, StreamOptions) error
|
||||||
InspectExec(id string) (*dockertypes.ContainerExecInspect, error)
|
InspectExec(id string) (*dockertypes.ContainerExecInspect, error)
|
||||||
AttachToContainer(string, dockertypes.ContainerAttachOptions, StreamOptions) error
|
AttachToContainer(string, dockertypes.ContainerAttachOptions, StreamOptions) error
|
||||||
ResizeContainerTTY(id string, height, width int) error
|
ResizeContainerTTY(id string, height, width uint) error
|
||||||
ResizeExecTTY(id string, height, width int) error
|
ResizeExecTTY(id string, height, width uint) error
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get a *dockerapi.Client, either using the endpoint passed in, or using
|
// Get a *dockerapi.Client, either using the endpoint passed in, or using
|
||||||
|
@ -29,8 +29,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
dockercontainer "github.com/docker/engine-api/types/container"
|
dockercontainer "github.com/docker/docker/api/types/container"
|
||||||
|
|
||||||
"k8s.io/api/core/v1"
|
"k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/util/clock"
|
"k8s.io/apimachinery/pkg/util/clock"
|
||||||
@ -54,7 +54,7 @@ type FakeDockerClient struct {
|
|||||||
ExitedContainerList []dockertypes.Container
|
ExitedContainerList []dockertypes.Container
|
||||||
ContainerMap map[string]*dockertypes.ContainerJSON
|
ContainerMap map[string]*dockertypes.ContainerJSON
|
||||||
ImageInspects map[string]*dockertypes.ImageInspect
|
ImageInspects map[string]*dockertypes.ImageInspect
|
||||||
Images []dockertypes.Image
|
Images []dockertypes.ImageSummary
|
||||||
ImageIDsNeedingAuth map[string]dockertypes.AuthConfig
|
ImageIDsNeedingAuth map[string]dockertypes.AuthConfig
|
||||||
Errors map[string]error
|
Errors map[string]error
|
||||||
called []calledDetail
|
called []calledDetail
|
||||||
@ -391,8 +391,8 @@ func (f *FakeDockerClient) ListContainers(options dockertypes.ContainerListOptio
|
|||||||
// TODO(random-liu): Is a fully sorted array needed?
|
// TODO(random-liu): Is a fully sorted array needed?
|
||||||
containerList = append(containerList, f.ExitedContainerList...)
|
containerList = append(containerList, f.ExitedContainerList...)
|
||||||
}
|
}
|
||||||
// Filter containers with id, only support 1 id.
|
// Filters containers with id, only support 1 id.
|
||||||
idFilters := options.Filter.Get("id")
|
idFilters := options.Filters.Get("id")
|
||||||
if len(idFilters) != 0 {
|
if len(idFilters) != 0 {
|
||||||
var filtered []dockertypes.Container
|
var filtered []dockertypes.Container
|
||||||
for _, container := range containerList {
|
for _, container := range containerList {
|
||||||
@ -405,8 +405,8 @@ func (f *FakeDockerClient) ListContainers(options dockertypes.ContainerListOptio
|
|||||||
}
|
}
|
||||||
containerList = filtered
|
containerList = filtered
|
||||||
}
|
}
|
||||||
// Filter containers with status, only support 1 status.
|
// Filters containers with status, only support 1 status.
|
||||||
statusFilters := options.Filter.Get("status")
|
statusFilters := options.Filters.Get("status")
|
||||||
if len(statusFilters) == 1 {
|
if len(statusFilters) == 1 {
|
||||||
var filtered []dockertypes.Container
|
var filtered []dockertypes.Container
|
||||||
for _, container := range containerList {
|
for _, container := range containerList {
|
||||||
@ -419,8 +419,8 @@ func (f *FakeDockerClient) ListContainers(options dockertypes.ContainerListOptio
|
|||||||
}
|
}
|
||||||
containerList = filtered
|
containerList = filtered
|
||||||
}
|
}
|
||||||
// Filter containers with label filter.
|
// Filters containers with label filter.
|
||||||
labelFilters := options.Filter.Get("label")
|
labelFilters := options.Filters.Get("label")
|
||||||
if len(labelFilters) != 0 {
|
if len(labelFilters) != 0 {
|
||||||
var filtered []dockertypes.Container
|
var filtered []dockertypes.Container
|
||||||
for _, container := range containerList {
|
for _, container := range containerList {
|
||||||
@ -514,7 +514,7 @@ func GetFakeContainerID(name string) string {
|
|||||||
|
|
||||||
// CreateContainer is a test-spy implementation of Interface.CreateContainer.
|
// CreateContainer is a test-spy implementation of Interface.CreateContainer.
|
||||||
// It adds an entry "create" to the internal method call record.
|
// It adds an entry "create" to the internal method call record.
|
||||||
func (f *FakeDockerClient) CreateContainer(c dockertypes.ContainerCreateConfig) (*dockertypes.ContainerCreateResponse, error) {
|
func (f *FakeDockerClient) CreateContainer(c dockertypes.ContainerCreateConfig) (*dockercontainer.ContainerCreateCreatedBody, error) {
|
||||||
f.Lock()
|
f.Lock()
|
||||||
defer f.Unlock()
|
defer f.Unlock()
|
||||||
f.appendCalled(calledDetail{name: "create"})
|
f.appendCalled(calledDetail{name: "create"})
|
||||||
@ -536,7 +536,7 @@ func (f *FakeDockerClient) CreateContainer(c dockertypes.ContainerCreateConfig)
|
|||||||
|
|
||||||
f.normalSleep(100, 25, 25)
|
f.normalSleep(100, 25, 25)
|
||||||
|
|
||||||
return &dockertypes.ContainerCreateResponse{ID: id}, nil
|
return &dockercontainer.ContainerCreateCreatedBody{ID: id}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// StartContainer is a test-spy implementation of Interface.StartContainer.
|
// StartContainer is a test-spy implementation of Interface.StartContainer.
|
||||||
@ -566,7 +566,7 @@ func (f *FakeDockerClient) StartContainer(id string) error {
|
|||||||
|
|
||||||
// StopContainer is a test-spy implementation of Interface.StopContainer.
|
// StopContainer is a test-spy implementation of Interface.StopContainer.
|
||||||
// It adds an entry "stop" to the internal method call record.
|
// It adds an entry "stop" to the internal method call record.
|
||||||
func (f *FakeDockerClient) StopContainer(id string, timeout int) error {
|
func (f *FakeDockerClient) StopContainer(id string, timeout time.Duration) error {
|
||||||
f.Lock()
|
f.Lock()
|
||||||
defer f.Unlock()
|
defer f.Unlock()
|
||||||
f.appendCalled(calledDetail{name: "stop"})
|
f.appendCalled(calledDetail{name: "stop"})
|
||||||
@ -675,12 +675,12 @@ func (f *FakeDockerClient) Info() (*dockertypes.Info, error) {
|
|||||||
return &f.Information, nil
|
return &f.Information, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *FakeDockerClient) CreateExec(id string, opts dockertypes.ExecConfig) (*dockertypes.ContainerExecCreateResponse, error) {
|
func (f *FakeDockerClient) CreateExec(id string, opts dockertypes.ExecConfig) (*dockertypes.IDResponse, error) {
|
||||||
f.Lock()
|
f.Lock()
|
||||||
defer f.Unlock()
|
defer f.Unlock()
|
||||||
f.execCmd = opts.Cmd
|
f.execCmd = opts.Cmd
|
||||||
f.appendCalled(calledDetail{name: "create_exec"})
|
f.appendCalled(calledDetail{name: "create_exec"})
|
||||||
return &dockertypes.ContainerExecCreateResponse{ID: "12345678"}, nil
|
return &dockertypes.IDResponse{ID: "12345678"}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *FakeDockerClient) StartExec(startExec string, opts dockertypes.ExecStartCheck, sopts StreamOptions) error {
|
func (f *FakeDockerClient) StartExec(startExec string, opts dockertypes.ExecStartCheck, sopts StreamOptions) error {
|
||||||
@ -701,7 +701,7 @@ func (f *FakeDockerClient) InspectExec(id string) (*dockertypes.ContainerExecIns
|
|||||||
return f.ExecInspect, f.popError("inspect_exec")
|
return f.ExecInspect, f.popError("inspect_exec")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *FakeDockerClient) ListImages(opts dockertypes.ImageListOptions) ([]dockertypes.Image, error) {
|
func (f *FakeDockerClient) ListImages(opts dockertypes.ImageListOptions) ([]dockertypes.ImageSummary, error) {
|
||||||
f.Lock()
|
f.Lock()
|
||||||
defer f.Unlock()
|
defer f.Unlock()
|
||||||
f.appendCalled(calledDetail{name: "list_images"})
|
f.appendCalled(calledDetail{name: "list_images"})
|
||||||
@ -725,7 +725,7 @@ func (f *FakeDockerClient) RemoveImage(image string, opts dockertypes.ImageRemov
|
|||||||
return []dockertypes.ImageDelete{{Deleted: image}}, err
|
return []dockertypes.ImageDelete{{Deleted: image}}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *FakeDockerClient) InjectImages(images []dockertypes.Image) {
|
func (f *FakeDockerClient) InjectImages(images []dockertypes.ImageSummary) {
|
||||||
f.Lock()
|
f.Lock()
|
||||||
defer f.Unlock()
|
defer f.Unlock()
|
||||||
f.Images = append(f.Images, images...)
|
f.Images = append(f.Images, images...)
|
||||||
@ -734,7 +734,7 @@ func (f *FakeDockerClient) InjectImages(images []dockertypes.Image) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *FakeDockerClient) MakeImagesPrivate(images []dockertypes.Image, auth dockertypes.AuthConfig) {
|
func (f *FakeDockerClient) MakeImagesPrivate(images []dockertypes.ImageSummary, auth dockertypes.AuthConfig) {
|
||||||
f.Lock()
|
f.Lock()
|
||||||
defer f.Unlock()
|
defer f.Unlock()
|
||||||
for _, i := range images {
|
for _, i := range images {
|
||||||
@ -745,7 +745,7 @@ func (f *FakeDockerClient) MakeImagesPrivate(images []dockertypes.Image, auth do
|
|||||||
func (f *FakeDockerClient) ResetImages() {
|
func (f *FakeDockerClient) ResetImages() {
|
||||||
f.Lock()
|
f.Lock()
|
||||||
defer f.Unlock()
|
defer f.Unlock()
|
||||||
f.Images = []dockertypes.Image{}
|
f.Images = []dockertypes.ImageSummary{}
|
||||||
f.ImageInspects = make(map[string]*dockertypes.ImageInspect)
|
f.ImageInspects = make(map[string]*dockertypes.ImageInspect)
|
||||||
f.ImageIDsNeedingAuth = make(map[string]dockertypes.AuthConfig)
|
f.ImageIDsNeedingAuth = make(map[string]dockertypes.AuthConfig)
|
||||||
}
|
}
|
||||||
@ -767,14 +767,14 @@ func (f *FakeDockerClient) updateContainerStatus(id, status string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *FakeDockerClient) ResizeExecTTY(id string, height, width int) error {
|
func (f *FakeDockerClient) ResizeExecTTY(id string, height, width uint) error {
|
||||||
f.Lock()
|
f.Lock()
|
||||||
defer f.Unlock()
|
defer f.Unlock()
|
||||||
f.appendCalled(calledDetail{name: "resize_exec"})
|
f.appendCalled(calledDetail{name: "resize_exec"})
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *FakeDockerClient) ResizeContainerTTY(id string, height, width int) error {
|
func (f *FakeDockerClient) ResizeContainerTTY(id string, height, width uint) error {
|
||||||
f.Lock()
|
f.Lock()
|
||||||
defer f.Unlock()
|
defer f.Unlock()
|
||||||
f.appendCalled(calledDetail{name: "resize_container"})
|
f.appendCalled(calledDetail{name: "resize_container"})
|
||||||
@ -792,7 +792,7 @@ func createImageInspectFromRef(ref string) *dockertypes.ImageInspect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func createImageInspectFromImage(image dockertypes.Image) *dockertypes.ImageInspect {
|
func createImageInspectFromImage(image dockertypes.ImageSummary) *dockertypes.ImageInspect {
|
||||||
return &dockertypes.ImageInspect{
|
return &dockertypes.ImageInspect{
|
||||||
ID: image.ID,
|
ID: image.ID,
|
||||||
RepoTags: image.RepoTags,
|
RepoTags: image.RepoTags,
|
||||||
@ -803,8 +803,8 @@ func createImageInspectFromImage(image dockertypes.Image) *dockertypes.ImageInsp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func createImageFromImageInspect(inspect dockertypes.ImageInspect) *dockertypes.Image {
|
func createImageFromImageInspect(inspect dockertypes.ImageInspect) *dockertypes.ImageSummary {
|
||||||
return &dockertypes.Image{
|
return &dockertypes.ImageSummary{
|
||||||
ID: inspect.ID,
|
ID: inspect.ID,
|
||||||
RepoTags: inspect.RepoTags,
|
RepoTags: inspect.RepoTags,
|
||||||
// Image size is required to be non-zero for CRI integration.
|
// Image size is required to be non-zero for CRI integration.
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
|
|
||||||
dockerdigest "github.com/docker/distribution/digest"
|
dockerdigest "github.com/docker/distribution/digest"
|
||||||
dockerref "github.com/docker/distribution/reference"
|
dockerref "github.com/docker/distribution/reference"
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -19,7 +19,8 @@ package libdocker
|
|||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
|
dockercontainer "github.com/docker/docker/api/types/container"
|
||||||
"k8s.io/kubernetes/pkg/kubelet/metrics"
|
"k8s.io/kubernetes/pkg/kubelet/metrics"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -71,7 +72,7 @@ func (in instrumentedInterface) InspectContainer(id string) (*dockertypes.Contai
|
|||||||
return out, err
|
return out, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (in instrumentedInterface) CreateContainer(opts dockertypes.ContainerCreateConfig) (*dockertypes.ContainerCreateResponse, error) {
|
func (in instrumentedInterface) CreateContainer(opts dockertypes.ContainerCreateConfig) (*dockercontainer.ContainerCreateCreatedBody, error) {
|
||||||
const operation = "create_container"
|
const operation = "create_container"
|
||||||
defer recordOperation(operation, time.Now())
|
defer recordOperation(operation, time.Now())
|
||||||
|
|
||||||
@ -89,7 +90,7 @@ func (in instrumentedInterface) StartContainer(id string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (in instrumentedInterface) StopContainer(id string, timeout int) error {
|
func (in instrumentedInterface) StopContainer(id string, timeout time.Duration) error {
|
||||||
const operation = "stop_container"
|
const operation = "stop_container"
|
||||||
defer recordOperation(operation, time.Now())
|
defer recordOperation(operation, time.Now())
|
||||||
|
|
||||||
@ -125,7 +126,7 @@ func (in instrumentedInterface) InspectImageByID(image string) (*dockertypes.Ima
|
|||||||
return out, err
|
return out, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (in instrumentedInterface) ListImages(opts dockertypes.ImageListOptions) ([]dockertypes.Image, error) {
|
func (in instrumentedInterface) ListImages(opts dockertypes.ImageListOptions) ([]dockertypes.ImageSummary, error) {
|
||||||
const operation = "list_images"
|
const operation = "list_images"
|
||||||
defer recordOperation(operation, time.Now())
|
defer recordOperation(operation, time.Now())
|
||||||
|
|
||||||
@ -178,7 +179,7 @@ func (in instrumentedInterface) Info() (*dockertypes.Info, error) {
|
|||||||
return out, err
|
return out, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (in instrumentedInterface) CreateExec(id string, opts dockertypes.ExecConfig) (*dockertypes.ContainerExecCreateResponse, error) {
|
func (in instrumentedInterface) CreateExec(id string, opts dockertypes.ExecConfig) (*dockertypes.IDResponse, error) {
|
||||||
const operation = "create_exec"
|
const operation = "create_exec"
|
||||||
defer recordOperation(operation, time.Now())
|
defer recordOperation(operation, time.Now())
|
||||||
|
|
||||||
@ -223,7 +224,7 @@ func (in instrumentedInterface) ImageHistory(id string) ([]dockertypes.ImageHist
|
|||||||
return out, err
|
return out, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (in instrumentedInterface) ResizeExecTTY(id string, height, width int) error {
|
func (in instrumentedInterface) ResizeExecTTY(id string, height, width uint) error {
|
||||||
const operation = "resize_exec"
|
const operation = "resize_exec"
|
||||||
defer recordOperation(operation, time.Now())
|
defer recordOperation(operation, time.Now())
|
||||||
|
|
||||||
@ -232,7 +233,7 @@ func (in instrumentedInterface) ResizeExecTTY(id string, height, width int) erro
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (in instrumentedInterface) ResizeContainerTTY(id string, height, width int) error {
|
func (in instrumentedInterface) ResizeContainerTTY(id string, height, width uint) error {
|
||||||
const operation = "resize_container"
|
const operation = "resize_container"
|
||||||
defer recordOperation(operation, time.Now())
|
defer recordOperation(operation, time.Now())
|
||||||
|
|
||||||
|
@ -29,26 +29,17 @@ import (
|
|||||||
|
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
|
|
||||||
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
|
dockercontainer "github.com/docker/docker/api/types/container"
|
||||||
|
dockerapi "github.com/docker/docker/client"
|
||||||
dockermessage "github.com/docker/docker/pkg/jsonmessage"
|
dockermessage "github.com/docker/docker/pkg/jsonmessage"
|
||||||
dockerstdcopy "github.com/docker/docker/pkg/stdcopy"
|
dockerstdcopy "github.com/docker/docker/pkg/stdcopy"
|
||||||
dockerapi "github.com/docker/engine-api/client"
|
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
// kubeDockerClient is a wrapped layer of docker client for kubelet internal use. This layer is added to:
|
// kubeDockerClient is a wrapped layer of docker client for kubelet internal use. This layer is added to:
|
||||||
// 1) Redirect stream for exec and attach operations.
|
// 1) Redirect stream for exec and attach operations.
|
||||||
// 2) Wrap the context in this layer to make the Interface cleaner.
|
// 2) Wrap the context in this layer to make the Interface cleaner.
|
||||||
// 3) Stabilize the Interface. The engine-api is still under active development, the interface
|
|
||||||
// is not stabilized yet. However, the Interface is used in many files in Kubernetes, we may
|
|
||||||
// not want to change the interface frequently. With this layer, we can port the engine api to the
|
|
||||||
// Interface to avoid changing Interface as much as possible.
|
|
||||||
// (See
|
|
||||||
// * https://github.com/docker/engine-api/issues/89
|
|
||||||
// * https://github.com/docker/engine-api/issues/137
|
|
||||||
// * https://github.com/docker/engine-api/pull/140)
|
|
||||||
// TODO(random-liu): Swith to new docker interface by refactoring the functions in the old Interface
|
|
||||||
// one by one.
|
|
||||||
type kubeDockerClient struct {
|
type kubeDockerClient struct {
|
||||||
// timeout is the timeout of short running docker operations.
|
// timeout is the timeout of short running docker operations.
|
||||||
timeout time.Duration
|
timeout time.Duration
|
||||||
@ -131,7 +122,7 @@ func (d *kubeDockerClient) InspectContainer(id string) (*dockertypes.ContainerJS
|
|||||||
return &containerJSON, nil
|
return &containerJSON, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *kubeDockerClient) CreateContainer(opts dockertypes.ContainerCreateConfig) (*dockertypes.ContainerCreateResponse, error) {
|
func (d *kubeDockerClient) CreateContainer(opts dockertypes.ContainerCreateConfig) (*dockercontainer.ContainerCreateCreatedBody, error) {
|
||||||
ctx, cancel := d.getTimeoutContext()
|
ctx, cancel := d.getTimeoutContext()
|
||||||
defer cancel()
|
defer cancel()
|
||||||
// we provide an explicit default shm size as to not depend on docker daemon.
|
// we provide an explicit default shm size as to not depend on docker daemon.
|
||||||
@ -152,18 +143,18 @@ func (d *kubeDockerClient) CreateContainer(opts dockertypes.ContainerCreateConfi
|
|||||||
func (d *kubeDockerClient) StartContainer(id string) error {
|
func (d *kubeDockerClient) StartContainer(id string) error {
|
||||||
ctx, cancel := d.getTimeoutContext()
|
ctx, cancel := d.getTimeoutContext()
|
||||||
defer cancel()
|
defer cancel()
|
||||||
err := d.client.ContainerStart(ctx, id)
|
err := d.client.ContainerStart(ctx, id, dockertypes.ContainerStartOptions{})
|
||||||
if ctxErr := contextError(ctx); ctxErr != nil {
|
if ctxErr := contextError(ctx); ctxErr != nil {
|
||||||
return ctxErr
|
return ctxErr
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stopping an already stopped container will not cause an error in engine-v1.
|
// Stopping an already stopped container will not cause an error in dockerapi.
|
||||||
func (d *kubeDockerClient) StopContainer(id string, timeout int) error {
|
func (d *kubeDockerClient) StopContainer(id string, timeout time.Duration) error {
|
||||||
ctx, cancel := d.getCustomTimeoutContext(time.Duration(timeout) * time.Second)
|
ctx, cancel := d.getCustomTimeoutContext(timeout)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
err := d.client.ContainerStop(ctx, id, timeout)
|
err := d.client.ContainerStop(ctx, id, &timeout)
|
||||||
if ctxErr := contextError(ctx); ctxErr != nil {
|
if ctxErr := contextError(ctx); ctxErr != nil {
|
||||||
return ctxErr
|
return ctxErr
|
||||||
}
|
}
|
||||||
@ -183,7 +174,7 @@ func (d *kubeDockerClient) RemoveContainer(id string, opts dockertypes.Container
|
|||||||
func (d *kubeDockerClient) inspectImageRaw(ref string) (*dockertypes.ImageInspect, error) {
|
func (d *kubeDockerClient) inspectImageRaw(ref string) (*dockertypes.ImageInspect, error) {
|
||||||
ctx, cancel := d.getTimeoutContext()
|
ctx, cancel := d.getTimeoutContext()
|
||||||
defer cancel()
|
defer cancel()
|
||||||
resp, _, err := d.client.ImageInspectWithRaw(ctx, ref, true)
|
resp, _, err := d.client.ImageInspectWithRaw(ctx, ref)
|
||||||
if ctxErr := contextError(ctx); ctxErr != nil {
|
if ctxErr := contextError(ctx); ctxErr != nil {
|
||||||
return nil, ctxErr
|
return nil, ctxErr
|
||||||
}
|
}
|
||||||
@ -231,7 +222,7 @@ func (d *kubeDockerClient) ImageHistory(id string) ([]dockertypes.ImageHistory,
|
|||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *kubeDockerClient) ListImages(opts dockertypes.ImageListOptions) ([]dockertypes.Image, error) {
|
func (d *kubeDockerClient) ListImages(opts dockertypes.ImageListOptions) ([]dockertypes.ImageSummary, error) {
|
||||||
ctx, cancel := d.getTimeoutContext()
|
ctx, cancel := d.getTimeoutContext()
|
||||||
defer cancel()
|
defer cancel()
|
||||||
images, err := d.client.ImageList(ctx, opts)
|
images, err := d.client.ImageList(ctx, opts)
|
||||||
@ -429,7 +420,7 @@ func (d *kubeDockerClient) Info() (*dockertypes.Info, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO(random-liu): Add unit test for exec and attach functions, just like what go-dockerclient did.
|
// TODO(random-liu): Add unit test for exec and attach functions, just like what go-dockerclient did.
|
||||||
func (d *kubeDockerClient) CreateExec(id string, opts dockertypes.ExecConfig) (*dockertypes.ContainerExecCreateResponse, error) {
|
func (d *kubeDockerClient) CreateExec(id string, opts dockertypes.ExecConfig) (*dockertypes.IDResponse, error) {
|
||||||
ctx, cancel := d.getTimeoutContext()
|
ctx, cancel := d.getTimeoutContext()
|
||||||
defer cancel()
|
defer cancel()
|
||||||
resp, err := d.client.ContainerExecCreate(ctx, id, opts)
|
resp, err := d.client.ContainerExecCreate(ctx, id, opts)
|
||||||
@ -493,7 +484,7 @@ func (d *kubeDockerClient) AttachToContainer(id string, opts dockertypes.Contain
|
|||||||
return d.holdHijackedConnection(sopts.RawTerminal, sopts.InputStream, sopts.OutputStream, sopts.ErrorStream, resp)
|
return d.holdHijackedConnection(sopts.RawTerminal, sopts.InputStream, sopts.OutputStream, sopts.ErrorStream, resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *kubeDockerClient) ResizeExecTTY(id string, height, width int) error {
|
func (d *kubeDockerClient) ResizeExecTTY(id string, height, width uint) error {
|
||||||
ctx, cancel := d.getCancelableContext()
|
ctx, cancel := d.getCancelableContext()
|
||||||
defer cancel()
|
defer cancel()
|
||||||
return d.client.ContainerExecResize(ctx, id, dockertypes.ResizeOptions{
|
return d.client.ContainerExecResize(ctx, id, dockertypes.ResizeOptions{
|
||||||
@ -502,7 +493,7 @@ func (d *kubeDockerClient) ResizeExecTTY(id string, height, width int) error {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *kubeDockerClient) ResizeContainerTTY(id string, height, width int) error {
|
func (d *kubeDockerClient) ResizeContainerTTY(id string, height, width uint) error {
|
||||||
ctx, cancel := d.getCancelableContext()
|
ctx, cancel := d.getCancelableContext()
|
||||||
defer cancel()
|
defer cancel()
|
||||||
return d.client.ContainerResize(ctx, id, dockertypes.ResizeOptions{
|
return d.client.ContainerResize(ctx, id, dockertypes.ResizeOptions{
|
||||||
|
@ -21,7 +21,7 @@ import (
|
|||||||
"hash/adler32"
|
"hash/adler32"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"k8s.io/api/core/v1"
|
"k8s.io/api/core/v1"
|
||||||
"k8s.io/apimachinery/pkg/types"
|
"k8s.io/apimachinery/pkg/types"
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/blang/semver"
|
"github.com/blang/semver"
|
||||||
dockercontainer "github.com/docker/engine-api/types/container"
|
dockercontainer "github.com/docker/docker/api/types/container"
|
||||||
|
|
||||||
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
||||||
knetwork "k8s.io/kubernetes/pkg/kubelet/network"
|
knetwork "k8s.io/kubernetes/pkg/kubelet/network"
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/blang/semver"
|
"github.com/blang/semver"
|
||||||
dockercontainer "github.com/docker/engine-api/types/container"
|
dockercontainer "github.com/docker/docker/api/types/container"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
||||||
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
runtimeapi "k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
|
||||||
|
@ -46,7 +46,7 @@ go_library(
|
|||||||
"//vendor/github.com/coreos/go-systemd/dbus:go_default_library",
|
"//vendor/github.com/coreos/go-systemd/dbus:go_default_library",
|
||||||
"//vendor/github.com/coreos/go-systemd/unit:go_default_library",
|
"//vendor/github.com/coreos/go-systemd/unit:go_default_library",
|
||||||
"//vendor/github.com/coreos/rkt/api/v1alpha:go_default_library",
|
"//vendor/github.com/coreos/rkt/api/v1alpha:go_default_library",
|
||||||
"//vendor/github.com/docker/engine-api/types:go_default_library",
|
"//vendor/github.com/docker/docker/api/types:go_default_library",
|
||||||
"//vendor/github.com/golang/glog:go_default_library",
|
"//vendor/github.com/golang/glog:go_default_library",
|
||||||
"//vendor/golang.org/x/net/context:go_default_library",
|
"//vendor/golang.org/x/net/context:go_default_library",
|
||||||
"//vendor/google.golang.org/grpc:go_default_library",
|
"//vendor/google.golang.org/grpc:go_default_library",
|
||||||
|
@ -30,7 +30,7 @@ import (
|
|||||||
appcschema "github.com/appc/spec/schema"
|
appcschema "github.com/appc/spec/schema"
|
||||||
appctypes "github.com/appc/spec/schema/types"
|
appctypes "github.com/appc/spec/schema/types"
|
||||||
rktapi "github.com/coreos/rkt/api/v1alpha"
|
rktapi "github.com/coreos/rkt/api/v1alpha"
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/docker/api/types"
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
"k8s.io/api/core/v1"
|
"k8s.io/api/core/v1"
|
||||||
|
@ -23,8 +23,8 @@ go_library(
|
|||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = [
|
deps = [
|
||||||
"//vendor/github.com/blang/semver:go_default_library",
|
"//vendor/github.com/blang/semver:go_default_library",
|
||||||
"//vendor/github.com/docker/engine-api/client:go_default_library",
|
"//vendor/github.com/docker/docker/api/types:go_default_library",
|
||||||
"//vendor/github.com/docker/engine-api/types:go_default_library",
|
"//vendor/github.com/docker/docker/client:go_default_library",
|
||||||
"//vendor/github.com/golang/glog:go_default_library",
|
"//vendor/github.com/golang/glog:go_default_library",
|
||||||
"//vendor/golang.org/x/net/context:go_default_library",
|
"//vendor/golang.org/x/net/context:go_default_library",
|
||||||
"//vendor/k8s.io/apimachinery/pkg/util/errors:go_default_library",
|
"//vendor/k8s.io/apimachinery/pkg/util/errors:go_default_library",
|
||||||
@ -43,7 +43,7 @@ go_test(
|
|||||||
library = ":go_default_library",
|
library = ":go_default_library",
|
||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
deps = [
|
deps = [
|
||||||
"//vendor/github.com/docker/engine-api/types:go_default_library",
|
"//vendor/github.com/docker/docker/api/types:go_default_library",
|
||||||
"//vendor/github.com/stretchr/testify/assert:go_default_library",
|
"//vendor/github.com/stretchr/testify/assert:go_default_library",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -20,8 +20,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
|
||||||
"github.com/docker/engine-api/client"
|
"github.com/docker/docker/api/types"
|
||||||
"github.com/docker/engine-api/types"
|
"github.com/docker/docker/client"
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ package system
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/docker/engine-api/types"
|
"github.com/docker/docker/api/types"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user