Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita5ec3c4

Browse files
feat: add agent env flag to enable/disable project discovery
1 parent225fe38 commita5ec3c4

File tree

3 files changed

+28
-17
lines changed

3 files changed

+28
-17
lines changed

‎agent/agent.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@ func (a *agent) init() {
339339
containerAPIOpts:= []agentcontainers.Option{
340340
agentcontainers.WithExecer(a.execer),
341341
agentcontainers.WithCommandEnv(a.sshServer.CommandEnv),
342-
agentcontainers.WithProjectDiscovery(true),
343342
agentcontainers.WithScriptLogger(func(logSourceID uuid.UUID) agentcontainers.ScriptLogger {
344343
returna.logSender.GetScriptLogger(logSourceID)
345344
}),

‎cli/agent.go‎

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,23 @@ import (
4040

4141
func (r*RootCmd)workspaceAgent()*serpent.Command {
4242
var (
43-
authstring
44-
logDirstring
45-
scriptDataDirstring
46-
pprofAddressstring
47-
noReapbool
48-
sshMaxTimeout time.Duration
49-
tailnetListenPortint64
50-
prometheusAddressstring
51-
debugAddressstring
52-
slogHumanPathstring
53-
slogJSONPathstring
54-
slogStackdriverPathstring
55-
blockFileTransferbool
56-
agentHeaderCommandstring
57-
agentHeader []string
58-
devcontainersbool
43+
authstring
44+
logDirstring
45+
scriptDataDirstring
46+
pprofAddressstring
47+
noReapbool
48+
sshMaxTimeout time.Duration
49+
tailnetListenPortint64
50+
prometheusAddressstring
51+
debugAddressstring
52+
slogHumanPathstring
53+
slogJSONPathstring
54+
slogStackdriverPathstring
55+
blockFileTransferbool
56+
agentHeaderCommandstring
57+
agentHeader []string
58+
devcontainersbool
59+
devcontainerProjectDiscoverybool
5960
)
6061
cmd:=&serpent.Command{
6162
Use:"agent",
@@ -364,6 +365,7 @@ func (r *RootCmd) workspaceAgent() *serpent.Command {
364365
Devcontainers:devcontainers,
365366
DevcontainerAPIOptions: []agentcontainers.Option{
366367
agentcontainers.WithSubAgentURL(r.agentURL.String()),
368+
agentcontainers.WithProjectDiscovery(devcontainerProjectDiscovery),
367369
},
368370
})
369371

@@ -510,6 +512,13 @@ func (r *RootCmd) workspaceAgent() *serpent.Command {
510512
Description:"Allow the agent to automatically detect running devcontainers.",
511513
Value:serpent.BoolOf(&devcontainers),
512514
},
515+
{
516+
Flag:"devcontainers-project-discovery-enable",
517+
Default:"true",
518+
Env:"CODER_AGENT_DEVCONTAINERS_PROJECT_DISCOVERY_ENABLE",
519+
Description:"Allow the agent to search the filesystem for devcontainer projects.",
520+
Value:serpent.BoolOf(&devcontainerProjectDiscovery),
521+
},
513522
}
514523

515524
returncmd

‎cli/testdata/coder_agent_--help.golden‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ OPTIONS:
3636
--devcontainers-enable bool, $CODER_AGENT_DEVCONTAINERS_ENABLE (default: true)
3737
Allow the agent to automatically detect running devcontainers.
3838

39+
--devcontainers-project-discovery-enable bool, $CODER_AGENT_DEVCONTAINERS_PROJECT_DISCOVERY_ENABLE (default: true)
40+
Allow the agent to search the filesystem for devcontainer projects.
41+
3942
--log-dir string, $CODER_AGENT_LOG_DIR (default: /tmp)
4043
Specify the location for the agent log files.
4144

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp