mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
vendor update for CSI 0.3.0
This commit is contained in:
16
vendor/k8s.io/kubernetes/pkg/kubelet/stats/helper.go
generated
vendored
16
vendor/k8s.io/kubernetes/pkg/kubelet/stats/helper.go
generated
vendored
@ -27,9 +27,13 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
statsapi "k8s.io/kubernetes/pkg/kubelet/apis/stats/v1alpha1"
|
||||
"k8s.io/kubernetes/pkg/kubelet/cadvisor"
|
||||
"k8s.io/kubernetes/pkg/kubelet/network"
|
||||
)
|
||||
|
||||
// defaultNetworkInterfaceName is used for collectng network stats.
|
||||
// This logic relies on knowledge of the container runtime implementation and
|
||||
// is not reliable.
|
||||
const defaultNetworkInterfaceName = "eth0"
|
||||
|
||||
func cadvisorInfoToCPUandMemoryStats(info *cadvisorapiv2.ContainerInfo) (*statsapi.CPUStats, *statsapi.MemoryStats) {
|
||||
cstat, found := latestContainerStats(info)
|
||||
if !found {
|
||||
@ -153,7 +157,7 @@ func cadvisorInfoToNetworkStats(name string, info *cadvisorapiv2.ContainerInfo)
|
||||
TxErrors: &inter.TxErrors,
|
||||
}
|
||||
|
||||
if inter.Name == network.DefaultInterfaceName {
|
||||
if inter.Name == defaultNetworkInterfaceName {
|
||||
iStats.InterfaceStats = iStat
|
||||
}
|
||||
|
||||
@ -299,3 +303,11 @@ func buildRootfsStats(cstat *cadvisorapiv2.ContainerStats, imageFs *cadvisorapiv
|
||||
Inodes: imageFs.Inodes,
|
||||
}
|
||||
}
|
||||
|
||||
func getUint64Value(value *uint64) uint64 {
|
||||
if value == nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
return *value
|
||||
}
|
||||
|
Reference in New Issue
Block a user