Skip to content

Commit 75af0ff

Browse files
committed
Remove use of deprecated NewSimpleClientset
Only for upstream dependencies
1 parent f30a107 commit 75af0ff

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

vertical-pod-autoscaler/pkg/admission-controller/certs_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ func TestChangedCAReloader(t *testing.T) {
193193
t.Error(err)
194194
}
195195

196-
testClientSet := fake.NewSimpleClientset()
196+
testClientSet := fake.NewClientset()
197197

198198
selfRegistration(
199199
testClientSet,
@@ -309,7 +309,7 @@ func TestChangedCAReloader(t *testing.T) {
309309
// t.Error(err)
310310
// }
311311

312-
// testClientSet := fake.NewSimpleClientset()
312+
// testClientSet := fake.fake.NewClientset()
313313

314314
// selfRegistration(
315315
// testClientSet,

vertical-pod-autoscaler/pkg/admission-controller/config_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929

3030
func TestSelfRegistrationBase(t *testing.T) {
3131

32-
testClientSet := fake.NewSimpleClientset()
32+
testClientSet := fake.NewClientset()
3333
caCert := []byte("fake")
3434
webHookDelay := 0 * time.Second
3535
namespace := "default"
@@ -73,7 +73,7 @@ func TestSelfRegistrationBase(t *testing.T) {
7373

7474
func TestSelfRegistrationWithURL(t *testing.T) {
7575

76-
testClientSet := fake.NewSimpleClientset()
76+
testClientSet := fake.NewClientset()
7777
caCert := []byte("fake")
7878
webHookDelay := 0 * time.Second
7979
namespace := "default"
@@ -101,7 +101,7 @@ func TestSelfRegistrationWithURL(t *testing.T) {
101101

102102
func TestSelfRegistrationWithOutURL(t *testing.T) {
103103

104-
testClientSet := fake.NewSimpleClientset()
104+
testClientSet := fake.NewClientset()
105105
caCert := []byte("fake")
106106
webHookDelay := 0 * time.Second
107107
namespace := "default"
@@ -131,7 +131,7 @@ func TestSelfRegistrationWithOutURL(t *testing.T) {
131131

132132
func TestSelfRegistrationWithIgnoredNamespaces(t *testing.T) {
133133

134-
testClientSet := fake.NewSimpleClientset()
134+
testClientSet := fake.NewClientset()
135135
caCert := []byte("fake")
136136
webHookDelay := 0 * time.Second
137137
namespace := "default"
@@ -162,7 +162,7 @@ func TestSelfRegistrationWithIgnoredNamespaces(t *testing.T) {
162162

163163
func TestSelfRegistrationWithSelectedNamespaces(t *testing.T) {
164164

165-
testClientSet := fake.NewSimpleClientset()
165+
testClientSet := fake.NewClientset()
166166
caCert := []byte("fake")
167167
webHookDelay := 0 * time.Second
168168
namespace := "default"
@@ -194,7 +194,7 @@ func TestSelfRegistrationWithSelectedNamespaces(t *testing.T) {
194194

195195
func TestSelfRegistrationWithFailurePolicy(t *testing.T) {
196196

197-
testClientSet := fake.NewSimpleClientset()
197+
testClientSet := fake.NewClientset()
198198
caCert := []byte("fake")
199199
webHookDelay := 0 * time.Second
200200
namespace := "default"
@@ -221,7 +221,7 @@ func TestSelfRegistrationWithFailurePolicy(t *testing.T) {
221221

222222
func TestSelfRegistrationWithOutFailurePolicy(t *testing.T) {
223223

224-
testClientSet := fake.NewSimpleClientset()
224+
testClientSet := fake.NewClientset()
225225
caCert := []byte("fake")
226226
webHookDelay := 0 * time.Second
227227
namespace := "default"
@@ -248,7 +248,7 @@ func TestSelfRegistrationWithOutFailurePolicy(t *testing.T) {
248248

249249
func TestSelfRegistrationWithInvalidLabels(t *testing.T) {
250250

251-
testClientSet := fake.NewSimpleClientset()
251+
testClientSet := fake.NewClientset()
252252
caCert := []byte("fake")
253253
webHookDelay := 0 * time.Second
254254
namespace := "default"

vertical-pod-autoscaler/pkg/recommender/input/cluster_feeder_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ func TestFilterVPAsIgnoreNamespaces(t *testing.T) {
858858

859859
func TestCanCleanupCheckpoints(t *testing.T) {
860860
_, tctx := ktesting.NewTestContext(t)
861-
client := fake.NewSimpleClientset()
861+
client := fake.NewClientset()
862862
namespace := "testNamespace"
863863

864864
_, err := client.CoreV1().Namespaces().Create(tctx, &v1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: namespace}}, metav1.CreateOptions{})

vertical-pod-autoscaler/pkg/updater/logic/updater_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ func TestRunOnceIgnoreNamespaceMatching(t *testing.T) {
453453
}
454454

455455
func TestNewEventRecorder(t *testing.T) {
456-
fakeClient := fake.NewSimpleClientset()
456+
fakeClient := fake.NewClientset()
457457
er := newEventRecorder(fakeClient)
458458

459459
maxRetries := 5

vertical-pod-autoscaler/pkg/utils/limitrange/limit_range_calculator_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func TestNewNoopLimitsChecker(t *testing.T) {
3838
}
3939

4040
func TestNoLimitRange(t *testing.T) {
41-
cs := fake.NewSimpleClientset()
41+
cs := fake.NewClientset()
4242
factory := informers.NewSharedInformerFactory(cs, 0)
4343
lc, err := NewLimitsRangeCalculator(factory)
4444

@@ -133,7 +133,7 @@ func TestGetContainerLimitRangeItem(t *testing.T) {
133133

134134
for _, tc := range testCases {
135135
t.Run(tc.name, func(t *testing.T) {
136-
cs := fake.NewSimpleClientset(tc.limitRanges...)
136+
cs := fake.NewClientset(tc.limitRanges...)
137137
factory := informers.NewSharedInformerFactory(cs, 0)
138138
lc, err := NewLimitsRangeCalculator(factory)
139139

vertical-pod-autoscaler/pkg/utils/status/status_object_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func TestUpdateStatus(t *testing.T) {
129129
}
130130
for _, tc := range tests {
131131
t.Run(fmt.Sprintf("test case: %s", tc.name), func(t *testing.T) {
132-
fc := fake.NewSimpleClientset()
132+
fc := fake.NewClientset()
133133
fc.PrependReactor("get", "leases", tc.updateReactor)
134134
fc.PrependReactor("create", "leases", tc.updateReactor)
135135
fc.PrependReactor("update", "leases", tc.updateReactor)
@@ -204,7 +204,7 @@ func TestGetStatus(t *testing.T) {
204204
}
205205
for _, tc := range tests {
206206
t.Run(fmt.Sprintf("test case: %s", tc.name), func(t *testing.T) {
207-
fc := fake.NewSimpleClientset()
207+
fc := fake.NewClientset()
208208
fc.PrependReactor("get", "leases", tc.getReactor)
209209
client := NewClient(fc, leaseName, leaseNamespace, 10*time.Second, leaseName)
210210
_, err := client.getStatus(context.Background())

0 commit comments

Comments
 (0)