Update vendor dependencies
Change-Id: I3b1ca9f2687388c831d9d46a4e1de413ffae06ac
This commit is contained in:
82
vendor/github.com/google/cadvisor/manager/manager.go
generated
vendored
82
vendor/github.com/google/cadvisor/manager/manager.go
generated
vendored
@@ -49,9 +49,9 @@ import (
|
||||
"github.com/google/cadvisor/utils/sysfs"
|
||||
"github.com/google/cadvisor/version"
|
||||
|
||||
"github.com/golang/glog"
|
||||
"github.com/opencontainers/runc/libcontainer/cgroups"
|
||||
"golang.org/x/net/context"
|
||||
"k8s.io/klog"
|
||||
"k8s.io/utils/clock"
|
||||
)
|
||||
|
||||
@@ -152,7 +152,7 @@ func New(memoryCache *memory.InMemoryCache, sysfs sysfs.SysFs, maxHousekeepingIn
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
glog.V(2).Infof("cAdvisor running in container: %q", selfContainer)
|
||||
klog.V(2).Infof("cAdvisor running in container: %q", selfContainer)
|
||||
|
||||
var (
|
||||
dockerStatus info.DockerStatus
|
||||
@@ -163,7 +163,7 @@ func New(memoryCache *memory.InMemoryCache, sysfs sysfs.SysFs, maxHousekeepingIn
|
||||
dockerStatus = retryDockerStatus()
|
||||
|
||||
if tmpRktPath, err := rkt.RktPath(); err != nil {
|
||||
glog.V(5).Infof("Rkt not connected: %v", err)
|
||||
klog.V(5).Infof("Rkt not connected: %v", err)
|
||||
} else {
|
||||
rktPath = tmpRktPath
|
||||
}
|
||||
@@ -174,7 +174,7 @@ func New(memoryCache *memory.InMemoryCache, sysfs sysfs.SysFs, maxHousekeepingIn
|
||||
}
|
||||
crioInfo, err := crioClient.Info()
|
||||
if err != nil {
|
||||
glog.V(5).Infof("CRI-O not connected: %v", err)
|
||||
klog.V(5).Infof("CRI-O not connected: %v", err)
|
||||
}
|
||||
|
||||
context := fs.Context{
|
||||
@@ -226,13 +226,13 @@ func New(memoryCache *memory.InMemoryCache, sysfs sysfs.SysFs, maxHousekeepingIn
|
||||
return nil, err
|
||||
}
|
||||
newManager.machineInfo = *machineInfo
|
||||
glog.V(1).Infof("Machine: %+v", newManager.machineInfo)
|
||||
klog.V(1).Infof("Machine: %+v", newManager.machineInfo)
|
||||
|
||||
versionInfo, err := getVersionInfo()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
glog.V(1).Infof("Version: %+v", *versionInfo)
|
||||
klog.V(1).Infof("Version: %+v", *versionInfo)
|
||||
|
||||
newManager.eventHandler = events.NewEventManager(parseEventsStoragePolicy())
|
||||
return newManager, nil
|
||||
@@ -250,9 +250,9 @@ func retryDockerStatus() info.DockerStatus {
|
||||
|
||||
switch err {
|
||||
case context.DeadlineExceeded:
|
||||
glog.Warningf("Timeout trying to communicate with docker during initialization, will retry")
|
||||
klog.Warningf("Timeout trying to communicate with docker during initialization, will retry")
|
||||
default:
|
||||
glog.V(5).Infof("Docker not connected: %v", err)
|
||||
klog.V(5).Infof("Docker not connected: %v", err)
|
||||
return info.DockerStatus{}
|
||||
}
|
||||
|
||||
@@ -298,12 +298,12 @@ type manager struct {
|
||||
func (self *manager) Start() error {
|
||||
err := docker.Register(self, self.fsInfo, self.includedMetrics)
|
||||
if err != nil {
|
||||
glog.V(5).Infof("Registration of the Docker container factory failed: %v.", err)
|
||||
klog.V(5).Infof("Registration of the Docker container factory failed: %v.", err)
|
||||
}
|
||||
|
||||
err = rkt.Register(self, self.fsInfo, self.includedMetrics)
|
||||
if err != nil {
|
||||
glog.V(5).Infof("Registration of the rkt container factory failed: %v", err)
|
||||
klog.V(5).Infof("Registration of the rkt container factory failed: %v", err)
|
||||
} else {
|
||||
watcher, err := rktwatcher.NewRktContainerWatcher()
|
||||
if err != nil {
|
||||
@@ -314,27 +314,27 @@ func (self *manager) Start() error {
|
||||
|
||||
err = containerd.Register(self, self.fsInfo, self.includedMetrics)
|
||||
if err != nil {
|
||||
glog.V(5).Infof("Registration of the containerd container factory failed: %v", err)
|
||||
klog.V(5).Infof("Registration of the containerd container factory failed: %v", err)
|
||||
}
|
||||
|
||||
err = crio.Register(self, self.fsInfo, self.includedMetrics)
|
||||
if err != nil {
|
||||
glog.V(5).Infof("Registration of the crio container factory failed: %v", err)
|
||||
klog.V(5).Infof("Registration of the crio container factory failed: %v", err)
|
||||
}
|
||||
|
||||
err = mesos.Register(self, self.fsInfo, self.includedMetrics)
|
||||
if err != nil {
|
||||
glog.V(5).Infof("Registration of the mesos container factory failed: %v", err)
|
||||
klog.V(5).Infof("Registration of the mesos container factory failed: %v", err)
|
||||
}
|
||||
|
||||
err = systemd.Register(self, self.fsInfo, self.includedMetrics)
|
||||
if err != nil {
|
||||
glog.V(5).Infof("Registration of the systemd container factory failed: %v", err)
|
||||
klog.V(5).Infof("Registration of the systemd container factory failed: %v", err)
|
||||
}
|
||||
|
||||
err = raw.Register(self, self.fsInfo, self.includedMetrics, self.rawContainerCgroupPathPrefixWhiteList)
|
||||
if err != nil {
|
||||
glog.Errorf("Registration of the raw container factory failed: %v", err)
|
||||
klog.Errorf("Registration of the raw container factory failed: %v", err)
|
||||
}
|
||||
|
||||
rawWatcher, err := rawwatcher.NewRawContainerWatcher()
|
||||
@@ -346,7 +346,7 @@ func (self *manager) Start() error {
|
||||
// Watch for OOMs.
|
||||
err = self.watchForNewOoms()
|
||||
if err != nil {
|
||||
glog.Warningf("Could not configure a source for OOM detection, disabling OOM events: %v", err)
|
||||
klog.Warningf("Could not configure a source for OOM detection, disabling OOM events: %v", err)
|
||||
}
|
||||
|
||||
// If there are no factories, don't start any housekeeping and serve the information we do have.
|
||||
@@ -362,12 +362,12 @@ func (self *manager) Start() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
glog.V(2).Infof("Starting recovery of all containers")
|
||||
klog.V(2).Infof("Starting recovery of all containers")
|
||||
err = self.detectSubcontainers("/")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
glog.V(2).Infof("Recovery completed")
|
||||
klog.V(2).Infof("Recovery completed")
|
||||
|
||||
// Watch for new container.
|
||||
quitWatcher := make(chan error)
|
||||
@@ -418,18 +418,18 @@ func (self *manager) globalHousekeeping(quit chan error) {
|
||||
// Check for new containers.
|
||||
err := self.detectSubcontainers("/")
|
||||
if err != nil {
|
||||
glog.Errorf("Failed to detect containers: %s", err)
|
||||
klog.Errorf("Failed to detect containers: %s", err)
|
||||
}
|
||||
|
||||
// Log if housekeeping took too long.
|
||||
duration := time.Since(start)
|
||||
if duration >= longHousekeeping {
|
||||
glog.V(3).Infof("Global Housekeeping(%d) took %s", t.Unix(), duration)
|
||||
klog.V(3).Infof("Global Housekeeping(%d) took %s", t.Unix(), duration)
|
||||
}
|
||||
case <-quit:
|
||||
// Quit if asked to do so.
|
||||
quit <- nil
|
||||
glog.Infof("Exiting global housekeeping thread")
|
||||
klog.Infof("Exiting global housekeeping thread")
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -630,7 +630,7 @@ func (self *manager) AllDockerContainers(query *info.ContainerInfoRequest) (map[
|
||||
if err != nil {
|
||||
// Ignore the error because of race condition and return best-effort result.
|
||||
if err == memory.ErrDataNotFound {
|
||||
glog.Warningf("Error getting data for container %s because of race condition", name)
|
||||
klog.Warningf("Error getting data for container %s because of race condition", name)
|
||||
continue
|
||||
}
|
||||
return nil, err
|
||||
@@ -890,7 +890,7 @@ func (m *manager) registerCollectors(collectorConfigs map[string]string, cont *c
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to read config file %q for config %q, container %q: %v", k, v, cont.info.Name, err)
|
||||
}
|
||||
glog.V(4).Infof("Got config from %q: %q", v, configFile)
|
||||
klog.V(4).Infof("Got config from %q: %q", v, configFile)
|
||||
|
||||
if strings.HasPrefix(k, "prometheus") || strings.HasPrefix(k, "Prometheus") {
|
||||
newCollector, err := collector.NewPrometheusCollector(k, configFile, *applicationMetricsCountLimit, cont.handler, m.collectorHttpClient)
|
||||
@@ -968,7 +968,7 @@ func (m *manager) createContainerLocked(containerName string, watchSource watche
|
||||
}
|
||||
if !accept {
|
||||
// ignoring this container.
|
||||
glog.V(4).Infof("ignoring container %q", containerName)
|
||||
klog.V(4).Infof("ignoring container %q", containerName)
|
||||
return nil
|
||||
}
|
||||
collectorManager, err := collector.NewCollectorManager()
|
||||
@@ -983,11 +983,11 @@ func (m *manager) createContainerLocked(containerName string, watchSource watche
|
||||
}
|
||||
devicesCgroupPath, err := handler.GetCgroupPath("devices")
|
||||
if err != nil {
|
||||
glog.Warningf("Error getting devices cgroup path: %v", err)
|
||||
klog.Warningf("Error getting devices cgroup path: %v", err)
|
||||
} else {
|
||||
cont.nvidiaCollector, err = m.nvidiaManager.GetCollector(devicesCgroupPath)
|
||||
if err != nil {
|
||||
glog.V(4).Infof("GPU metrics may be unavailable/incomplete for container %q: %v", cont.info.Name, err)
|
||||
klog.V(4).Infof("GPU metrics may be unavailable/incomplete for container %q: %v", cont.info.Name, err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -996,7 +996,7 @@ func (m *manager) createContainerLocked(containerName string, watchSource watche
|
||||
collectorConfigs := collector.GetCollectorConfigs(labels)
|
||||
err = m.registerCollectors(collectorConfigs, cont)
|
||||
if err != nil {
|
||||
glog.Warningf("Failed to register collectors for %q: %v", containerName, err)
|
||||
klog.Warningf("Failed to register collectors for %q: %v", containerName, err)
|
||||
}
|
||||
|
||||
// Add the container name and all its aliases. The aliases must be within the namespace of the factory.
|
||||
@@ -1008,7 +1008,7 @@ func (m *manager) createContainerLocked(containerName string, watchSource watche
|
||||
}] = cont
|
||||
}
|
||||
|
||||
glog.V(3).Infof("Added container: %q (aliases: %v, namespace: %q)", containerName, cont.info.Aliases, cont.info.Namespace)
|
||||
klog.V(3).Infof("Added container: %q (aliases: %v, namespace: %q)", containerName, cont.info.Aliases, cont.info.Namespace)
|
||||
|
||||
contSpec, err := cont.handler.GetSpec()
|
||||
if err != nil {
|
||||
@@ -1065,7 +1065,7 @@ func (m *manager) destroyContainerLocked(containerName string) error {
|
||||
Name: alias,
|
||||
})
|
||||
}
|
||||
glog.V(3).Infof("Destroyed container: %q (aliases: %v, namespace: %q)", containerName, cont.info.Aliases, cont.info.Namespace)
|
||||
klog.V(3).Infof("Destroyed container: %q (aliases: %v, namespace: %q)", containerName, cont.info.Aliases, cont.info.Namespace)
|
||||
|
||||
contRef, err := cont.handler.ContainerReference()
|
||||
if err != nil {
|
||||
@@ -1144,7 +1144,7 @@ func (m *manager) detectSubcontainers(containerName string) error {
|
||||
for _, cont := range added {
|
||||
err = m.createContainer(cont.Name, watcher.Raw)
|
||||
if err != nil {
|
||||
glog.Errorf("Failed to create existing container: %s: %s", cont.Name, err)
|
||||
klog.Errorf("Failed to create existing container: %s: %s", cont.Name, err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1152,7 +1152,7 @@ func (m *manager) detectSubcontainers(containerName string) error {
|
||||
for _, cont := range removed {
|
||||
err = m.destroyContainer(cont.Name)
|
||||
if err != nil {
|
||||
glog.Errorf("Failed to destroy existing container: %s: %s", cont.Name, err)
|
||||
klog.Errorf("Failed to destroy existing container: %s: %s", cont.Name, err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1192,7 +1192,7 @@ func (self *manager) watchForNewContainers(quit chan error) error {
|
||||
err = self.destroyContainer(event.Name)
|
||||
}
|
||||
if err != nil {
|
||||
glog.Warningf("Failed to process watch event %+v: %v", event, err)
|
||||
klog.Warningf("Failed to process watch event %+v: %v", event, err)
|
||||
}
|
||||
case <-quit:
|
||||
var errs partialFailure
|
||||
@@ -1209,7 +1209,7 @@ func (self *manager) watchForNewContainers(quit chan error) error {
|
||||
quit <- errs
|
||||
} else {
|
||||
quit <- nil
|
||||
glog.Infof("Exiting thread watching subcontainers")
|
||||
klog.Infof("Exiting thread watching subcontainers")
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -1219,7 +1219,7 @@ func (self *manager) watchForNewContainers(quit chan error) error {
|
||||
}
|
||||
|
||||
func (self *manager) watchForNewOoms() error {
|
||||
glog.V(2).Infof("Started watching for new ooms in manager")
|
||||
klog.V(2).Infof("Started watching for new ooms in manager")
|
||||
outStream := make(chan *oomparser.OomInstance, 10)
|
||||
oomLog, err := oomparser.New()
|
||||
if err != nil {
|
||||
@@ -1237,9 +1237,9 @@ func (self *manager) watchForNewOoms() error {
|
||||
}
|
||||
err := self.eventHandler.AddEvent(newEvent)
|
||||
if err != nil {
|
||||
glog.Errorf("failed to add OOM event for %q: %v", oomInstance.ContainerName, err)
|
||||
klog.Errorf("failed to add OOM event for %q: %v", oomInstance.ContainerName, err)
|
||||
}
|
||||
glog.V(3).Infof("Created an OOM event in container %q at %v", oomInstance.ContainerName, oomInstance.TimeOfDeath)
|
||||
klog.V(3).Infof("Created an OOM event in container %q at %v", oomInstance.ContainerName, oomInstance.TimeOfDeath)
|
||||
|
||||
newEvent = &info.Event{
|
||||
ContainerName: oomInstance.VictimContainerName,
|
||||
@@ -1254,7 +1254,7 @@ func (self *manager) watchForNewOoms() error {
|
||||
}
|
||||
err = self.eventHandler.AddEvent(newEvent)
|
||||
if err != nil {
|
||||
glog.Errorf("failed to add OOM kill event for %q: %v", oomInstance.ContainerName, err)
|
||||
klog.Errorf("failed to add OOM kill event for %q: %v", oomInstance.ContainerName, err)
|
||||
}
|
||||
}
|
||||
}()
|
||||
@@ -1285,12 +1285,12 @@ func parseEventsStoragePolicy() events.StoragePolicy {
|
||||
for _, part := range parts {
|
||||
items := strings.Split(part, "=")
|
||||
if len(items) != 2 {
|
||||
glog.Warningf("Unknown event storage policy %q when parsing max age", part)
|
||||
klog.Warningf("Unknown event storage policy %q when parsing max age", part)
|
||||
continue
|
||||
}
|
||||
dur, err := time.ParseDuration(items[1])
|
||||
if err != nil {
|
||||
glog.Warningf("Unable to parse event max age duration %q: %v", items[1], err)
|
||||
klog.Warningf("Unable to parse event max age duration %q: %v", items[1], err)
|
||||
continue
|
||||
}
|
||||
if items[0] == "default" {
|
||||
@@ -1305,12 +1305,12 @@ func parseEventsStoragePolicy() events.StoragePolicy {
|
||||
for _, part := range parts {
|
||||
items := strings.Split(part, "=")
|
||||
if len(items) != 2 {
|
||||
glog.Warningf("Unknown event storage policy %q when parsing max event limit", part)
|
||||
klog.Warningf("Unknown event storage policy %q when parsing max event limit", part)
|
||||
continue
|
||||
}
|
||||
val, err := strconv.Atoi(items[1])
|
||||
if err != nil {
|
||||
glog.Warningf("Unable to parse integer from %q: %v", items[1], err)
|
||||
klog.Warningf("Unable to parse integer from %q: %v", items[1], err)
|
||||
continue
|
||||
}
|
||||
if items[0] == "default" {
|
||||
|
Reference in New Issue
Block a user