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

Function getCollectionRef

src/spec-configuration/containerCollectionsOCI.ts:251–275  ·  view source on GitHub ↗
(output: Log, registry: string, namespace: string)

Source from the content-addressed store, hash-verified

249}
250
251export function getCollectionRef(output: Log, registry: string, namespace: string): OCICollectionRef | undefined {
252 // Normalize input by downcasing entire string
253 registry = registry.toLowerCase();
254 namespace = namespace.toLowerCase();
255
256 const path = namespace;
257 const resource = `${registry}/${path}`;
258
259 output.write(`> Inputs: registry='${registry}' namespace='${namespace}'`, LogLevel.Trace);
260 output.write(`>`, LogLevel.Trace);
261 output.write(`> resource: ${resource}`, LogLevel.Trace);
262
263 if (!regexForPath.exec(path)) {
264 output.write(`Parsed path '${path}' from input failed validation.`, LogLevel.Error);
265 return undefined;
266 }
267
268 return {
269 registry,
270 path,
271 resource,
272 version: 'latest',
273 tag: 'latest',
274 };
275}
276
277// Validate if a manifest exists and is reachable about the declared feature/template.
278// Specification: https://github.com/opencontainers/distribution-spec/blob/v1.0.1/spec.md#pulling-manifests

Callers 3

featuresPublishFunction · 0.90
templatesPublishFunction · 0.90

Calls 2

writeMethod · 0.65
execMethod · 0.65

Tested by

no test coverage detected