@@ -11,7 +11,7 @@ import { requestEnsureAuthenticated } from './httpOCIRegistry';
1111// Devcontainer Spec (features) : https://containers.dev/implementors/features-distribution/#oci-registry
1212// Devcontainer Spec (templates): https://github.com/devcontainers/spec/blob/main/proposals/devcontainer-templates-distribution.md#oci-registry
1313// OCI Spec : https://github.com/opencontainers/distribution-spec/blob/main/spec.md#push
14- export async function pushOCIFeatureOrTemplate ( params : CommonParams , ociRef : OCIRef , pathToTgz : string , tags : string [ ] , collectionType : string , featureAnnotations = { } ) : Promise < string | undefined > {
14+ export async function pushOCIFeatureOrTemplate ( params : CommonParams , ociRef : OCIRef , pathToTgz : string , tags : string [ ] , collectionType : string , annotations : { [ key : string ] : string } = { } ) : Promise < string | undefined > {
1515 const { output } = params ;
1616
1717 output . write ( `-- Starting push of ${ collectionType } '${ ociRef . id } ' to '${ ociRef . resource } ' with tags '${ tags . join ( ', ' ) } '` ) ;
@@ -25,7 +25,7 @@ export async function pushOCIFeatureOrTemplate(params: CommonParams, ociRef: OCI
2525 const dataBytes = fs . readFileSync ( pathToTgz ) ;
2626
2727 // Generate Manifest for given feature/template artifact.
28- const manifest = await generateCompleteManifestForIndividualFeatureOrTemplate ( output , dataBytes , pathToTgz , ociRef , collectionType , featureAnnotations ) ;
28+ const manifest = await generateCompleteManifestForIndividualFeatureOrTemplate ( output , dataBytes , pathToTgz , ociRef , collectionType , annotations ) ;
2929 if ( ! manifest ) {
3030 output . write ( `Failed to generate manifest for ${ ociRef . id } ` , LogLevel . Error ) ;
3131 return ;
@@ -268,14 +268,13 @@ async function putBlob(params: CommonParams, blobPutLocationUriPath: string, oci
268268// Generate a layer that follows the `application/vnd.devcontainers.layer.v1+tar` mediaType as defined in
269269// Devcontainer Spec (features) : https://containers.dev/implementors/features-distribution/#oci-registry
270270// Devcontainer Spec (templates): https://github.com/devcontainers/spec/blob/main/proposals/devcontainer-templates-distribution.md#oci-registry
271- async function generateCompleteManifestForIndividualFeatureOrTemplate ( output : Log , dataBytes : Buffer , pathToTgz : string , ociRef : OCIRef , collectionType : string , featureAnnotations = { } ) : Promise < ManifestContainer | undefined > {
271+ async function generateCompleteManifestForIndividualFeatureOrTemplate ( output : Log , dataBytes : Buffer , pathToTgz : string , ociRef : OCIRef , collectionType : string , annotations : { [ key : string ] : string } = { } ) : Promise < ManifestContainer | undefined > {
272272 const tgzLayer = await calculateDataLayer ( output , dataBytes , path . basename ( pathToTgz ) , DEVCONTAINER_TAR_LAYER_MEDIATYPE ) ;
273273 if ( ! tgzLayer ) {
274274 output . write ( `Failed to calculate tgz layer.` , LogLevel . Error ) ;
275275 return undefined ;
276276 }
277277
278- let annotations : { [ key : string ] : string } = featureAnnotations ;
279278 // Specific registries look for certain optional metadata
280279 // in the manifest, in this case for UI presentation.
281280 if ( ociRef . registry === 'ghcr.io' ) {
0 commit comments