-
Notifications
You must be signed in to change notification settings - Fork 936
fix(agent): disable dev container integration inside sub agents #18781
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
Changes from all commits
801585a
12f3dc7
36c276f
15b38be
bb48815
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2441,7 +2441,8 @@ func TestAgent_DevcontainersDisabledForSubAgent(t *testing.T) { | |
|
||
// Setup the agent with devcontainers enabled initially. | ||
//nolint:dogsled | ||
conn, _, _, _, _ := setupAgent(t, manifest, 0, func(*agenttest.Client, *agent.Options) { | ||
conn, _, _, _, _ := setupAgent(t, manifest, 0, func(_ *agenttest.Client, o *agent.Options) { | ||
o.Devcontainers = true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It appears the test allowed the regression to occur as it had Dev Containers disabled by default. This means it didn't properly test the flow we'd expect. |
||
}) | ||
|
||
// Query the containers API endpoint. This should fail because | ||
|
@@ -2453,8 +2454,8 @@ func TestAgent_DevcontainersDisabledForSubAgent(t *testing.T) { | |
require.Error(t, err) | ||
|
||
// Verify the error message contains the expected text. | ||
require.Contains(t, err.Error(), "The agent dev containers feature is experimental and not enabled by default.") | ||
require.Contains(t, err.Error(), "To enable this feature, set CODER_AGENT_DEVCONTAINERS_ENABLE=true in your template.") | ||
require.Contains(t, err.Error(), "Dev Container feature not supported.") | ||
require.Contains(t, err.Error(), "Dev Container integration inside other Dev Containers is explicitly not supported.") | ||
Comment on lines
+2457
to
+2458
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reminder to run |
||
} | ||
|
||
func TestAgent_Dial(t *testing.T) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're going to create the API by default. This is fine as we only
Init
and thenStart
at a later stage. This allows us to assumecontainerAPI
will always be anon-nil
value.