Change:
<!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks! If the matter is security related, please disclose it privately via --What happened: I tried to use  in a unit test, however I get a nil pointer panic when is invoked. What you expected to happen: would return a that doesn't panic on any method call. Ideally, it would allow me to interact with the client in someway for testing. How to reproduce it (as minimally and precisely as possible): Anything else we need to know?: client-go version: Environment: Kubernetes version (use ): Cloud provider or hardware configuration: OS (e.g: ): Kernel (e.g. ): Install tools: Network plugin and version (if this is a network-related bug): Others:
/sig testing
I believe this also impacts returning logs via a reactor as does not implement
Seems to be a problem with . Since we're creating the request with all empty fields. Not sure what the best way it to resolve this. The best thing I came up with is to use to return a request with everything set up. But I'm a noob here so that's just a shot in the dark :man_shrugging:
Issues go stale after 90d of inactivity. Mark the issue as fresh with . Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with . Send feedback to sig-testing, kubernetes/test-infra and/or . /lifecycle stale
/remove-lifecycle stale
Issues go stale after 90d of inactivity. Mark the issue as fresh with . Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with . Send feedback to sig-testing, kubernetes/test-infra and/or . /lifecycle stale
The request returned has a nil which is used in the
I have filed a PR trying to fix this issue.

Discussion:
load( "@io_bazel_rules_go//go:def.bzl", "go_library", <ins> "go_test", </ins> ) go_library(

"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/types:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library", <ins> "//staging/src/k8s.io/client-go/kubernetes/scheme:go_default_library", </ins> "//staging/src/k8s.io/client-go/kubernetes/typed/core/v1:go_default_library", "//staging/src/k8s.io/client-go/rest:go_default_library", <ins> "//staging/src/k8s.io/client-go/rest/fake:go_default_library", </ins> "//staging/src/k8s.io/client-go/testing:go_default_library", ], )

srcs = [":package-srcs"], tags = ["automanaged"], ) <ins> go_test( name = "go_default_test", srcs = ["fake_pod_expansion_test.go"], embed = [":go_default_library"], deps = [ "//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/client-go/testing:go_default_library", ], ) </ins>

import ( "context" <ins> "fmt" "io/ioutil" "net/http" "strings" </ins> <del> "k8s.io/api/core/v1" </del> <ins> v1 "k8s.io/api/core/v1" </ins> policy "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" <ins> "k8s.io/client-go/kubernetes/scheme" </ins> restclient "k8s.io/client-go/rest" <ins> fakerest "k8s.io/client-go/rest/fake" </ins> core "k8s.io/client-go/testing" )

action.Value = opts _, _ = c.Fake.Invokes(action, &v1.Pod{}) <del> return &restclient.Request{} </del> <ins> fakeClient := &fakerest.RESTClient{ Client: fakerest.CreateHTTPClient(func(request *http.Request) (*http.Response, error) { resp := &http.Response{ StatusCode: http.StatusOK, Body:       ioutil.NopCloser(strings.NewReader("fake logs")), } return resp, nil }), NegotiatedSerializer: scheme.Codecs.WithoutConversion(), GroupVersion:         podsKind.GroupVersion(), VersionedAPIPath:     fmt.Sprintf("/api/v1/namespaces/%s/pods/%s/log", c.ns, name), } return fakeClient.Request() </ins> } func (c *FakePods) Evict(ctx context.Context, eviction *policy.Eviction) error {

<ins> /* Copyright 2020 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package fake import ( "bytes" "context" "io" "testing" corev1 "k8s.io/api/core/v1" cgtesting "k8s.io/client-go/testing" ) func TestFakePodsGetLogs(t *testing.T) { fp := FakePods{ Fake: &FakeCoreV1{Fake: &cgtesting.Fake{}}, ns:   "default", } req := fp.GetLogs("foo", &corev1.PodLogOptions{}) body, err := req.Stream(context.Background()) if err != nil { t.Fatal("Stream pod logs:", err) } var buf bytes.Buffer n, err := io.Copy(&buf, body) if err != nil { t.Fatal("Read pod logs:", err) } if n == 0 { t.Fatal("Empty log") } err = body.Close() if err != nil { t.Fatal("Close response body:", err) } } </ins>