update dependencies (#6267)
Signed-off-by: hongming <coder.scala@gmail.com>
This commit is contained in:
2
vendor/k8s.io/component-base/metrics/testutil/metrics.go
generated
vendored
2
vendor/k8s.io/component-base/metrics/testutil/metrics.go
generated
vendored
@@ -70,7 +70,7 @@ func NewMetrics() Metrics {
|
||||
|
||||
// ParseMetrics parses Metrics from data returned from prometheus endpoint
|
||||
func ParseMetrics(data string, output *Metrics) error {
|
||||
dec := expfmt.NewDecoder(strings.NewReader(data), expfmt.FmtText)
|
||||
dec := expfmt.NewDecoder(strings.NewReader(data), expfmt.NewFormat(expfmt.TypeTextPlain))
|
||||
decoder := expfmt.SampleDecoder{
|
||||
Dec: dec,
|
||||
Opts: &expfmt.DecodeOptions{},
|
||||
|
||||
6
vendor/k8s.io/component-base/metrics/testutil/promlint.go
generated
vendored
6
vendor/k8s.io/component-base/metrics/testutil/promlint.go
generated
vendored
@@ -30,13 +30,13 @@ import (
|
||||
// We setup this list for allow and not fail on the current violations.
|
||||
// Generally speaking, you need to fix the problem for a new metric rather than add it into the list.
|
||||
var exceptionMetrics = []string{
|
||||
// k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/egressselector
|
||||
// k8s.io/apiserver/pkg/server/egressselector
|
||||
"apiserver_egress_dialer_dial_failure_count", // counter metrics should have "_total" suffix
|
||||
|
||||
// k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/server/healthz
|
||||
// k8s.io/apiserver/pkg/server/healthz
|
||||
"apiserver_request_total", // label names should be written in 'snake_case' not 'camelCase'
|
||||
|
||||
// k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/endpoints/filters
|
||||
// k8s.io/apiserver/pkg/endpoints/filters
|
||||
"authenticated_user_requests", // counter metrics should have "_total" suffix
|
||||
"authentication_attempts", // counter metrics should have "_total" suffix
|
||||
|
||||
|
||||
11
vendor/k8s.io/component-base/metrics/testutil/testutil.go
generated
vendored
11
vendor/k8s.io/component-base/metrics/testutil/testutil.go
generated
vendored
@@ -19,7 +19,6 @@ package testutil
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"testing"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus/testutil"
|
||||
|
||||
@@ -28,6 +27,12 @@ import (
|
||||
"k8s.io/component-base/metrics/legacyregistry"
|
||||
)
|
||||
|
||||
type TB interface {
|
||||
Logf(format string, args ...any)
|
||||
Errorf(format string, args ...any)
|
||||
Fatalf(format string, args ...any)
|
||||
}
|
||||
|
||||
// CollectAndCompare registers the provided Collector with a newly created
|
||||
// pedantic Registry. It then does the same as GatherAndCompare, gathering the
|
||||
// metrics from the pedantic Registry.
|
||||
@@ -94,7 +99,7 @@ func NewFakeKubeRegistry(ver string) metrics.KubeRegistry {
|
||||
return metrics.NewKubeRegistry()
|
||||
}
|
||||
|
||||
func AssertVectorCount(t *testing.T, name string, labelFilter map[string]string, wantCount int) {
|
||||
func AssertVectorCount(t TB, name string, labelFilter map[string]string, wantCount int) {
|
||||
metrics, err := legacyregistry.DefaultGatherer.Gather()
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to gather metrics: %s", err)
|
||||
@@ -124,7 +129,7 @@ func AssertVectorCount(t *testing.T, name string, labelFilter map[string]string,
|
||||
}
|
||||
}
|
||||
|
||||
func AssertHistogramTotalCount(t *testing.T, name string, labelFilter map[string]string, wantCount int) {
|
||||
func AssertHistogramTotalCount(t TB, name string, labelFilter map[string]string, wantCount int) {
|
||||
metrics, err := legacyregistry.DefaultGatherer.Gather()
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to gather metrics: %s", err)
|
||||
|
||||
Reference in New Issue
Block a user