feat(agent/agentcontainers): refactor Lister to ContainerCLI and implement new methods (#18243)

This commit is contained in:
Mathias Fredriksson
2025-06-06 13:33:09 +03:00
committed by GitHub
parent 533c6dcbbe
commit a12429e9f8
11 changed files with 367 additions and 95 deletions
+2 -2
View File
@@ -2057,7 +2057,7 @@ func TestSSH_Container(t *testing.T) {
ctx := testutil.Context(t, testutil.WaitLong)
client, workspace, agentToken := setupWorkspaceForAgent(t)
ctrl := gomock.NewController(t)
mLister := acmock.NewMockLister(ctrl)
mLister := acmock.NewMockContainerCLI(ctrl)
mLister.EXPECT().List(gomock.Any()).Return(codersdk.WorkspaceAgentListContainersResponse{
Containers: []codersdk.WorkspaceAgentContainer{
{
@@ -2069,7 +2069,7 @@ func TestSSH_Container(t *testing.T) {
}, nil).AnyTimes()
_ = agenttest.New(t, client.URL, agentToken, func(o *agent.Options) {
o.ExperimentalDevcontainersEnabled = true
o.ContainerAPIOptions = append(o.ContainerAPIOptions, agentcontainers.WithLister(mLister))
o.ContainerAPIOptions = append(o.ContainerAPIOptions, agentcontainers.WithContainerCLI(mLister))
})
_ = coderdtest.NewWorkspaceAgentWaiter(t, client, workspace.ID).Wait()