(params: DockerResolverParameters | DockerCLIParameters, normalizedWorkspaceFolder: string, normalizedConfigFile: string)
| 665 | } |
| 666 | |
| 667 | async function findDevContainerByNormalizedLabels(params: DockerResolverParameters | DockerCLIParameters, normalizedWorkspaceFolder: string, normalizedConfigFile: string) { |
| 668 | if (process.platform !== 'win32') { |
| 669 | return undefined; |
| 670 | } |
| 671 | |
| 672 | const ids = await listContainers(params, true, [hostFolderLabel]); |
| 673 | if (!ids.length) { |
| 674 | return undefined; |
| 675 | } |
| 676 | |
| 677 | const details = await inspectContainers(params, ids); |
| 678 | return details |
| 679 | .filter(container => container.State.Status !== 'removing') |
| 680 | .find(container => { |
| 681 | const labels = container.Config.Labels || {}; |
| 682 | const containerWorkspaceFolder = labels[hostFolderLabel]; |
| 683 | const normalizedContainerWorkspaceFolder = containerWorkspaceFolder && normalizeDevContainerLabelPath('win32', containerWorkspaceFolder); |
| 684 | if (!normalizedContainerWorkspaceFolder || normalizedContainerWorkspaceFolder !== normalizedWorkspaceFolder) { |
| 685 | return false; |
| 686 | } |
| 687 | |
| 688 | const containerConfigFile = labels[configFileLabel]; |
| 689 | const normalizedContainerConfigFile = containerConfigFile && normalizeDevContainerLabelPath('win32', containerConfigFile); |
| 690 | return !!normalizedContainerConfigFile |
| 691 | && normalizedContainerConfigFile === normalizedConfigFile; |
| 692 | }); |
| 693 | } |
| 694 | |
| 695 | async function findLegacyDevContainerByNormalizedWorkspaceFolder(params: DockerResolverParameters | DockerCLIParameters, normalizedWorkspaceFolder: string) { |
| 696 | if (process.platform !== 'win32') { |
no test coverage detected