fix deprecation of NewSimpleClientset by using NewClientset or ignoring

This commit is contained in:
Ryan Richard
2025-12-19 12:00:56 -08:00
parent 10444fb9a3
commit 9d1c65c3e6
48 changed files with 180 additions and 118 deletions

View File

@@ -3858,14 +3858,17 @@ func TestGetKubeconfig(t *testing.T) {
if tt.getClientsetErr != nil {
return nil, nil, nil, tt.getClientsetErr
}
//nolint:staticcheck // as of v0.35.0, this package does not offer a NewClientset() function
fakeAggregatorClient := aggregatorfake.NewSimpleClientset(tt.apiServiceObjects...)
fakeKubeClient := fake.NewClientset()
if tt.kubeObjects != nil {
kubeObjects := tt.kubeObjects(string(testServerCA))
fakeKubeClient = fake.NewClientset(kubeObjects...)
}
//nolint:staticcheck // our codegen does not yet generate a NewClientset() function
fakeConciergeClient := conciergefake.NewSimpleClientset()
if tt.conciergeObjects != nil {
//nolint:staticcheck // our codegen does not yet generate a NewClientset() function
fakeConciergeClient = conciergefake.NewSimpleClientset(tt.conciergeObjects(string(testServerCA), testServer.URL)...)
}
if len(tt.conciergeReactions) > 0 {

View File

@@ -293,6 +293,7 @@ func TestWhoami(t *testing.T) {
if test.gettingClientsetErr != nil {
return nil, nil, nil, test.gettingClientsetErr
}
//nolint:staticcheck // our codegen does not yet generate a NewClientset() function
conciergeClient := conciergefake.NewSimpleClientset()
conciergeClient.PrependReactor("create", "whoamirequests", func(_ kubetesting.Action) (bool, runtime.Object, error) {
if test.callingAPIErr != nil {