cri_provider, bugfix: Add cadvisor container stats

Without this fix, when CRI stats provided collects cadvisor
stats, pod swap stats are being collected but corresponding
container swap stats are not. This commit fixes this.

Signed-off-by: Itamar Holder <iholder@redhat.com>
This commit is contained in:
Itamar Holder 2025-01-05 15:25:01 +02:00
parent 7140b4910c
commit 748b52a130

View File

@ -905,6 +905,11 @@ func (p *criStatsProvider) addCadvisorContainerStats(
if memory != nil { if memory != nil {
cs.Memory = memory cs.Memory = memory
} }
swap := cadvisorInfoToSwapStats(caPodStats)
if swap != nil {
cs.Swap = swap
}
} }
func (p *criStatsProvider) addCadvisorContainerCPUAndMemoryStats( func (p *criStatsProvider) addCadvisorContainerCPUAndMemoryStats(