MCPcopy Index your code
hub / github.com/devcontainers/cli / hasLabels

Function hasLabels

src/spec-node/utils.ts:246–253  ·  view source on GitHub ↗
(params: DockerResolverParameters, info: any, expectedLabels: Record<string, string>)

Source from the content-addressed store, hash-verified

244}
245
246async function hasLabels(params: DockerResolverParameters, info: any, expectedLabels: Record<string, string>) {
247 const actualLabels = info.Actor?.Attributes
248 // Docker uses 'id', Podman 'ID'.
249 || (await inspectContainer(params, info.id || info.ID)).Config.Labels
250 || {};
251 return Object.keys(expectedLabels)
252 .every(name => actualLabels[name] === expectedLabels[name]);
253}
254
255export async function checkDockerSupportForGPU(params: DockerResolverParameters): Promise<Boolean> {
256 if (params.gpuAvailability === 'all') {

Callers 1

startEventSeenFunction · 0.85

Calls 1

inspectContainerFunction · 0.90

Tested by

no test coverage detected