chore(agent/agentcontainers): skip TestDockerCLIContainerLister by default (#16502)

Addresses a test flake seen here:
https://github.com/coder/coder/actions/runs/13239819615/job/36952521742

Also addresses the case where we would try to run `docker inspect` with
no container IDs, which is a silly thing to do.
This commit is contained in:
Cian Johnston
2025-02-10 12:12:32 +00:00
committed by GitHub
parent 31b1ff7d3b
commit 140f2a9013
2 changed files with 12 additions and 9 deletions

View File

@ -59,6 +59,11 @@ func (dcl *DockerCLILister) List(ctx context.Context) (codersdk.WorkspaceAgentLi
}
dockerPsStderr := strings.TrimSpace(stderrBuf.String())
if len(ids) == 0 {
return codersdk.WorkspaceAgentListContainersResponse{
Warnings: []string{dockerPsStderr},
}, nil
}
// now we can get the detailed information for each container
// Run `docker inspect` on each container ID