From 409bc8ccc05aa82bf0e890cc8fe78e4c58965f7f Mon Sep 17 00:00:00 2001 From: Harshal Patil Date: Tue, 20 Jun 2023 15:08:29 -0400 Subject: [PATCH] deps: Bump to cAdvisor v0.47.2 Signed-off-by: Harshal Patil --- go.mod | 2 +- go.sum | 4 ++-- .../google/cadvisor/container/crio/handler.go | 20 ++++++++++++------- vendor/modules.txt | 2 +- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 14e3dcc18bf..2857384f23a 100644 --- a/go.mod +++ b/go.mod @@ -37,7 +37,7 @@ require ( github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.3 - github.com/google/cadvisor v0.47.1 + github.com/google/cadvisor v0.47.2 github.com/google/cel-go v0.16.0 github.com/google/gnostic-models v0.6.8 github.com/google/go-cmp v0.5.9 diff --git a/go.sum b/go.sum index 2f2ffd5e3a4..c260e1e5614 100644 --- a/go.sum +++ b/go.sum @@ -478,8 +478,8 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= -github.com/google/cadvisor v0.47.1 h1:YyKnRy/3myRNGOvF1bNF9FFnpjY7Gky5yKi/ZlN+BSo= -github.com/google/cadvisor v0.47.1/go.mod h1:iJdTjcjyKHjLCf7OSTzwP5GxdfrkPusw2x5bwGvuLUw= +github.com/google/cadvisor v0.47.2 h1:lOS3Yprk88AIUi260eKYmTC4pKWAFkXV6Xev5jfCIP8= +github.com/google/cadvisor v0.47.2/go.mod h1:iJdTjcjyKHjLCf7OSTzwP5GxdfrkPusw2x5bwGvuLUw= github.com/google/cel-go v0.16.0 h1:DG9YQ8nFCFXAs/FDDwBxmL1tpKNrdlGUM9U3537bX/Y= github.com/google/cel-go v0.16.0/go.mod h1:HXZKzB0LXqer5lHHgfWAnlYwJaQBDKMjxjulNQzhwhY= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= diff --git a/vendor/github.com/google/cadvisor/container/crio/handler.go b/vendor/github.com/google/cadvisor/container/crio/handler.go index 9a06cac3533..08857785653 100644 --- a/vendor/github.com/google/cadvisor/container/crio/handler.go +++ b/vendor/github.com/google/cadvisor/container/crio/handler.go @@ -305,14 +305,20 @@ func (h *crioContainerHandler) GetStats() (*info.ContainerStats, error) { if err != nil { return stats, err } - // Clean up stats for containers that don't have their own network - this - // includes containers running in Kubernetes pods that use the network of the - // infrastructure container. This stops metrics being reported multiple times - // for each container in a pod. - if !h.needNet() { - stats.Network = info.NetworkStats{} - } + if !h.needNet() { + // Clean up stats for containers that don't have their own network - this + // includes containers running in Kubernetes pods that use the network of the + // infrastructure container. This stops metrics being reported multiple times + // for each container in a pod. + stats.Network = info.NetworkStats{} + } else if len(stats.Network.Interfaces) == 0 { + // No network related information indicates that the pid of the + // container is not longer valid and we need to ask crio to + // provide the pid of another container from that pod + h.pidKnown = false + return stats, nil + } // Get filesystem stats. err = h.getFsStats(stats) if err != nil { diff --git a/vendor/modules.txt b/vendor/modules.txt index 7bf112fb2a4..9eac36a47df 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -303,7 +303,7 @@ github.com/golang/protobuf/ptypes/wrappers # github.com/google/btree v1.0.1 ## explicit; go 1.12 github.com/google/btree -# github.com/google/cadvisor v0.47.1 +# github.com/google/cadvisor v0.47.2 ## explicit; go 1.16 github.com/google/cadvisor/cache/memory github.com/google/cadvisor/client/v2