mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-10-28 20:30:09 +00:00
Update cAdvisor.
Also update golang.org/x/sys because of google/cadvisor#1786
This commit is contained in:
13
vendor/github.com/google/cadvisor/manager/container.go
generated
vendored
13
vendor/github.com/google/cadvisor/manager/container.go
generated
vendored
@@ -29,6 +29,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/google/cadvisor/accelerators"
|
||||
"github.com/google/cadvisor/cache/memory"
|
||||
"github.com/google/cadvisor/collector"
|
||||
"github.com/google/cadvisor/container"
|
||||
@@ -78,6 +79,9 @@ type containerData struct {
|
||||
|
||||
// Runs custom metric collectors.
|
||||
collectorManager collector.CollectorManager
|
||||
|
||||
// nvidiaCollector updates stats for Nvidia GPUs attached to the container.
|
||||
nvidiaCollector accelerators.AcceleratorCollector
|
||||
}
|
||||
|
||||
// jitter returns a time.Duration between duration and duration + maxFactor * duration,
|
||||
@@ -557,6 +561,12 @@ func (c *containerData) updateStats() error {
|
||||
}
|
||||
}
|
||||
|
||||
var nvidiaStatsErr error
|
||||
if c.nvidiaCollector != nil {
|
||||
// This updates the Accelerators field of the stats struct
|
||||
nvidiaStatsErr = c.nvidiaCollector.UpdateStats(stats)
|
||||
}
|
||||
|
||||
ref, err := c.handler.ContainerReference()
|
||||
if err != nil {
|
||||
// Ignore errors if the container is dead.
|
||||
@@ -572,6 +582,9 @@ func (c *containerData) updateStats() error {
|
||||
if statsErr != nil {
|
||||
return statsErr
|
||||
}
|
||||
if nvidiaStatsErr != nil {
|
||||
return nvidiaStatsErr
|
||||
}
|
||||
return customStatsErr
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user