(params: DockerResolverParameters, config: SubstitutedConfig<DevContainerConfig>, baseName: string, imageBuildInfo: ImageBuildInfo, composeServiceUser: string | undefined, additionalFeatures: Record<string, string | boolean | Record<string, string | boolean>>, canAddLabelsToContainer: boolean)
| 139 | } |
| 140 | |
| 141 | export async function getExtendImageBuildInfo(params: DockerResolverParameters, config: SubstitutedConfig<DevContainerConfig>, baseName: string, imageBuildInfo: ImageBuildInfo, composeServiceUser: string | undefined, additionalFeatures: Record<string, string | boolean | Record<string, string | boolean>>, canAddLabelsToContainer: boolean): Promise<{ featureBuildInfo?: ImageBuildOptions; featuresConfig?: FeaturesConfig; labels?: Record<string, string> } | undefined> { |
| 142 | |
| 143 | // Creates the folder where the working files will be setup. |
| 144 | const dstFolder = await createFeaturesTempFolder(params.common); |
| 145 | |
| 146 | // Processes the user's configuration. |
| 147 | const platform = params.common.cliHost.platform; |
| 148 | |
| 149 | const cacheFolder = await getCacheFolder(params.common.cliHost); |
| 150 | const { noLockfile, frozenLockfile } = params; |
| 151 | const featuresConfig = await generateFeaturesConfig({ ...params.common, platform, cacheFolder, noLockfile, frozenLockfile }, dstFolder, config.config, additionalFeatures); |
| 152 | if (!featuresConfig) { |
| 153 | if (canAddLabelsToContainer && !imageBuildInfo.dockerfile) { |
| 154 | return { |
| 155 | labels: { |
| 156 | [imageMetadataLabel]: JSON.stringify(getDevcontainerMetadata(imageBuildInfo.metadata, config, undefined, [], getOmitDevcontainerPropertyOverride(params.common)).raw), |
| 157 | } |
| 158 | }; |
| 159 | } |
| 160 | return { featureBuildInfo: await getImageBuildOptions(params, config, dstFolder, baseName, imageBuildInfo) }; |
| 161 | } |
| 162 | |
| 163 | // Generates the end configuration. |
| 164 | const featureBuildInfo = await getFeaturesBuildOptions(params, config, featuresConfig, baseName, imageBuildInfo, composeServiceUser); |
| 165 | if (!featureBuildInfo) { |
| 166 | return undefined; |
| 167 | } |
| 168 | return { featureBuildInfo, featuresConfig }; |
| 169 | |
| 170 | } |
| 171 | |
| 172 | // NOTE: only exported to enable testing. Not meant to be called outside file. |
| 173 | export function generateContainerEnvsV1(featuresConfig: FeaturesConfig) { |
no test coverage detected