mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-12-03 23:03:53 +00:00
Remove direct reference to prometheus from apiserver/pkg/storage/value.
This commit is contained in:
@@ -24,8 +24,8 @@ import (
|
|||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
|
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"k8s.io/component-base/metrics/legacyregistry"
|
||||||
"github.com/prometheus/client_golang/prometheus/testutil"
|
"k8s.io/component-base/metrics/testutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestTotals(t *testing.T) {
|
func TestTotals(t *testing.T) {
|
||||||
@@ -122,7 +122,7 @@ apiserver_storage_transformation_operations_total{status="Internal",transformati
|
|||||||
tt.prefix.TransformFromStorage([]byte("k8s:enc:kms:v1:value"), nil)
|
tt.prefix.TransformFromStorage([]byte("k8s:enc:kms:v1:value"), nil)
|
||||||
defer transformerOperationsTotal.Reset()
|
defer transformerOperationsTotal.Reset()
|
||||||
defer deprecatedTransformerFailuresTotal.Reset()
|
defer deprecatedTransformerFailuresTotal.Reset()
|
||||||
if err := testutil.GatherAndCompare(prometheus.DefaultGatherer, strings.NewReader(tt.want), tt.metrics...); err != nil {
|
if err := testutil.GatherAndCompare(legacyregistry.DefaultGatherer, strings.NewReader(tt.want), tt.metrics...); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"k8s.io/component-base/metrics/legacyregistry"
|
||||||
"github.com/prometheus/client_golang/prometheus/testutil"
|
"k8s.io/component-base/metrics/testutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
type testTransformer struct {
|
type testTransformer struct {
|
||||||
@@ -185,7 +185,7 @@ func TestPrefixFromMetrics(t *testing.T) {
|
|||||||
t.Run(tc.desc, func(t *testing.T) {
|
t.Run(tc.desc, func(t *testing.T) {
|
||||||
tc.prefix.TransformFromStorage(tc.input, nil)
|
tc.prefix.TransformFromStorage(tc.input, nil)
|
||||||
defer transformerOperationsTotal.Reset()
|
defer transformerOperationsTotal.Reset()
|
||||||
if err := testutil.GatherAndCompare(prometheus.DefaultGatherer, strings.NewReader(tc.want), tc.metrics...); err != nil {
|
if err := testutil.GatherAndCompare(legacyregistry.DefaultGatherer, strings.NewReader(tc.want), tc.metrics...); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -243,7 +243,7 @@ func TestPrefixToMetrics(t *testing.T) {
|
|||||||
t.Run(tc.desc, func(t *testing.T) {
|
t.Run(tc.desc, func(t *testing.T) {
|
||||||
tc.prefix.TransformToStorage(tc.input, nil)
|
tc.prefix.TransformToStorage(tc.input, nil)
|
||||||
defer transformerOperationsTotal.Reset()
|
defer transformerOperationsTotal.Reset()
|
||||||
if err := testutil.GatherAndCompare(prometheus.DefaultGatherer, strings.NewReader(tc.want), tc.metrics...); err != nil {
|
if err := testutil.GatherAndCompare(legacyregistry.DefaultGatherer, strings.NewReader(tc.want), tc.metrics...); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user