Skip to content

Commit 8cea578

Browse files
committed
remedy noctx lint errors
1 parent d1f1beb commit 8cea578

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

test/helper/cmd/cmd.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ package cmd
1616

1717
import (
1818
"bytes"
19+
"context"
1920
"io"
2021
"os/exec"
2122
"testing"
@@ -29,7 +30,7 @@ import (
2930
// If the command fails to run, the given test is being failed immediately.
3031
func RunCommand(t *testing.T, name string, args ...string) io.Reader {
3132
var result bytes.Buffer
32-
cmd := exec.Command(name, args...)
33+
cmd := exec.CommandContext(context.Background(), name, args...)
3334
cmd.Stdout = &result
3435
cmd.Stderr = &result
3536
err := cmd.Run()

test/helper/e2e/cli/cli.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package cli
1616

1717
import (
18+
"context"
1819
"io"
1920
"os/exec"
2021
"strings"
@@ -35,7 +36,7 @@ func ExecuteWithoutWriter(command string, args ...string) *gexec.Session {
3536
}
3637

3738
func ExecuteCommand(reporter io.Writer, command string, args ...string) *gexec.Session {
38-
cmd := exec.Command(command, args...)
39+
cmd := exec.CommandContext(context.Background(), command, args...)
3940
session, _ := gexec.Start(cmd, reporter, reporter)
4041
return session
4142
}

test/helper/e2e2/operator/operator.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package operator
1616

1717
import (
18+
"context"
1819
"fmt"
1920
"io"
2021
"os"
@@ -112,7 +113,7 @@ func NewOperator(env []string, stdout, stderr io.Writer, cmdArgs ...string) Oper
112113
}
113114
cmdLine := append(operatorCommand(), cmdArgs...)
114115
//nolint:gosec
115-
cmd := exec.Command(cmdLine[0], cmdLine[1:]...)
116+
cmd := exec.CommandContext(context.Background(), cmdLine[0], cmdLine[1:]...)
116117

117118
// works around https://github.com/golang/go/issues/40467
118119
// to be able to propagate SIGTERM to the child process.

0 commit comments

Comments
 (0)