feat: integrate new agentexec pkg (#15609)

- Integrates the `agentexec` pkg into the agent and removes the
legacy system of iterating over the process tree. It adds some linting
rules to hopefully catch future improper uses of `exec.Command` in the package.
This commit is contained in:
Jon Ayers
2024-11-27 20:12:15 +02:00
committed by GitHub
parent 45d9274aca
commit 1f238fed59
22 changed files with 147 additions and 1176 deletions
+8
View File
@@ -1,12 +1,20 @@
package main
import (
"fmt"
"os"
_ "time/tzdata"
"github.com/coder/coder/v2/agent/agentexec"
"github.com/coder/coder/v2/cli"
)
func main() {
if len(os.Args) > 1 && os.Args[1] == "agent-exec" {
err := agentexec.CLI()
_, _ = fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
var rootCmd cli.RootCmd
rootCmd.RunWithSubcommands(rootCmd.AGPL())
}