try empty descriptor

Signed-off-by: Brian DeHamer <[email protected]>
This commit is contained in:
Brian DeHamer
2025-04-09 17:41:13 -07:00
parent c8edbd7693
commit 6e1e49a5d4
Generated Vendored
+8 -5
View File
@@ -95604,6 +95604,12 @@ const registry_1 = __nccwpck_require__(26198);
const DOCKER_DEFAULT_REGISTRY = 'registry-1.docker.io'; const DOCKER_DEFAULT_REGISTRY = 'registry-1.docker.io';
const EMPTY_BLOB = Buffer.from('{}'); const EMPTY_BLOB = Buffer.from('{}');
const ALT_EMPTY_BLOB = Buffer.from(''); const ALT_EMPTY_BLOB = Buffer.from('');
const EMPTY_DESCRIPTOR = {
mediaType: constants_1.CONTENT_TYPE_EMPTY_DESCRIPTOR,
digest: 'sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a',
size: 2,
data: 'e30=',
};
class OCIImage { class OCIImage {
constructor(image, creds, opts) { constructor(image, creds, opts) {
_OCIImage_instances.add(this); _OCIImage_instances.add(this);
@@ -95627,15 +95633,12 @@ class OCIImage {
// Upload the artifact blob // Upload the artifact blob
const artifactBlob = await __classPrivateFieldGet(this, _OCIImage_client, "f").uploadBlob(opts.artifact); const artifactBlob = await __classPrivateFieldGet(this, _OCIImage_client, "f").uploadBlob(opts.artifact);
// Upload the empty blob (needed for the manifest config) // Upload the empty blob (needed for the manifest config)
const emptyBlob = await __classPrivateFieldGet(this, _OCIImage_client, "f").uploadBlob(ALT_EMPTY_BLOB); // const emptyBlob = await this.#client.uploadBlob(ALT_EMPTY_BLOB);
// Construct artifact manifest // Construct artifact manifest
const manifest = buildManifest({ const manifest = buildManifest({
artifactDescriptor: { ...artifactBlob, mediaType: opts.mediaType }, artifactDescriptor: { ...artifactBlob, mediaType: opts.mediaType },
subjectDescriptor: imageDescriptor, subjectDescriptor: imageDescriptor,
configDescriptor: { configDescriptor: EMPTY_DESCRIPTOR,
...emptyBlob,
mediaType: constants_1.CONTENT_TYPE_EMPTY_DESCRIPTOR,
},
annotations, annotations,
}); });
// Upload artifact manifest // Upload artifact manifest