Skip to content

Commit 9df42c0

Browse files
authored
Merge pull request kubernetes#89641 from tanjunchen/remove-dependeny-20200330
test/e2e/framework/kubelet/:remove the direct dependency to k8s.io/kubernetes/pkg
2 parents 24d8a17 + 72558ad commit 9df42c0

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

test/e2e/framework/kubelet/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ go_library(
1212
deps = [
1313
"//pkg/kubelet/apis/config:go_default_library",
1414
"//pkg/kubelet/apis/stats/v1alpha1:go_default_library",
15-
"//pkg/kubelet/dockershim/metrics:go_default_library",
1615
"//staging/src/k8s.io/api/core/v1:go_default_library",
1716
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
1817
"//staging/src/k8s.io/apimachinery/pkg/util/errors:go_default_library",

test/e2e/framework/kubelet/stats.go

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,25 @@ import (
3434
clientset "k8s.io/client-go/kubernetes"
3535
restclient "k8s.io/client-go/rest"
3636
kubeletstatsv1alpha1 "k8s.io/kubernetes/pkg/kubelet/apis/stats/v1alpha1"
37-
dockermetrics "k8s.io/kubernetes/pkg/kubelet/dockershim/metrics"
3837
"k8s.io/kubernetes/test/e2e/framework"
3938
e2emetrics "k8s.io/kubernetes/test/e2e/framework/metrics"
4039
)
4140

4241
const (
4342
// timeout for proxy requests.
4443
proxyTimeout = 2 * time.Minute
44+
45+
// dockerOperationsKey is the key for docker operation metrics.
46+
// copied from k8s.io/kubernetes/pkg/kubelet/dockershim/metrics
47+
dockerOperationsKey = "docker_operations_total"
48+
49+
// dockerOperationsErrorsKey is the key for the operation error metrics.
50+
// copied from k8s.io/kubernetes/pkg/kubelet/dockershim/metrics
51+
dockerOperationsErrorsKey = "docker_operations_errors_total"
52+
53+
// dockerOperationsTimeoutKey is the key for the operation timeout metrics.
54+
// copied from k8s.io/kubernetes/pkg/kubelet/dockershim/metrics
55+
dockerOperationsTimeoutKey = "docker_operations_timeout_total"
4556
)
4657

4758
// ContainerResourceUsage is a structure for gathering container resource usage.
@@ -190,9 +201,9 @@ func getNodeRuntimeOperationErrorRate(c clientset.Interface, node string) (NodeR
190201
}
191202
// If no corresponding metrics are found, the returned samples will be empty. Then the following
192203
// loop will be skipped automatically.
193-
allOps := ms[dockermetrics.DockerOperationsKey]
194-
errOps := ms[dockermetrics.DockerOperationsErrorsKey]
195-
timeoutOps := ms[dockermetrics.DockerOperationsTimeoutKey]
204+
allOps := ms[dockerOperationsKey]
205+
errOps := ms[dockerOperationsErrorsKey]
206+
timeoutOps := ms[dockerOperationsTimeoutKey]
196207
for _, sample := range allOps {
197208
operation := string(sample.Metric["operation_type"])
198209
result[operation] = &RuntimeOperationErrorRate{TotalNumber: float64(sample.Value)}

0 commit comments

Comments
 (0)