(imageMetadata: ImageMetadataEntry[])
| 200 | } |
| 201 | |
| 202 | function mergeForwardPorts(imageMetadata: ImageMetadataEntry[]): (number | string)[] | undefined { |
| 203 | const forwardPorts = [ |
| 204 | ...new Set( |
| 205 | ([] as (number | string)[]).concat(...imageMetadata.map(entry => entry.forwardPorts || [])) |
| 206 | .map(port => typeof port === 'number' ? `localhost:${port}` : port) |
| 207 | ) |
| 208 | ].map(port => /localhost:\d+/.test(port) ? parseInt(port.substring('localhost:'.length)) : port); |
| 209 | return forwardPorts.length ? forwardPorts : undefined; |
| 210 | } |
| 211 | |
| 212 | function mergeHostRequirements(imageMetadata: ImageMetadataEntry[]) { |
| 213 | const cpus = Math.max(...imageMetadata.map(m => m.hostRequirements?.cpus || 0)); |
no outgoing calls
no test coverage detected