mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add name to workspace agent devcontainers (#17089)
In the presence of multiple devcontainers, it would be nice to differentiate them by name. This change inherits the resource name from terraform. Refs #17076
This commit is contained in:
@@ -244,6 +244,7 @@ func dbAgentDevcontainersToProto(devcontainers []database.WorkspaceAgentDevconta
|
||||
for i, dc := range devcontainers {
|
||||
ret[i] = &agentproto.WorkspaceAgentDevcontainer{
|
||||
Id: dc.ID[:],
|
||||
Name: dc.Name,
|
||||
WorkspaceFolder: dc.WorkspaceFolder,
|
||||
ConfigPath: dc.ConfigPath,
|
||||
}
|
||||
|
||||
@@ -159,11 +159,13 @@ func TestGetManifest(t *testing.T) {
|
||||
devcontainers = []database.WorkspaceAgentDevcontainer{
|
||||
{
|
||||
ID: uuid.New(),
|
||||
Name: "cool",
|
||||
WorkspaceAgentID: agent.ID,
|
||||
WorkspaceFolder: "/cool/folder",
|
||||
},
|
||||
{
|
||||
ID: uuid.New(),
|
||||
Name: "another",
|
||||
WorkspaceAgentID: agent.ID,
|
||||
WorkspaceFolder: "/another/cool/folder",
|
||||
ConfigPath: "/another/cool/folder/.devcontainer/devcontainer.json",
|
||||
@@ -283,10 +285,12 @@ func TestGetManifest(t *testing.T) {
|
||||
protoDevcontainers = []*agentproto.WorkspaceAgentDevcontainer{
|
||||
{
|
||||
Id: devcontainers[0].ID[:],
|
||||
Name: devcontainers[0].Name,
|
||||
WorkspaceFolder: devcontainers[0].WorkspaceFolder,
|
||||
},
|
||||
{
|
||||
Id: devcontainers[1].ID[:],
|
||||
Name: devcontainers[1].Name,
|
||||
WorkspaceFolder: devcontainers[1].WorkspaceFolder,
|
||||
ConfigPath: devcontainers[1].ConfigPath,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user