Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug: Publish command should exit for "Failed to PUT manifest for tag x" error #296

Merged
merged 1 commit into from
Nov 23, 2022
Merged
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
15 changes: 4 additions & 11 deletions src/spec-configuration/containerCollectionsOCIPush.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ export async function pushOCIFeatureOrTemplate(output: Log, ociRef: OCIRef, path
const existingManifest = await fetchOCIManifestIfExists(output, env, ociRef, manifest.digest, registryAuthToken);
if (manifest.digest && existingManifest) {
output.write(`Not reuploading blobs, digest already exists.`, LogLevel.Trace);
await putManifestWithTags(output, manifest.manifestStr, ociRef, tags, registryAuthToken);
return true;
return await putManifestWithTags(output, manifest.manifestStr, ociRef, tags, registryAuthToken);
}

const blobsToPush = [
Expand Down Expand Up @@ -72,10 +71,7 @@ export async function pushOCIFeatureOrTemplate(output: Log, ociRef: OCIRef, path
}

// Send a final PUT to combine blobs and tag manifest properly.
await putManifestWithTags(output, manifest.manifestStr, ociRef, tags, registryAuthToken);

// Success!
return true;
return await putManifestWithTags(output, manifest.manifestStr, ociRef, tags, registryAuthToken);
}

// (!) Entrypoint function to push a collection metadata/overview file for a set of features/templates to a registry.
Expand Down Expand Up @@ -105,8 +101,7 @@ export async function pushCollectionMetadata(output: Log, collectionRef: OCIColl
const existingManifest = await fetchOCIManifestIfExists(output, env, collectionRef, manifest.digest, registryAuthToken);
if (manifest.digest && existingManifest) {
output.write(`Not reuploading blobs, digest already exists.`, LogLevel.Trace);
await putManifestWithTags(output, manifest.manifestStr, collectionRef, ['latest'], registryAuthToken);
return true;
return await putManifestWithTags(output, manifest.manifestStr, collectionRef, ['latest'], registryAuthToken);
}

// Obtain session ID with `/v2/<namespace>/blobs/uploads/`
Expand Down Expand Up @@ -143,9 +138,7 @@ export async function pushCollectionMetadata(output: Log, collectionRef: OCIColl

// Send a final PUT to combine blobs and tag manifest properly.
// Collections are always tagged 'latest'
await putManifestWithTags(output, manifest.manifestStr, collectionRef, ['latest'], registryAuthToken);

return true;
return await putManifestWithTags(output, manifest.manifestStr, collectionRef, ['latest'], registryAuthToken);
}

// --- Helper Functions
Expand Down