Replace deprecated `NewSimpleClientset`

Signed-off-by: George Jenkins <gvjenkins@gmail.com>
pull/31677/head
George Jenkins 9 months ago
parent f05c21b6b6
commit a15db7f087

@ -923,7 +923,7 @@ func TestGetPodList(t *testing.T) {
responsePodList.Items = append(responsePodList.Items, newPodWithStatus(name, v1.PodStatus{}, namespace)) responsePodList.Items = append(responsePodList.Items, newPodWithStatus(name, v1.PodStatus{}, namespace))
} }
kubeClient := k8sfake.NewSimpleClientset(&responsePodList) kubeClient := k8sfake.NewClientset(&responsePodList)
c := Client{Namespace: namespace, kubeClient: kubeClient} c := Client{Namespace: namespace, kubeClient: kubeClient}
podList, err := c.GetPodList(namespace, metav1.ListOptions{}) podList, err := c.GetPodList(namespace, metav1.ListOptions{})
@ -936,7 +936,7 @@ func TestOutputContainerLogsForPodList(t *testing.T) {
namespace := "some-namespace" namespace := "some-namespace"
somePodList := newPodList("jimmy", "three", "structs") somePodList := newPodList("jimmy", "three", "structs")
kubeClient := k8sfake.NewSimpleClientset(&somePodList) kubeClient := k8sfake.NewClientset(&somePodList)
c := Client{Namespace: namespace, kubeClient: kubeClient} c := Client{Namespace: namespace, kubeClient: kubeClient}
outBuffer := &bytes.Buffer{} outBuffer := &bytes.Buffer{}
outBufferFunc := func(_, _, _ string) io.Writer { return outBuffer } outBufferFunc := func(_, _, _ string) io.Writer { return outBuffer }
@ -1314,7 +1314,7 @@ func TestIsReachable(t *testing.T) {
setupClient: func(t *testing.T) *Client { setupClient: func(t *testing.T) *Client {
t.Helper() t.Helper()
client := newTestClient(t) client := newTestClient(t)
client.kubeClient = k8sfake.NewSimpleClientset() client.kubeClient = k8sfake.NewClientset()
return client return client
}, },
expectError: false, expectError: false,

Loading…
Cancel
Save