@@ -2188,14 +2188,14 @@ func TestAgent_DevcontainerRecreate(t *testing.T) {
2188
2188
2189
2189
t .Logf ("Looking for container with label: devcontainer.local_folder=%s" , workspaceFolder )
2190
2190
2191
- var container docker. APIContainers
2191
+ var container codersdk. WorkspaceAgentContainer
2192
2192
testutil .Eventually (ctx , t , func (context.Context ) bool {
2193
- containers , err := pool . Client . ListContainers (docker. ListContainersOptions { All : true } )
2193
+ resp , err := conn . ListContainers (ctx )
2194
2194
if err != nil {
2195
2195
t .Logf ("Error listing containers: %v" , err )
2196
2196
return false
2197
2197
}
2198
- for _ , c := range containers {
2198
+ for _ , c := range resp . Containers {
2199
2199
t .Logf ("Found container: %s with labels: %v" , c .ID [:12 ], c .Labels )
2200
2200
if v , ok := c .Labels ["devcontainer.local_folder" ]; ok && v == workspaceFolder {
2201
2201
t .Logf ("Found matching container: %s" , c .ID [:12 ])
@@ -2205,7 +2205,7 @@ func TestAgent_DevcontainerRecreate(t *testing.T) {
2205
2205
}
2206
2206
return false
2207
2207
}, testutil .IntervalMedium , "no container with workspace folder label found" )
2208
- defer func (container docker. APIContainers ) {
2208
+ defer func (container codersdk. WorkspaceAgentContainer ) {
2209
2209
// We can't rely on pool here because the container is not
2210
2210
// managed by it (it is managed by @devcontainer/cli).
2211
2211
err := pool .Client .RemoveContainer (docker.RemoveContainerOptions {
@@ -2225,7 +2225,7 @@ func TestAgent_DevcontainerRecreate(t *testing.T) {
2225
2225
// Invoke recreate to trigger the destruction and recreation of the
2226
2226
// devcontainer, we do it in a goroutine so we can process logs
2227
2227
// concurrently.
2228
- go func (container docker. APIContainers ) {
2228
+ go func (container codersdk. WorkspaceAgentContainer ) {
2229
2229
err := conn .RecreateDevcontainer (ctx , container .ID )
2230
2230
assert .NoError (t , err , "recreate devcontainer should succeed" )
2231
2231
}(container )
@@ -2253,12 +2253,12 @@ waitForOutcomeLoop:
2253
2253
2254
2254
// Make sure the container exists and isn't the same as the old one.
2255
2255
testutil .Eventually (ctx , t , func (context.Context ) bool {
2256
- containers , err := pool . Client . ListContainers (docker. ListContainersOptions { All : true } )
2256
+ resp , err := conn . ListContainers (ctx )
2257
2257
if err != nil {
2258
2258
t .Logf ("Error listing containers: %v" , err )
2259
2259
return false
2260
2260
}
2261
- for _ , c := range containers {
2261
+ for _ , c := range resp . Containers {
2262
2262
t .Logf ("Found container: %s with labels: %v" , c .ID [:12 ], c .Labels )
2263
2263
if v , ok := c .Labels ["devcontainer.local_folder" ]; ok && v == workspaceFolder {
2264
2264
if c .ID == container .ID {
@@ -2272,7 +2272,7 @@ waitForOutcomeLoop:
2272
2272
}
2273
2273
return false
2274
2274
}, testutil .IntervalMedium , "new devcontainer not found" )
2275
- defer func (container docker. APIContainers ) {
2275
+ defer func (container codersdk. WorkspaceAgentContainer ) {
2276
2276
// We can't rely on pool here because the container is not
2277
2277
// managed by it (it is managed by @devcontainer/cli).
2278
2278
err := pool .Client .RemoveContainer (docker.RemoveContainerOptions {
0 commit comments