Skip to content

Commit b44835b

Browse files
committed
update comments to clarify sudo usage in CI environment for system commands
1 parent 211d50d commit b44835b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/utils_sys.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func RelocateSystemGrep(harness *test_case_harness.TestCaseHarness) {
2929
moveCmd.Stdout = io.Discard
3030
moveCmd.Stderr = io.Discard
3131
if err := moveCmd.Run(); err != nil {
32-
// Try again with sudo if the first attempt fails
32+
// On CI we don't run as a root user so need to use sudo
3333
sudoCommand := fmt.Sprintf("sudo %s", command)
3434
sudoMoveCmd := exec.Command("sh", "-c", sudoCommand)
3535
sudoMoveCmd.Stdout = io.Discard
@@ -51,7 +51,7 @@ func restoreSystemGrep(newPath string, originalPath string) error {
5151
moveCmd.Stdout = io.Discard
5252
moveCmd.Stderr = io.Discard
5353
if err := moveCmd.Run(); err != nil {
54-
// Try again with sudo if the first attempt fails
54+
// On CI we don't run as a root user so need to use sudo
5555
sudoCommand := fmt.Sprintf("sudo %s", command)
5656
sudoMoveCmd := exec.Command("sh", "-c", sudoCommand)
5757
sudoMoveCmd.Stdout = io.Discard

0 commit comments

Comments
 (0)