refactor
This commit is contained in:
@@ -19,6 +19,7 @@ limitations under the License.
|
||||
package network
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"math"
|
||||
"net/http"
|
||||
@@ -249,7 +250,7 @@ var _ = SIGDescribe("Proxy", func() {
|
||||
}
|
||||
|
||||
if len(errs) != 0 {
|
||||
body, err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).GetLogs(pods[0].Name, &v1.PodLogOptions{}).Do().Raw()
|
||||
body, err := f.ClientSet.CoreV1().Pods(f.Namespace.Name).GetLogs(pods[0].Name, &v1.PodLogOptions{}).Do(context.TODO()).Raw()
|
||||
if err != nil {
|
||||
framework.Logf("Error getting logs for pod %s: %v", pods[0].Name, err)
|
||||
} else {
|
||||
@@ -270,7 +271,7 @@ func doProxy(f *framework.Framework, path string, i int) (body []byte, statusCod
|
||||
// chance of the things we are talking to being confused for an error
|
||||
// that apiserver would have emitted.
|
||||
start := time.Now()
|
||||
body, err = f.ClientSet.CoreV1().RESTClient().Get().AbsPath(path).Do().StatusCode(&statusCode).Raw()
|
||||
body, err = f.ClientSet.CoreV1().RESTClient().Get().AbsPath(path).Do(context.TODO()).StatusCode(&statusCode).Raw()
|
||||
d = time.Since(start)
|
||||
if len(body) > 0 {
|
||||
framework.Logf("(%v) %v: %s (%v; %v)", i, path, truncate(body, maxDisplayBodyLen), statusCode, d)
|
||||
|
Reference in New Issue
Block a user