mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-02-18 18:28:18 -05:00
Automatic merge from submit-queue (batch tested with PRs 67100, 67426). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. should check all error in ResourceCollector.Start() Signed-off-by: yanxuean <yan.xuean@zte.com.cn> **What this PR does / why we need it**: 1. We should check both errors. test/e2e_node/resource_collector.go ``` func (r *ResourceCollector) Start() { // Get the cgroup container names for kubelet and runtime kubeletContainer, err := getContainerNameForProcess(kubeletProcessName, "") runtimeContainer, err := getContainerNameForProcess(framework.TestContext.ContainerRuntimeProcessName, framework.TestContext.ContainerRuntimePidFile) if err == nil { systemContainers = map[string]string{ stats.SystemContainerKubelet: kubeletContainer, stats.SystemContainerRuntime: runtimeContainer, } } ``` 2. redundant compare The Timestamp.Equal is unlikely to occur, because we have met Timestamp.Before. ``` if oldStats, ok := oldStatsMap[name]; ok && oldStats.Timestamp.Before(newStats.Timestamp) { if oldStats.Timestamp.Equal(newStats.Timestamp) { continue } r.buffers[name] = append(r.buffers[name], computeContainerResourceUsage(name, oldStats, newStats)) } ``` **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ``` /sig-node |
||
|---|---|---|
| .. | ||
| builder | ||
| conformance | ||
| environment | ||
| jenkins | ||
| perftype | ||
| remote | ||
| runner | ||
| services | ||
| apparmor_test.go | ||
| benchmark_util.go | ||
| BUILD | ||
| container.go | ||
| container_log_rotation_test.go | ||
| container_manager_test.go | ||
| cpu_manager_test.go | ||
| critical_pod_test.go | ||
| density_test.go | ||
| device_plugin.go | ||
| doc.go | ||
| docker_test.go | ||
| docker_util.go | ||
| dockershim_checkpoint_test.go | ||
| dynamic_kubelet_config_test.go | ||
| e2e_node_suite_test.go | ||
| eviction_test.go | ||
| framework.go | ||
| garbage_collector_test.go | ||
| gke_environment_test.go | ||
| gpu_device_plugin.go | ||
| gubernator.sh | ||
| hugepages_test.go | ||
| image_id_test.go | ||
| image_list.go | ||
| kubelet_test.go | ||
| log_path_test.go | ||
| mirror_pod_test.go | ||
| node_container_manager_test.go | ||
| node_problem_detector_linux.go | ||
| OWNERS | ||
| pods_container_manager_test.go | ||
| README.md | ||
| resource_collector.go | ||
| resource_usage_test.go | ||
| restart_test.go | ||
| runtime_conformance_test.go | ||
| security_context_test.go | ||
| summary_test.go | ||
| util.go | ||
| volume_manager_test.go | ||