File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ require (
2828 go.uber.org/zap v1.27.0
2929 golang.org/x/sys v0.30.0
3030 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
3232 k8s.io/klog/v2 v2.130.1
3333 k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738
3434 sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3
@@ -79,7 +79,7 @@ require (
7979 gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
8080 gopkg.in/inf.v0 v0.9.1 // indirect
8181 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
8383 k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect
8484 sigs.k8s.io/randfill v1.0.0 // indirect
8585 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=
204204gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c /go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM =
205205gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA =
206206gopkg.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 =
209209k8s.io/apimachinery v0.0.0-20250319092800-e8a77bd768fd h1:KoXgjwEokLM8o95kMxowg5vp5iQ4v46Kk+zobsqeTgU =
210210k8s.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 =
213213k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk =
214214k8s.io/klog/v2 v2.130.1 /go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE =
215215k8s.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 (
2020 "fmt"
2121 "io"
2222
23+ "github.com/prometheus/client_golang/prometheus"
2324 "github.com/prometheus/client_golang/prometheus/testutil"
25+ dto "github.com/prometheus/client_model/go"
2426
2527 apimachineryversion "k8s.io/apimachinery/pkg/version"
2628 "k8s.io/component-base/metrics"
@@ -33,6 +35,14 @@ type TB interface {
3335 Fatalf (format string , args ... any )
3436}
3537
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+
3646// CollectAndCompare registers the provided Collector with a newly created
3747// pedantic Registry. It then does the same as GatherAndCompare, gathering the
3848// metrics from the pedantic Registry.
You can’t perform that action at this time.
0 commit comments