Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
Signed-off-by: Wenqi Qiu <[email protected]>
  • Loading branch information
wenqiq committed Feb 6, 2024
1 parent 6af2a04 commit fb9ad68
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions test/performance/utils/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ import (
"bytes"
"context"
"fmt"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/klog/v2"
"net/url"
"time"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/remotecommand"

"antrea.io/antrea/test/performance/framework/client_pod"
)

const (
Expand All @@ -38,15 +40,15 @@ const (
func ExecURL(kClient kubernetes.Interface, clientPodNamespace, clientPodName, peerIP string) *url.URL {
return kClient.CoreV1().RESTClient().Post().
Namespace(clientPodNamespace).
Resource("pods").
Name(clientPodName).
Resource("pods").Name(clientPodName).
SubResource("exec").
VersionedParams(&corev1.PodExecOptions{
Command: []string{"/bin/sh", "-c", fmt.Sprintf("nc -vz -w 1 %s 80", peerIP)},
Stdin: false,
Stdout: true,
Stderr: true,
TTY: false,
Command: []string{"/bin/sh", "-c", fmt.Sprintf("nc -vz -w 1 %s 80", peerIP)},
Container: client_pod.ScaleClientContainerName,
Stdin: false,
Stdout: true,
Stderr: true,
TTY: false,
}, scheme.ParameterCodec).URL()
}

Expand Down

0 comments on commit fb9ad68

Please sign in to comment.