Skip to content

fix: fix oom_score adjustments failing if caps set #15758

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Dec 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
no prompt for sudo
  • Loading branch information
sreya committed Dec 5, 2024
commit c08ae1f60f0a25e2cef3761a50735e6738608581
2 changes: 1 addition & 1 deletion agent/agentexec/cli_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func execArgs(oom int, nice int) []string {
func setCaps(t *testing.T, bin string, caps ...string) error {
t.Helper()

setcap := fmt.Sprintf("sudo setcap %s=ep %s", strings.Join(caps, ", "), bin)
setcap := fmt.Sprintf("sudo -n setcap %s=ep %s", strings.Join(caps, ", "), bin)
out, err := exec.CommandContext(context.Background(), "sh", "-c", setcap).CombinedOutput()
if err != nil {
return xerrors.Errorf("setcap %q (%s): %w", setcap, out, err)
Expand Down
Loading