feat: Allow workspace resources to attach multiple agents (#942)

This enables a "kubernetes_pod" to attach multiple agents that
could be for multiple services. Each agent is required to have
a unique name, so SSH syntax is:

`coder ssh <workspace>.<agent>`

A resource can have zero agents too, they aren't required.
This commit is contained in:
Kyle Carberry
2022-04-11 16:06:15 -05:00
committed by GitHub
parent 2835bb45e5
commit 19b4323512
47 changed files with 1550 additions and 1040 deletions
+5 -5
View File
@@ -91,10 +91,10 @@ func TestWorkspaceBuildResources(t *testing.T) {
Resources: []*proto.Resource{{
Name: "some",
Type: "example",
Agent: &proto.Agent{
Agents: []*proto.Agent{{
Id: "something",
Auth: &proto.Agent_Token{},
},
}},
}, {
Name: "another",
Type: "example",
@@ -113,7 +113,7 @@ func TestWorkspaceBuildResources(t *testing.T) {
require.Len(t, resources, 2)
require.Equal(t, "some", resources[0].Name)
require.Equal(t, "example", resources[0].Type)
require.NotNil(t, resources[0].Agent)
require.Len(t, resources[0].Agents, 1)
})
}
@@ -138,10 +138,10 @@ func TestWorkspaceBuildLogs(t *testing.T) {
Resources: []*proto.Resource{{
Name: "some",
Type: "example",
Agent: &proto.Agent{
Agents: []*proto.Agent{{
Id: "something",
Auth: &proto.Agent_Token{},
},
}},
}, {
Name: "another",
Type: "example",