k3s/test
Kubernetes Submit Queue 949199e6ae
Merge pull request #67426 from yanxuean/check-both-err
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
2018-08-16 11:57:32 -07:00
..
cmd Merge pull request #67137 from juanvallejo/jvallejo/usability-fix-kube-get 2018-08-16 10:34:11 -07:00
conformance Merge pull request #67100 from mkurylec/promotion-lifecycle-hook-to-conformance 2018-08-16 11:57:28 -07:00
e2e Merge pull request #67100 from mkurylec/promotion-lifecycle-hook-to-conformance 2018-08-16 11:57:28 -07:00
e2e_kubeadm Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
e2e_node Merge pull request #67426 from yanxuean/check-both-err 2018-08-16 11:57:32 -07:00
fixtures Disable initializers by default 2018-07-10 15:14:32 -04:00
images add admissionv1beta1 in scheme 2018-08-14 08:25:54 -07:00
integration test/integration: use correct import path 2018-08-15 18:49:03 -04:00
kubemark Kubemark: don't recreate hollow node on VM reboot. 2018-08-16 10:45:32 +02:00
list
soak Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
typecheck Deduplicate identical typecheck errors between platforms. 2018-03-28 19:42:48 -07:00
utils Remove ARCH specific image consideration from e2e tests 2018-08-09 13:40:19 -04:00
BUILD move test-cmd guts to separate sig-cli maintained directory 2018-07-05 11:38:26 -04:00
OWNERS
test_owners.csv Remove the Heapster/InfluxDB test 2018-07-13 16:07:33 -04:00
test_owners.json