feat: Integrate device plugin registration gRPC server health checks.

This commit is contained in:
zhangzhifei16
2024-10-30 13:26:17 +08:00
committed by zhifei92
parent e5a31e8bbc
commit 1381e41f28
13 changed files with 104 additions and 12 deletions

View File

@@ -53,6 +53,7 @@ import (
"k8s.io/utils/ptr"
// Do some initialization to decode the query parameters correctly.
"k8s.io/apiserver/pkg/server/healthz"
utilfeature "k8s.io/apiserver/pkg/util/feature"
featuregatetesting "k8s.io/component-base/featuregate/testing"
"k8s.io/kubelet/pkg/cri/streaming"
@@ -368,6 +369,7 @@ func newServerTestWithDebuggingHandlers(kubeCfg *kubeletconfiginternal.KubeletCo
server := NewServer(
fw.fakeKubelet,
stats.NewResourceAnalyzer(fw.fakeKubelet, time.Minute, &record.FakeRecorder{}),
[]healthz.HealthChecker{},
fw.fakeAuth,
kubeCfg,
)
@@ -1650,8 +1652,8 @@ func TestNewServerRegistersMetricsSLIsEndpointTwice(t *testing.T) {
}
resourceAnalyzer := stats.NewResourceAnalyzer(nil, time.Minute, &record.FakeRecorder{})
server1 := NewServer(host, resourceAnalyzer, nil, nil)
server2 := NewServer(host, resourceAnalyzer, nil, nil)
server1 := NewServer(host, resourceAnalyzer, []healthz.HealthChecker{}, nil, nil)
server2 := NewServer(host, resourceAnalyzer, []healthz.HealthChecker{}, nil, nil)
// Check if both servers registered the /metrics/slis endpoint
assert.Contains(t, server1.restfulCont.RegisteredHandlePaths(), "/metrics/slis", "First server should register /metrics/slis")