Skip to content

Commit c03102c

Browse files
authored
[receiver/kubeletstatsreceiver] replace deprecated NewSimpleClientset with NewClientset (#40798)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description replace deprecated NewSimpleClientset with NewClientset in test <!-- Issue number (e.g. #1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes <!--Describe what testing was performed and which tests were added.--> #### Testing <!--Describe the documentation added.--> #### Documentation <!--Please delete paragraphs that you did not use before submitting.--> Signed-off-by: Jared Tan <[email protected]>
1 parent 7513025 commit c03102c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

receiver/kubeletstatsreceiver/scraper_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func TestScraperWithInterfacesMetrics(t *testing.T) {
121121
func TestScraperWithCPUNodeUtilization(t *testing.T) {
122122
watcherStarted := make(chan struct{})
123123
// Create the fake client.
124-
client := fake.NewSimpleClientset()
124+
client := fake.NewClientset()
125125
// A catch-all watch reactor that allows us to inject the watcherStarted channel.
126126
client.PrependWatchReactor("*", func(action clienttesting.Action) (handled bool, ret watch.Interface, err error) {
127127
gvr := action.GetResource()
@@ -201,7 +201,7 @@ func TestScraperWithCPUNodeUtilization(t *testing.T) {
201201
func TestScraperWithMemoryNodeUtilization(t *testing.T) {
202202
watcherStarted := make(chan struct{})
203203
// Create the fake client.
204-
client := fake.NewSimpleClientset()
204+
client := fake.NewClientset()
205205
// A catch-all watch reactor that allows us to inject the watcherStarted channel.
206206
client.PrependWatchReactor("*", func(action clienttesting.Action) (handled bool, ret watch.Interface, err error) {
207207
gvr := action.GetResource()
@@ -631,7 +631,7 @@ func TestScraperWithPVCDetailedLabels(t *testing.T) {
631631
}{
632632
{
633633
name: "successful",
634-
k8sAPIClient: fake.NewSimpleClientset(getValidMockedObjects()...),
634+
k8sAPIClient: fake.NewClientset(getValidMockedObjects()...),
635635
expectedVolumes: map[string]expectedVolume{
636636
"volume_claim_1": {
637637
name: "storage-provisioner-token-qzlx6",
@@ -664,7 +664,7 @@ func TestScraperWithPVCDetailedLabels(t *testing.T) {
664664
},
665665
{
666666
name: "nonexistent_pvc",
667-
k8sAPIClient: fake.NewSimpleClientset(),
667+
k8sAPIClient: fake.NewClientset(),
668668
dataLen: numVolumes - 3,
669669
volumeClaimsToMiss: map[string]bool{
670670
"volume_claim_1": true,
@@ -675,7 +675,7 @@ func TestScraperWithPVCDetailedLabels(t *testing.T) {
675675
},
676676
{
677677
name: "empty_volume_name_in_pvc",
678-
k8sAPIClient: fake.NewSimpleClientset(getMockedObjectsWithEmptyVolumeName()...),
678+
k8sAPIClient: fake.NewClientset(getMockedObjectsWithEmptyVolumeName()...),
679679
expectedVolumes: map[string]expectedVolume{
680680
"volume_claim_1": {
681681
name: "storage-provisioner-token-qzlx6",
@@ -706,7 +706,7 @@ func TestScraperWithPVCDetailedLabels(t *testing.T) {
706706
},
707707
{
708708
name: "non_existent_volume_in_pvc",
709-
k8sAPIClient: fake.NewSimpleClientset(getMockedObjectsWithNonExistentVolumeName()...),
709+
k8sAPIClient: fake.NewClientset(getMockedObjectsWithNonExistentVolumeName()...),
710710
expectedVolumes: map[string]expectedVolume{
711711
"volume_claim_1": {
712712
name: "storage-provisioner-token-qzlx6",

0 commit comments

Comments
 (0)