Skip to content

Commit d8ec97e

Browse files
committed
use consistent aliases and re-group imports
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent a310a2c commit d8ec97e

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

container/docker/factory.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ import (
2525

2626
"github.com/blang/semver/v4"
2727
dockersystem "github.com/docker/docker/api/types/system"
28-
"github.com/google/cadvisor/container/containerd"
28+
dclient "github.com/docker/docker/client"
29+
"golang.org/x/net/context"
30+
"k8s.io/klog/v2"
2931

3032
"github.com/google/cadvisor/container"
33+
"github.com/google/cadvisor/container/containerd"
3134
dockerutil "github.com/google/cadvisor/container/docker/utils"
3235
"github.com/google/cadvisor/container/libcontainer"
3336
"github.com/google/cadvisor/devicemapper"
@@ -36,10 +39,6 @@ import (
3639
"github.com/google/cadvisor/machine"
3740
"github.com/google/cadvisor/watcher"
3841
"github.com/google/cadvisor/zfs"
39-
40-
docker "github.com/docker/docker/client"
41-
"golang.org/x/net/context"
42-
"k8s.io/klog/v2"
4342
)
4443

4544
var ArgDockerEndpoint = flag.String("docker", "unix:///var/run/docker.sock", "docker endpoint")
@@ -110,7 +109,7 @@ type dockerFactory struct {
110109
storageDriver StorageDriver
111110
storageDir string
112111

113-
client *docker.Client
112+
client *dclient.Client
114113
containerdClient containerd.ContainerdClient
115114

116115
// Information about the mounted cgroup subsystems.

container/docker/handler.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ import (
2424
"strings"
2525
"time"
2626

27+
dclient "github.com/docker/docker/client"
28+
"github.com/opencontainers/cgroups"
29+
"github.com/opencontainers/runtime-spec/specs-go"
30+
"golang.org/x/net/context"
31+
2732
"github.com/google/cadvisor/container"
2833
"github.com/google/cadvisor/container/common"
2934
"github.com/google/cadvisor/container/containerd"
@@ -34,11 +39,6 @@ import (
3439
"github.com/google/cadvisor/fs"
3540
info "github.com/google/cadvisor/info/v1"
3641
"github.com/google/cadvisor/zfs"
37-
"github.com/opencontainers/cgroups"
38-
"github.com/opencontainers/runtime-spec/specs-go"
39-
40-
docker "github.com/docker/docker/client"
41-
"golang.org/x/net/context"
4242
)
4343

4444
const (
@@ -118,7 +118,7 @@ func getRwLayerID(containerID, storageDir string, sd StorageDriver, dockerVersio
118118

119119
// newDockerContainerHandler returns a new container.ContainerHandler
120120
func newDockerContainerHandler(
121-
client *docker.Client,
121+
client *dclient.Client,
122122
containerdClient containerd.ContainerdClient,
123123
name string,
124124
machineInfoFactory info.MachineInfoFactory,

0 commit comments

Comments
 (0)