Skip to content

Commit

Permalink
Merge pull request #814 from zeeke/us/fix-tty
Browse files Browse the repository at this point in the history
e2e: Don't allocate TTY when executing commands
  • Loading branch information
SchSeba authored Dec 11, 2024
2 parents 07a7f05 + 7f8eff4 commit 87c93e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/conformance/tests/test_sriov_operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ var _ = Describe("[sriov] operator", func() {
waitForNetAttachDef(sriovNetworkName, namespaces.Test)

testPod := createTestPod(node, []string{sriovNetworkName})
stdout, _, err := pod.ExecCommand(clients, testPod, "more", "/proc/sys/net/ipv4/conf/net1/accept_redirects")
stdout, _, err := pod.ExecCommand(clients, testPod, "cat", "/proc/sys/net/ipv4/conf/net1/accept_redirects")
Expect(err).ToNot(HaveOccurred())

Expect(strings.TrimSpace(stdout)).To(Equal("1"))
Expand Down
4 changes: 1 addition & 3 deletions test/util/pod/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,16 @@ func ExecCommand(cs *testclient.ClientSet, pod *corev1.Pod, command ...string) (
Command: command,
Stdout: true,
Stderr: true,
TTY: true,
}, scheme.ParameterCodec)

exec, err := remotecommand.NewSPDYExecutor(cs.Config, "POST", req.URL())
if err != nil {
return buf.String(), errbuf.String(), err
}

err = exec.Stream(remotecommand.StreamOptions{
err = exec.StreamWithContext(context.Background(), remotecommand.StreamOptions{
Stdout: &buf,
Stderr: &errbuf,
Tty: true,
})
if err != nil {
return buf.String(), errbuf.String(), err
Expand Down

0 comments on commit 87c93e9

Please sign in to comment.