@@ -46,7 +46,6 @@ import (
46
46
e2epodoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"
47
47
e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper"
48
48
e2essh "k8s.io/kubernetes/test/e2e/framework/ssh"
49
- storageutils "k8s.io/kubernetes/test/e2e/storage/utils"
50
49
imageutils "k8s.io/kubernetes/test/utils/image"
51
50
netutils "k8s.io/utils/net"
52
51
)
@@ -350,41 +349,7 @@ func (config *NetworkingTestConfig) DialFromContainer(ctx context.Context, proto
350
349
}
351
350
if responses .Difference (expectedResponses ).Len () > 0 {
352
351
returnMsg := fmt .Errorf ("received unexpected responses... \n Attempt %d\n Command %v\n retrieved %v\n expected %v" , i , cmd , responses , expectedResponses )
353
- // TODO(aojea) Remove once issues.k8s.io/123760 is solved
354
- // Dump the nodes network routes and addresses for troubleshooting #123760
355
352
framework .Logf ("encountered error during dial (%v)" , returnMsg )
356
- hostExec := storageutils .NewHostExec (config .f )
357
- ginkgo .DeferCleanup (hostExec .Cleanup )
358
- cmd := `echo "IP routes: " && ip route && echo "IP addresses:" && ip addr && echo "Open sockets: " && ss -anp --socket=tcp`
359
- for _ , node := range config .Nodes {
360
- result , err := hostExec .IssueCommandWithResult (ctx , cmd , & node )
361
- if err != nil {
362
- framework .Logf ("error occurred while executing command %s on node: %v" , cmd , err )
363
- continue
364
- }
365
- framework .Logf ("Dump network information for node %s:\n %s" , node .Name , result )
366
- }
367
- // Dump the node iptables rules and conntrack flows for troubleshooting #123760
368
- podList , _ := config .f .ClientSet .CoreV1 ().Pods ("kube-system" ).List (ctx , metav1.ListOptions {
369
- LabelSelector : "k8s-app=kube-proxy" ,
370
- })
371
- for _ , pod := range podList .Items {
372
- // dump only for the node running test-container-pod
373
- if pod .Status .HostIP == config .TestContainerPod .Status .HostIP {
374
- output , _ , _ := e2epod .ExecWithOptions (config .f , e2epod.ExecOptions {
375
- Namespace : "kube-system" ,
376
- PodName : pod .Name ,
377
- ContainerName : "kube-proxy" ,
378
- Command : []string {"sh" , "-c" , fmt .Sprintf (`echo "IPTables Dump: " && iptables-save | grep "%s/%s:http" && echo "Conntrack flows: " && conntrack -Ln -p tcp | grep %d` , config .Namespace , config .NodePortService .Name , EndpointHTTPPort )},
379
- Stdin : nil ,
380
- CaptureStdout : true ,
381
- CaptureStderr : true ,
382
- PreserveWhitespace : false ,
383
- })
384
- framework .Logf ("Dump iptables and connntrack flows\n %s" , output )
385
- break
386
- }
387
- }
388
353
return returnMsg
389
354
}
390
355
0 commit comments