mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
rebase: update replaced k8s.io modules to v0.33.0
Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
committed by
mergify[bot]
parent
dd77e72800
commit
107407b44b
2
e2e/vendor/github.com/google/cadvisor/container/common/helpers.go
generated
vendored
2
e2e/vendor/github.com/google/cadvisor/container/common/helpers.go
generated
vendored
@ -24,7 +24,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/karrick/godirwalk"
|
||||
"github.com/opencontainers/runc/libcontainer/cgroups"
|
||||
"github.com/opencontainers/cgroups"
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/sys/unix"
|
||||
|
||||
|
8
e2e/vendor/github.com/google/cadvisor/container/containerd/client.go
generated
vendored
8
e2e/vendor/github.com/google/cadvisor/container/containerd/client.go
generated
vendored
@ -26,7 +26,7 @@ import (
|
||||
tasksapi "github.com/containerd/containerd/api/services/tasks/v1"
|
||||
versionapi "github.com/containerd/containerd/api/services/version/v1"
|
||||
tasktypes "github.com/containerd/containerd/api/types/task"
|
||||
"github.com/containerd/errdefs"
|
||||
"github.com/containerd/errdefs/pkg/errgrpc"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/backoff"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
@ -114,7 +114,7 @@ func (c *client) LoadContainer(ctx context.Context, id string) (*containers.Cont
|
||||
ID: id,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, errdefs.FromGRPC(err)
|
||||
return nil, errgrpc.ToNative(err)
|
||||
}
|
||||
return containerFromProto(r.Container), nil
|
||||
}
|
||||
@ -124,7 +124,7 @@ func (c *client) TaskPid(ctx context.Context, id string) (uint32, error) {
|
||||
ContainerID: id,
|
||||
})
|
||||
if err != nil {
|
||||
return 0, errdefs.FromGRPC(err)
|
||||
return 0, errgrpc.ToNative(err)
|
||||
}
|
||||
if response.Process.Status == tasktypes.Status_UNKNOWN {
|
||||
return 0, ErrTaskIsInUnknownState
|
||||
@ -135,7 +135,7 @@ func (c *client) TaskPid(ctx context.Context, id string) (uint32, error) {
|
||||
func (c *client) Version(ctx context.Context) (string, error) {
|
||||
response, err := c.versionService.Version(ctx, &emptypb.Empty{})
|
||||
if err != nil {
|
||||
return "", errdefs.FromGRPC(err)
|
||||
return "", errgrpc.ToNative(err)
|
||||
}
|
||||
return response.Version, nil
|
||||
}
|
||||
|
2
e2e/vendor/github.com/google/cadvisor/container/containerd/handler.go
generated
vendored
2
e2e/vendor/github.com/google/cadvisor/container/containerd/handler.go
generated
vendored
@ -23,7 +23,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/containerd/errdefs"
|
||||
"github.com/opencontainers/runc/libcontainer/cgroups"
|
||||
"github.com/opencontainers/cgroups"
|
||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||
"golang.org/x/net/context"
|
||||
|
||||
|
2
e2e/vendor/github.com/google/cadvisor/container/crio/handler.go
generated
vendored
2
e2e/vendor/github.com/google/cadvisor/container/crio/handler.go
generated
vendored
@ -21,7 +21,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/opencontainers/runc/libcontainer/cgroups"
|
||||
"github.com/opencontainers/cgroups"
|
||||
|
||||
"github.com/google/cadvisor/container"
|
||||
"github.com/google/cadvisor/container/common"
|
||||
|
2
e2e/vendor/github.com/google/cadvisor/container/factory.go
generated
vendored
2
e2e/vendor/github.com/google/cadvisor/container/factory.go
generated
vendored
@ -66,6 +66,7 @@ const (
|
||||
ResctrlMetrics MetricKind = "resctrl"
|
||||
CPUSetMetrics MetricKind = "cpuset"
|
||||
OOMMetrics MetricKind = "oom_event"
|
||||
PressureMetrics MetricKind = "pressure"
|
||||
)
|
||||
|
||||
// AllMetrics represents all kinds of metrics that cAdvisor supported.
|
||||
@ -91,6 +92,7 @@ var AllMetrics = MetricSet{
|
||||
ResctrlMetrics: struct{}{},
|
||||
CPUSetMetrics: struct{}{},
|
||||
OOMMetrics: struct{}{},
|
||||
PressureMetrics: struct{}{},
|
||||
}
|
||||
|
||||
// AllNetworkMetrics represents all network metrics that cAdvisor supports.
|
||||
|
35
e2e/vendor/github.com/google/cadvisor/container/libcontainer/handler.go
generated
vendored
35
e2e/vendor/github.com/google/cadvisor/container/libcontainer/handler.go
generated
vendored
@ -28,8 +28,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/opencontainers/runc/libcontainer/cgroups"
|
||||
"github.com/opencontainers/runc/libcontainer/cgroups/fs2"
|
||||
"github.com/opencontainers/cgroups"
|
||||
"github.com/opencontainers/cgroups/fs2"
|
||||
"k8s.io/klog/v2"
|
||||
|
||||
"github.com/google/cadvisor/container"
|
||||
@ -717,10 +717,7 @@ func scanUDPStats(r io.Reader) (info.UdpStat, error) {
|
||||
return stats, scanner.Err()
|
||||
}
|
||||
|
||||
listening := uint64(0)
|
||||
dropped := uint64(0)
|
||||
rxQueued := uint64(0)
|
||||
txQueued := uint64(0)
|
||||
var listening, dropped, rxQueued, txQueued uint64
|
||||
|
||||
for scanner.Scan() {
|
||||
line := scanner.Text()
|
||||
@ -733,8 +730,11 @@ func scanUDPStats(r io.Reader) (info.UdpStat, error) {
|
||||
continue
|
||||
}
|
||||
|
||||
rx, tx := uint64(0), uint64(0)
|
||||
fmt.Sscanf(fs[4], "%X:%X", &rx, &tx)
|
||||
var rx, tx uint64
|
||||
_, err := fmt.Sscanf(fs[4], "%X:%X", &rx, &tx)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
rxQueued += rx
|
||||
txQueued += tx
|
||||
|
||||
@ -771,6 +771,7 @@ func setCPUStats(s *cgroups.Stats, ret *info.ContainerStats, withPerCPU bool) {
|
||||
ret.Cpu.CFS.Periods = s.CpuStats.ThrottlingData.Periods
|
||||
ret.Cpu.CFS.ThrottledPeriods = s.CpuStats.ThrottlingData.ThrottledPeriods
|
||||
ret.Cpu.CFS.ThrottledTime = s.CpuStats.ThrottlingData.ThrottledTime
|
||||
setPSIStats(s.CpuStats.PSI, &ret.Cpu.PSI)
|
||||
|
||||
if !withPerCPU {
|
||||
return
|
||||
@ -792,6 +793,7 @@ func setDiskIoStats(s *cgroups.Stats, ret *info.ContainerStats) {
|
||||
ret.DiskIo.IoWaitTime = diskStatsCopy(s.BlkioStats.IoWaitTimeRecursive)
|
||||
ret.DiskIo.IoMerged = diskStatsCopy(s.BlkioStats.IoMergedRecursive)
|
||||
ret.DiskIo.IoTime = diskStatsCopy(s.BlkioStats.IoTimeRecursive)
|
||||
setPSIStats(s.BlkioStats.PSI, &ret.DiskIo.PSI)
|
||||
}
|
||||
|
||||
func setMemoryStats(s *cgroups.Stats, ret *info.ContainerStats) {
|
||||
@ -799,6 +801,7 @@ func setMemoryStats(s *cgroups.Stats, ret *info.ContainerStats) {
|
||||
ret.Memory.MaxUsage = s.MemoryStats.Usage.MaxUsage
|
||||
ret.Memory.Failcnt = s.MemoryStats.Usage.Failcnt
|
||||
ret.Memory.KernelUsage = s.MemoryStats.KernelUsage.Usage
|
||||
setPSIStats(s.MemoryStats.PSI, &ret.Memory.PSI)
|
||||
|
||||
if cgroups.IsCgroup2UnifiedMode() {
|
||||
ret.Memory.Cache = s.MemoryStats.Stats["file"]
|
||||
@ -884,6 +887,22 @@ func setHugepageStats(s *cgroups.Stats, ret *info.ContainerStats) {
|
||||
}
|
||||
}
|
||||
|
||||
func setPSIData(d *cgroups.PSIData, ret *info.PSIData) {
|
||||
if d != nil {
|
||||
ret.Total = d.Total
|
||||
ret.Avg10 = d.Avg10
|
||||
ret.Avg60 = d.Avg60
|
||||
ret.Avg300 = d.Avg300
|
||||
}
|
||||
}
|
||||
|
||||
func setPSIStats(s *cgroups.PSIStats, ret *info.PSIStats) {
|
||||
if s != nil {
|
||||
setPSIData(&s.Full, &ret.Full)
|
||||
setPSIData(&s.Some, &ret.Some)
|
||||
}
|
||||
}
|
||||
|
||||
// read from pids path not cpu
|
||||
func setThreadsStats(s *cgroups.Stats, ret *info.ContainerStats) {
|
||||
if s != nil {
|
||||
|
15
e2e/vendor/github.com/google/cadvisor/container/libcontainer/helpers.go
generated
vendored
15
e2e/vendor/github.com/google/cadvisor/container/libcontainer/helpers.go
generated
vendored
@ -17,15 +17,12 @@ package libcontainer
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/google/cadvisor/container"
|
||||
info "github.com/google/cadvisor/info/v1"
|
||||
|
||||
"github.com/opencontainers/runc/libcontainer/cgroups"
|
||||
|
||||
"github.com/google/cadvisor/container"
|
||||
|
||||
fs "github.com/opencontainers/runc/libcontainer/cgroups/fs"
|
||||
fs2 "github.com/opencontainers/runc/libcontainer/cgroups/fs2"
|
||||
configs "github.com/opencontainers/runc/libcontainer/configs"
|
||||
"github.com/opencontainers/cgroups"
|
||||
fs "github.com/opencontainers/cgroups/fs"
|
||||
fs2 "github.com/opencontainers/cgroups/fs2"
|
||||
"k8s.io/klog/v2"
|
||||
)
|
||||
|
||||
@ -157,9 +154,9 @@ func diskStatsCopy(blkioStats []cgroups.BlkioStatEntry) (stat []info.PerDiskStat
|
||||
}
|
||||
|
||||
func NewCgroupManager(name string, paths map[string]string) (cgroups.Manager, error) {
|
||||
config := &configs.Cgroup{
|
||||
config := &cgroups.Cgroup{
|
||||
Name: name,
|
||||
Resources: &configs.Resources{},
|
||||
Resources: &cgroups.Resources{},
|
||||
}
|
||||
if cgroups.IsCgroup2UnifiedMode() {
|
||||
path := paths[""]
|
||||
|
2
e2e/vendor/github.com/google/cadvisor/container/raw/handler.go
generated
vendored
2
e2e/vendor/github.com/google/cadvisor/container/raw/handler.go
generated
vendored
@ -24,8 +24,8 @@ import (
|
||||
"github.com/google/cadvisor/fs"
|
||||
info "github.com/google/cadvisor/info/v1"
|
||||
"github.com/google/cadvisor/machine"
|
||||
"github.com/opencontainers/runc/libcontainer/cgroups"
|
||||
|
||||
"github.com/opencontainers/cgroups"
|
||||
"k8s.io/klog/v2"
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user