Update vendor dependencies
Change-Id: I3b1ca9f2687388c831d9d46a4e1de413ffae06ac
This commit is contained in:
2
vendor/github.com/google/cadvisor/devicemapper/BUILD
generated
vendored
2
vendor/github.com/google/cadvisor/devicemapper/BUILD
generated
vendored
@@ -12,7 +12,7 @@ go_library(
|
||||
importmap = "k8s.io/kubernetes/vendor/github.com/google/cadvisor/devicemapper",
|
||||
importpath = "github.com/google/cadvisor/devicemapper",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = ["//vendor/github.com/golang/glog:go_default_library"],
|
||||
deps = ["//vendor/k8s.io/klog:go_default_library"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
|
||||
4
vendor/github.com/google/cadvisor/devicemapper/dmsetup_client.go
generated
vendored
4
vendor/github.com/google/cadvisor/devicemapper/dmsetup_client.go
generated
vendored
@@ -18,7 +18,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/golang/glog"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
// DmsetupClient is a low-level client for interacting with device mapper via
|
||||
@@ -58,6 +58,6 @@ func (c *defaultDmsetupClient) Status(deviceName string) ([]byte, error) {
|
||||
}
|
||||
|
||||
func (*defaultDmsetupClient) dmsetup(args ...string) ([]byte, error) {
|
||||
glog.V(5).Infof("running dmsetup %v", strings.Join(args, " "))
|
||||
klog.V(5).Infof("running dmsetup %v", strings.Join(args, " "))
|
||||
return exec.Command("dmsetup", args...).Output()
|
||||
}
|
||||
|
||||
6
vendor/github.com/google/cadvisor/devicemapper/thin_ls_client.go
generated
vendored
6
vendor/github.com/google/cadvisor/devicemapper/thin_ls_client.go
generated
vendored
@@ -21,7 +21,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/golang/glog"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
// thinLsClient knows how to run a thin_ls very specific to CoW usage for
|
||||
@@ -53,7 +53,7 @@ var _ thinLsClient = &defaultThinLsClient{}
|
||||
|
||||
func (c *defaultThinLsClient) ThinLs(deviceName string) (map[string]uint64, error) {
|
||||
args := []string{"--no-headers", "-m", "-o", "DEV,EXCLUSIVE_BYTES", deviceName}
|
||||
glog.V(4).Infof("running command: thin_ls %v", strings.Join(args, " "))
|
||||
klog.V(4).Infof("running command: thin_ls %v", strings.Join(args, " "))
|
||||
|
||||
output, err := exec.Command(c.thinLsPath, args...).Output()
|
||||
if err != nil {
|
||||
@@ -80,7 +80,7 @@ func parseThinLsOutput(output []byte) map[string]uint64 {
|
||||
deviceID := fields[0]
|
||||
usage, err := strconv.ParseUint(fields[1], 10, 64)
|
||||
if err != nil {
|
||||
glog.Warningf("unexpected error parsing thin_ls output: %v", err)
|
||||
klog.Warningf("unexpected error parsing thin_ls output: %v", err)
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
20
vendor/github.com/google/cadvisor/devicemapper/thin_pool_watcher.go
generated
vendored
20
vendor/github.com/google/cadvisor/devicemapper/thin_pool_watcher.go
generated
vendored
@@ -19,7 +19,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/golang/glog"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
// ThinPoolWatcher maintains a cache of device name -> usage stats for a
|
||||
@@ -58,7 +58,7 @@ func NewThinPoolWatcher(poolName, metadataDevice string) (*ThinPoolWatcher, erro
|
||||
func (w *ThinPoolWatcher) Start() {
|
||||
err := w.Refresh()
|
||||
if err != nil {
|
||||
glog.Errorf("encountered error refreshing thin pool watcher: %v", err)
|
||||
klog.Errorf("encountered error refreshing thin pool watcher: %v", err)
|
||||
}
|
||||
|
||||
for {
|
||||
@@ -69,12 +69,12 @@ func (w *ThinPoolWatcher) Start() {
|
||||
start := time.Now()
|
||||
err = w.Refresh()
|
||||
if err != nil {
|
||||
glog.Errorf("encountered error refreshing thin pool watcher: %v", err)
|
||||
klog.Errorf("encountered error refreshing thin pool watcher: %v", err)
|
||||
}
|
||||
|
||||
// print latency for refresh
|
||||
duration := time.Since(start)
|
||||
glog.V(5).Infof("thin_ls(%d) took %s", start.Unix(), duration)
|
||||
klog.V(5).Infof("thin_ls(%d) took %s", start.Unix(), duration)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -115,7 +115,7 @@ func (w *ThinPoolWatcher) Refresh() error {
|
||||
}
|
||||
|
||||
if currentlyReserved {
|
||||
glog.V(5).Infof("metadata for %v is currently reserved; releasing", w.poolName)
|
||||
klog.V(5).Infof("metadata for %v is currently reserved; releasing", w.poolName)
|
||||
_, err = w.dmsetup.Message(w.poolName, 0, releaseMetadataMessage)
|
||||
if err != nil {
|
||||
err = fmt.Errorf("error releasing metadata snapshot for %v: %v", w.poolName, err)
|
||||
@@ -123,22 +123,22 @@ func (w *ThinPoolWatcher) Refresh() error {
|
||||
}
|
||||
}
|
||||
|
||||
glog.V(5).Infof("reserving metadata snapshot for thin-pool %v", w.poolName)
|
||||
klog.V(5).Infof("reserving metadata snapshot for thin-pool %v", w.poolName)
|
||||
// NOTE: "0" in the call below is for the 'sector' argument to 'dmsetup
|
||||
// message'. It's not needed for thin pools.
|
||||
if output, err := w.dmsetup.Message(w.poolName, 0, reserveMetadataMessage); err != nil {
|
||||
err = fmt.Errorf("error reserving metadata for thin-pool %v: %v output: %v", w.poolName, err, string(output))
|
||||
return err
|
||||
} else {
|
||||
glog.V(5).Infof("reserved metadata snapshot for thin-pool %v", w.poolName)
|
||||
klog.V(5).Infof("reserved metadata snapshot for thin-pool %v", w.poolName)
|
||||
}
|
||||
|
||||
defer func() {
|
||||
glog.V(5).Infof("releasing metadata snapshot for thin-pool %v", w.poolName)
|
||||
klog.V(5).Infof("releasing metadata snapshot for thin-pool %v", w.poolName)
|
||||
w.dmsetup.Message(w.poolName, 0, releaseMetadataMessage)
|
||||
}()
|
||||
|
||||
glog.V(5).Infof("running thin_ls on metadata device %v", w.metadataDevice)
|
||||
klog.V(5).Infof("running thin_ls on metadata device %v", w.metadataDevice)
|
||||
newCache, err := w.thinLsClient.ThinLs(w.metadataDevice)
|
||||
if err != nil {
|
||||
err = fmt.Errorf("error performing thin_ls on metadata device %v: %v", w.metadataDevice, err)
|
||||
@@ -157,7 +157,7 @@ const (
|
||||
// checkReservation checks to see whether the thin device is currently holding
|
||||
// userspace metadata.
|
||||
func (w *ThinPoolWatcher) checkReservation(poolName string) (bool, error) {
|
||||
glog.V(5).Infof("checking whether the thin-pool is holding a metadata snapshot")
|
||||
klog.V(5).Infof("checking whether the thin-pool is holding a metadata snapshot")
|
||||
output, err := w.dmsetup.Status(poolName)
|
||||
if err != nil {
|
||||
return false, err
|
||||
|
||||
Reference in New Issue
Block a user