mirror of https://github.com/k3s-io/k3s
Merge pull request #27899 from ncdc/bump-cadvisor
Automatic merge from submit-queue bump(google/cadvisor): v0.23.5 Fix an issue where cadvisor was unable to report container filesystem stats for LVM-based devicemapper thin pools. Fix an issue where cadvisor would not report any stats for a container if it failed to get the filesystem stats when Docker's storage driver is devicemapper. @kubernetes/sig-node @kubernetes/rh-cluster-infrapull/6/head
commit
d5da5b55c0
|
@ -927,203 +927,203 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/api",
|
"ImportPath": "github.com/google/cadvisor/api",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/cache/memory",
|
"ImportPath": "github.com/google/cadvisor/cache/memory",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/collector",
|
"ImportPath": "github.com/google/cadvisor/collector",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/container",
|
"ImportPath": "github.com/google/cadvisor/container",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/container/common",
|
"ImportPath": "github.com/google/cadvisor/container/common",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/container/docker",
|
"ImportPath": "github.com/google/cadvisor/container/docker",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/container/libcontainer",
|
"ImportPath": "github.com/google/cadvisor/container/libcontainer",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/container/raw",
|
"ImportPath": "github.com/google/cadvisor/container/raw",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/container/rkt",
|
"ImportPath": "github.com/google/cadvisor/container/rkt",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/container/systemd",
|
"ImportPath": "github.com/google/cadvisor/container/systemd",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/devicemapper",
|
"ImportPath": "github.com/google/cadvisor/devicemapper",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/events",
|
"ImportPath": "github.com/google/cadvisor/events",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/fs",
|
"ImportPath": "github.com/google/cadvisor/fs",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/healthz",
|
"ImportPath": "github.com/google/cadvisor/healthz",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/http",
|
"ImportPath": "github.com/google/cadvisor/http",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/http/mux",
|
"ImportPath": "github.com/google/cadvisor/http/mux",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/info/v1",
|
"ImportPath": "github.com/google/cadvisor/info/v1",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/info/v1/test",
|
"ImportPath": "github.com/google/cadvisor/info/v1/test",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/info/v2",
|
"ImportPath": "github.com/google/cadvisor/info/v2",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/machine",
|
"ImportPath": "github.com/google/cadvisor/machine",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/manager",
|
"ImportPath": "github.com/google/cadvisor/manager",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/manager/watcher",
|
"ImportPath": "github.com/google/cadvisor/manager/watcher",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/manager/watcher/raw",
|
"ImportPath": "github.com/google/cadvisor/manager/watcher/raw",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/manager/watcher/rkt",
|
"ImportPath": "github.com/google/cadvisor/manager/watcher/rkt",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/metrics",
|
"ImportPath": "github.com/google/cadvisor/metrics",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/pages",
|
"ImportPath": "github.com/google/cadvisor/pages",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/pages/static",
|
"ImportPath": "github.com/google/cadvisor/pages/static",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/storage",
|
"ImportPath": "github.com/google/cadvisor/storage",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/summary",
|
"ImportPath": "github.com/google/cadvisor/summary",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/utils",
|
"ImportPath": "github.com/google/cadvisor/utils",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/utils/cloudinfo",
|
"ImportPath": "github.com/google/cadvisor/utils/cloudinfo",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/utils/cpuload",
|
"ImportPath": "github.com/google/cadvisor/utils/cpuload",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/utils/cpuload/netlink",
|
"ImportPath": "github.com/google/cadvisor/utils/cpuload/netlink",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/utils/docker",
|
"ImportPath": "github.com/google/cadvisor/utils/docker",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/utils/oomparser",
|
"ImportPath": "github.com/google/cadvisor/utils/oomparser",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/utils/sysfs",
|
"ImportPath": "github.com/google/cadvisor/utils/sysfs",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/utils/sysinfo",
|
"ImportPath": "github.com/google/cadvisor/utils/sysinfo",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/utils/tail",
|
"ImportPath": "github.com/google/cadvisor/utils/tail",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/validate",
|
"ImportPath": "github.com/google/cadvisor/validate",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/cadvisor/version",
|
"ImportPath": "github.com/google/cadvisor/version",
|
||||||
"Comment": "v0.23.4",
|
"Comment": "v0.23.5",
|
||||||
"Rev": "7d22cf63253c17bad8ab64b8eef679718d00342e"
|
"Rev": "3ecedda96383d3342a5c8e5b8f39c7c9db65982f"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/google/gofuzz",
|
"ImportPath": "github.com/google/gofuzz",
|
||||||
|
|
|
@ -22,6 +22,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
dockertypes "github.com/docker/engine-api/types"
|
||||||
"github.com/google/cadvisor/container"
|
"github.com/google/cadvisor/container"
|
||||||
"github.com/google/cadvisor/container/libcontainer"
|
"github.com/google/cadvisor/container/libcontainer"
|
||||||
"github.com/google/cadvisor/devicemapper"
|
"github.com/google/cadvisor/devicemapper"
|
||||||
|
@ -171,6 +172,31 @@ var (
|
||||||
version_re = regexp.MustCompile(version_regexp_string)
|
version_re = regexp.MustCompile(version_regexp_string)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func startThinPoolWatcher(dockerInfo *dockertypes.Info) (*devicemapper.ThinPoolWatcher, error) {
|
||||||
|
_, err := devicemapper.ThinLsBinaryPresent()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
dockerThinPoolName, err := dockerutil.DockerThinPoolName(*dockerInfo)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
dockerMetadataDevice, err := dockerutil.DockerMetadataDevice(*dockerInfo)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
thinPoolWatcher, err := devicemapper.NewThinPoolWatcher(dockerThinPoolName, dockerMetadataDevice)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
go thinPoolWatcher.Start()
|
||||||
|
return thinPoolWatcher, nil
|
||||||
|
}
|
||||||
|
|
||||||
// Register root container before running this function!
|
// Register root container before running this function!
|
||||||
func Register(factory info.MachineInfoFactory, fsInfo fs.FsInfo, ignoreMetrics container.MetricSet) error {
|
func Register(factory info.MachineInfoFactory, fsInfo fs.FsInfo, ignoreMetrics container.MetricSet) error {
|
||||||
client, err := Client()
|
client, err := Client()
|
||||||
|
@ -191,40 +217,11 @@ func Register(factory info.MachineInfoFactory, fsInfo fs.FsInfo, ignoreMetrics c
|
||||||
return fmt.Errorf("failed to get cgroup subsystems: %v", err)
|
return fmt.Errorf("failed to get cgroup subsystems: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var thinPoolWatcher *devicemapper.ThinPoolWatcher
|
||||||
dockerStorageDriver = storageDriver(dockerInfo.Driver)
|
if storageDriver(dockerInfo.Driver) == devicemapperStorageDriver {
|
||||||
thinPoolWatcher *devicemapper.ThinPoolWatcher = nil
|
thinPoolWatcher, err = startThinPoolWatcher(dockerInfo)
|
||||||
)
|
if err != nil {
|
||||||
|
glog.Errorf("devicemapper filesystem stats will not be reported: %v", err)
|
||||||
if dockerStorageDriver == devicemapperStorageDriver {
|
|
||||||
_, err := devicemapper.ThinLsBinaryPresent()
|
|
||||||
if err == nil {
|
|
||||||
// If the storage driver is devicemapper, create and start a
|
|
||||||
// ThinPoolWatcher to monitor the size of container CoW layers
|
|
||||||
// with thin_ls.
|
|
||||||
dockerThinPoolName, err := dockerutil.DockerThinPoolName(*dockerInfo)
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("couldn't find device mapper thin pool name: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
dockerMetadataDevice, err := dockerutil.DockerMetadataDevice(*dockerInfo)
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("couldn't determine devicemapper metadata device: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
thinPoolWatcher, err = devicemapper.NewThinPoolWatcher(dockerThinPoolName, dockerMetadataDevice)
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("couldn't create thin pool watcher: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
go thinPoolWatcher.Start()
|
|
||||||
} else {
|
|
||||||
msg := []string{
|
|
||||||
"Couldn't locate thin_ls binary; not starting thin pool watcher.",
|
|
||||||
"Containers backed by thin pools will not show accurate usage.",
|
|
||||||
"err: %v",
|
|
||||||
}
|
|
||||||
glog.Errorf(strings.Join(msg, " "), err)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ package docker
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
dockertypes "github.com/docker/engine-api/types"
|
dockertypes "github.com/docker/engine-api/types"
|
||||||
|
@ -50,8 +51,19 @@ func DockerThinPoolName(info dockertypes.Info) (string, error) {
|
||||||
|
|
||||||
func DockerMetadataDevice(info dockertypes.Info) (string, error) {
|
func DockerMetadataDevice(info dockertypes.Info) (string, error) {
|
||||||
metadataDevice := DriverStatusValue(info.DriverStatus, DriverStatusMetadataFile)
|
metadataDevice := DriverStatusValue(info.DriverStatus, DriverStatusMetadataFile)
|
||||||
if len(metadataDevice) == 0 {
|
if len(metadataDevice) != 0 {
|
||||||
return "", fmt.Errorf("Could not get the devicemapper metadata device")
|
return metadataDevice, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
poolName, err := DockerThinPoolName(info)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
metadataDevice = fmt.Sprintf("/dev/mapper/%s_tmeta", poolName)
|
||||||
|
|
||||||
|
if _, err := os.Stat(metadataDevice); err != nil {
|
||||||
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
return metadataDevice, nil
|
return metadataDevice, nil
|
||||||
|
|
Loading…
Reference in New Issue