-
Notifications
You must be signed in to change notification settings - Fork 979
feat: reinitialize agents when a prebuilt workspace is claimed #17475
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 1 commit
c09c9b9
476fe71
8c8bca6
7ce4eea
52ac64e
362db7c
dcc7379
ff66b3f
efff5d9
cebd5db
2679138
9feebef
b117b5c
a22b414
9bbd2c7
5804201
7e8dcee
725f97b
a9b1567
21ee970
e54d7e7
2799858
1d93003
763fc12
0f879c7
61784c9
604eb27
bf4d2cf
38b4f0d
20df538
4bb3b68
83972db
146b158
5eb16cd
730d803
150adc0
b4ecf10
3fa3edf
7e45919
a632508
72125ec
b65eea7
e1339f3
c1a8ba6
5363dcc
7ad9b6d
394571d
890747b
b3870db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -689,10 +689,13 @@ func createWorkspace( | |
api.Logger.Error(ctx, "failed to retrieve running agents of claimed prebuilt workspace", | ||
slog.F("workspace_id", claimedWorkspace.ID), slog.Error(err)) | ||
} | ||
agentTokensByAgentID = make(map[uuid.UUID]string, len(agents)) | ||
for _, agent := range agents { | ||
agentTokensByAgentID[agent.ID] = agent.AuthToken.String() | ||
if len(agents) > 1 { | ||
return xerrors.Errorf("multiple agents are not yet supported in prebuilt workspaces") | ||
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 feels wrong to error here. While we don't support multiple agents, we shouldn't fail the call to Can you please add a test for this scenario to validate this behaviour? We could hard-fail this, though, on the template import side when an admin tries to use prebuilds with multiple agents (in a follow-up PR). |
||
} | ||
// agentTokensByAgentID = make(map[uuid.UUID]string, len(agents)) | ||
// for _, agent := range agents { | ||
// agentTokensByAgentID[agent.ID] = agent.AuthToken.String() | ||
// } | ||
SasSwart marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
// We have to refetch the workspace for the joined in fields. | ||
|
Uh oh!
There was an error while loading. Please reload this page.