mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
kubelet e2e: defer the close to after the error check
fixes a potential crash
This commit is contained in:
parent
975d0736b3
commit
6b18285cd2
@ -168,10 +168,10 @@ var _ = framework.KubeDescribe("Kubelet", func() {
|
||||
|
||||
gomega.Eventually(func() error {
|
||||
rc, err := podClient.GetLogs(podName, &v1.PodLogOptions{}).Stream()
|
||||
defer rc.Close()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer rc.Close()
|
||||
buf := new(bytes.Buffer)
|
||||
buf.ReadFrom(rc)
|
||||
hostsFileContent := buf.String()
|
||||
|
Loading…
Reference in New Issue
Block a user