(params: DockerResolverParameters, labels: string[])
| 286 | } |
| 287 | |
| 288 | export async function findExistingContainer(params: DockerResolverParameters, labels: string[]) { |
| 289 | const { common } = params; |
| 290 | let container = await findDevContainer(params, labels); |
| 291 | if (params.expectExistingContainer && !container) { |
| 292 | throw new ContainerError({ description: 'The expected container does not exist.' }); |
| 293 | } |
| 294 | if (container && (params.removeOnStartup === true || params.removeOnStartup === container.Id)) { |
| 295 | const text = 'Removing Existing Container'; |
| 296 | const start = common.output.start(text); |
| 297 | await removeContainer(params, container.Id); |
| 298 | common.output.stop(text, start); |
| 299 | container = undefined; |
| 300 | } |
| 301 | return container; |
| 302 | } |
| 303 | |
| 304 | async function startExistingContainer(params: DockerResolverParameters, labels: string[], container: ContainerDetails) { |
| 305 | const { common } = params; |
no test coverage detected