Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions container/docker/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,10 @@ func Register(factory info.MachineInfoFactory, fsInfo fs.FsInfo, includedMetrics
}

var (
thinPoolWatcher *devicemapper.ThinPoolWatcher
thinPoolName string
zfsWatcher *zfs.ZfsWatcher
thinPoolWatcher *devicemapper.ThinPoolWatcher
thinPoolName string
zfsWatcher *zfs.ZfsWatcher
containerdClient containerd.ContainerdClient
)
if includedMetrics.Has(container.DiskUsageMetrics) {
if StorageDriver(dockerInfo.Driver) == DevicemapperStorageDriver {
Expand All @@ -352,9 +353,11 @@ func Register(factory info.MachineInfoFactory, fsInfo fs.FsInfo, includedMetrics
}
}

containerdClient, err := containerd.Client(*containerd.ArgContainerdEndpoint, "moby")
if err != nil {
return fmt.Errorf("unable to create containerd client: %v", err)
if StorageDriver(dockerInfo.Driver) == ContainerdSnapshotterStorageDriver {
containerdClient, err = containerd.Client(*containerd.ArgContainerdEndpoint, "moby")
if err != nil {
return fmt.Errorf("unable to create containerd client: %v", err)
}
}

klog.V(1).Infof("Registering Docker factory")
Expand Down
Loading