Skip to content

feat: add agent exec pkg #15577

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 17 commits into from
Nov 25, 2024
Prev Previous commit
Next Next commit
add comment for the use of flags
  • Loading branch information
sreya committed Nov 20, 2024
commit 7235bfb54e555b77498728fc1a03aec0d3d79b93
11 changes: 7 additions & 4 deletions agent/agentexec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,18 @@ func envValInt(key string) (int, bool) {
return i, true
}

// The following are flags used by the agent-exec command. We use flags instead of
// environment variables to avoid having to deal with a caller overriding the
// environment variables.
const (
niceArg = "coder-nice"
oomArg = "coder-oom"
niceFlag = "coder-nice"
oomFlag = "coder-oom"
)

func niceScoreArg(score int) string {
return fmt.Sprintf("--%s=%d", niceArg, score)
return fmt.Sprintf("--%s=%d", niceFlag, score)
}

func oomScoreArg(score int) string {
return fmt.Sprintf("--%s=%d", oomArg, score)
return fmt.Sprintf("--%s=%d", oomFlag, score)
}
Loading