mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 21:53:52 +00:00
Merge pull request #83678 from RainbowMango/pr_remove_prometheus_reference_from_storage
Remove prometheus reference from storage
This commit is contained in:
@@ -29,7 +29,6 @@ require (
|
||||
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822
|
||||
github.com/pborman/uuid v1.2.0
|
||||
github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021 // indirect
|
||||
github.com/prometheus/client_golang v0.9.4
|
||||
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90
|
||||
github.com/sirupsen/logrus v1.4.2 // indirect
|
||||
github.com/soheilhy/cmux v0.1.3 // indirect
|
||||
|
@@ -14,8 +14,8 @@ go_test(
|
||||
],
|
||||
embed = [":go_default_library"],
|
||||
deps = [
|
||||
"//vendor/github.com/prometheus/client_golang/prometheus:go_default_library",
|
||||
"//vendor/github.com/prometheus/client_golang/prometheus/testutil:go_default_library",
|
||||
"//staging/src/k8s.io/component-base/metrics/legacyregistry:go_default_library",
|
||||
"//staging/src/k8s.io/component-base/metrics/testutil:go_default_library",
|
||||
"//vendor/google.golang.org/grpc/codes:go_default_library",
|
||||
"//vendor/google.golang.org/grpc/status:go_default_library",
|
||||
],
|
||||
|
@@ -24,8 +24,8 @@ import (
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/testutil"
|
||||
"k8s.io/component-base/metrics/legacyregistry"
|
||||
"k8s.io/component-base/metrics/testutil"
|
||||
)
|
||||
|
||||
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)
|
||||
defer transformerOperationsTotal.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)
|
||||
}
|
||||
})
|
||||
|
@@ -22,8 +22,8 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/testutil"
|
||||
"k8s.io/component-base/metrics/legacyregistry"
|
||||
"k8s.io/component-base/metrics/testutil"
|
||||
)
|
||||
|
||||
type testTransformer struct {
|
||||
@@ -185,7 +185,7 @@ func TestPrefixFromMetrics(t *testing.T) {
|
||||
t.Run(tc.desc, func(t *testing.T) {
|
||||
tc.prefix.TransformFromStorage(tc.input, nil)
|
||||
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)
|
||||
}
|
||||
})
|
||||
@@ -243,7 +243,7 @@ func TestPrefixToMetrics(t *testing.T) {
|
||||
t.Run(tc.desc, func(t *testing.T) {
|
||||
tc.prefix.TransformToStorage(tc.input, nil)
|
||||
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)
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user