Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/spec-configuration/containerCollectionsOCI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ export async function getManifest(params: CommonParams, url: string, ref: OCIRef
}

if (expectedDigest && contentDigest !== expectedDigest) {
throw new Error(`Digest did not match for ${url}.`);
throw new Error(`Digest did not match for ${ref.resource}.`);
}

return {
Expand Down Expand Up @@ -519,7 +519,7 @@ export async function getBlob(params: CommonParams, url: string, ociCacheDir: st

const actualDigest = `sha256:${crypto.createHash('sha256').update(resBody).digest('hex')}`;
if (actualDigest !== expectedDigest) {
throw new Error(`Digest did not match for ${url}.`);
throw new Error(`Digest did not match for ${ociRef.resource}.`);
}

await mkdirpLocal(destCachePath);
Expand Down
6 changes: 3 additions & 3 deletions src/spec-configuration/containerFeaturesOCI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ export async function fetchOCIFeature(params: CommonParams, featureSet: FeatureS

const { featureRef } = featureSet.sourceInformation;

const expectedDigest = featureSet.sourceInformation.manifest?.layers[0].digest;
const blobUrl = `https://${featureSet.sourceInformation.featureRef.registry}/v2/${featureSet.sourceInformation.featureRef.path}/blobs/${expectedDigest}`;
const layerDigest = featureSet.sourceInformation.manifest?.layers[0].digest;
const blobUrl = `https://${featureSet.sourceInformation.featureRef.registry}/v2/${featureSet.sourceInformation.featureRef.path}/blobs/${layerDigest}`;
output.write(`blob url: ${blobUrl}`, LogLevel.Trace);

const blobResult = await getBlob(params, blobUrl, ociCacheDir, featCachePath, featureRef, expectedDigest);
const blobResult = await getBlob(params, blobUrl, ociCacheDir, featCachePath, featureRef, layerDigest);

if (!blobResult) {
throw new Error(`Failed to download package for ${featureSet.sourceInformation.featureRef.resource}`);
Expand Down