File tree 3 files changed +16
-6
lines changed 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ require (
28
28
go.uber.org/zap v1.27.0
29
29
golang.org/x/sys v0.30.0
30
30
k8s.io/apimachinery v0.0.0-20250319092800-e8a77bd768fd
31
- k8s.io/client-go v0.0.0-20250319053412-169f1af1bf07
31
+ k8s.io/client-go v0.0.0-20250319213421-a9cdb028d1bd
32
32
k8s.io/klog/v2 v2.130.1
33
33
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738
34
34
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3
@@ -79,7 +79,7 @@ require (
79
79
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
80
80
gopkg.in/inf.v0 v0.9.1 // indirect
81
81
gopkg.in/yaml.v3 v3.0.1 // indirect
82
- k8s.io/api v0.0.0-20250319173043-fc83166ea9db // indirect
82
+ k8s.io/api v0.0.0-20250319213038-88064fe45fc1 // indirect
83
83
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect
84
84
sigs.k8s.io/randfill v1.0.0 // indirect
85
85
sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect
Original file line number Diff line number Diff line change @@ -204,12 +204,12 @@ gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
204
204
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c /go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM =
205
205
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA =
206
206
gopkg.in/yaml.v3 v3.0.1 /go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM =
207
- k8s.io/api v0.0.0-20250319173043-fc83166ea9db h1:x+vYK/B3vjbtoBztfSz0rXHiGAMmVgEeqO1HtBGkxuo =
208
- k8s.io/api v0.0.0-20250319173043-fc83166ea9db /go.mod h1:JO0tyTI0qSXXaGVhLdqwfi3RMbS2g9hcYvzBmZP5wVk =
207
+ k8s.io/api v0.0.0-20250319213038-88064fe45fc1 h1:UxRrzYpgtXbqwLrgCZnuKutzQM+z75Ag8Xqd0en/IK8 =
208
+ k8s.io/api v0.0.0-20250319213038-88064fe45fc1 /go.mod h1:JO0tyTI0qSXXaGVhLdqwfi3RMbS2g9hcYvzBmZP5wVk =
209
209
k8s.io/apimachinery v0.0.0-20250319092800-e8a77bd768fd h1:KoXgjwEokLM8o95kMxowg5vp5iQ4v46Kk+zobsqeTgU =
210
210
k8s.io/apimachinery v0.0.0-20250319092800-e8a77bd768fd /go.mod h1:D2UW665TVSpInyOuG6C+PMtC1MZheP0KQz65UPQEiI4 =
211
- k8s.io/client-go v0.0.0-20250319053412-169f1af1bf07 h1:UmlJkL72Xyrfs30rqXWtVUcjV15AeOggxctLIiKuNsE =
212
- k8s.io/client-go v0.0.0-20250319053412-169f1af1bf07 /go.mod h1:a4HxhGqHxxHlQQTrtis+Srk1+UsPuKeUlZtQAYq34bU =
211
+ k8s.io/client-go v0.0.0-20250319213421-a9cdb028d1bd h1:BTLapLdnvFX1TwXUz0d0zoVLYgRAanc4lEL0/T7T7Qo =
212
+ k8s.io/client-go v0.0.0-20250319213421-a9cdb028d1bd /go.mod h1:B0JbWCH7ziSx2Lcm10dp7pqHkuFquezdASDn6HXD2dI =
213
213
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk =
214
214
k8s.io/klog/v2 v2.130.1 /go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE =
215
215
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff h1:/usPimJzUKKu+m+TE36gUyGcf03XZEP0ZIKgKj35LS4 =
Original file line number Diff line number Diff line change @@ -20,7 +20,9 @@ import (
20
20
"fmt"
21
21
"io"
22
22
23
+ "github.com/prometheus/client_golang/prometheus"
23
24
"github.com/prometheus/client_golang/prometheus/testutil"
25
+ dto "github.com/prometheus/client_model/go"
24
26
25
27
apimachineryversion "k8s.io/apimachinery/pkg/version"
26
28
"k8s.io/component-base/metrics"
@@ -33,6 +35,14 @@ type TB interface {
33
35
Fatalf (format string , args ... any )
34
36
}
35
37
38
+ // MetricFamily is a type alias which enables writing gatherers in tests
39
+ // without importing prometheus directly (https://github.com/kubernetes/kubernetes/issues/99876).
40
+ type MetricFamily = dto.MetricFamily
41
+
42
+ // GathererFunc is a type alias which enables writing gatherers as a function in tests
43
+ // without importing prometheus directly (https://github.com/kubernetes/kubernetes/issues/99876).
44
+ type GathererFunc = prometheus.GathererFunc
45
+
36
46
// CollectAndCompare registers the provided Collector with a newly created
37
47
// pedantic Registry. It then does the same as GatherAndCompare, gathering the
38
48
// metrics from the pedantic Registry.
You can’t perform that action at this time.
0 commit comments