Skip to content

Commit 748b52a

Browse files
committed
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 <[email protected]>
1 parent 7140b49 commit 748b52a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/kubelet/stats/cri_stats_provider.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,11 @@ func (p *criStatsProvider) addCadvisorContainerStats(
905905
if memory != nil {
906906
cs.Memory = memory
907907
}
908+
909+
swap := cadvisorInfoToSwapStats(caPodStats)
910+
if swap != nil {
911+
cs.Swap = swap
912+
}
908913
}
909914

910915
func (p *criStatsProvider) addCadvisorContainerCPUAndMemoryStats(

0 commit comments

Comments
 (0)