(params: DockerCLIParameters | PartialExecParameters | DockerResolverParameters, type: 'container' | 'image' | 'volume', ids: string[])
| 136 | } |
| 137 | |
| 138 | async function inspect<T>(params: DockerCLIParameters | PartialExecParameters | DockerResolverParameters, type: 'container' | 'image' | 'volume', ids: string[]): Promise<T[]> { |
| 139 | if (!ids.length) { |
| 140 | return []; |
| 141 | } |
| 142 | const partial = toExecParameters(params); |
| 143 | const result = await runCommandNoPty({ |
| 144 | ...partial, |
| 145 | args: (partial.args || []).concat(['inspect', '--type', type, ...ids]), |
| 146 | }); |
| 147 | try { |
| 148 | return JSON.parse(result.stdout.toString()); |
| 149 | } catch (err) { |
| 150 | console.error({ |
| 151 | stdout: result.stdout.toString(), |
| 152 | stderr: result.stderr.toString(), |
| 153 | }); |
| 154 | throw err; |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | export async function listContainers(params: DockerCLIParameters | PartialExecParameters | DockerResolverParameters, all = false, labels: string[] = []) { |
| 159 | const filterArgs = []; |
nothing calls this directly
no test coverage detected