@@ -398,30 +398,6 @@ private static async Task WriteManifestForDockerImage(
398
398
}
399
399
}
400
400
401
- public static async Task WriteMultiArchOciImageToStreamAsync (
402
- BuiltImage [ ] images ,
403
- SourceImageReference sourceReference ,
404
- DestinationImageReference destinationReference ,
405
- Stream imageStream ,
406
- CancellationToken cancellationToken )
407
- {
408
- cancellationToken . ThrowIfCancellationRequested ( ) ;
409
-
410
- using TarWriter writer = new ( imageStream , TarEntryFormat . Pax , leaveOpen : true ) ;
411
-
412
- foreach ( var image in images )
413
- {
414
- await WriteOciImageToBlobs ( writer , image , sourceReference , cancellationToken )
415
- . ConfigureAwait ( false ) ;
416
- }
417
-
418
- await WriteIndexJsonForMultiArchOciImage ( writer , images , destinationReference , cancellationToken )
419
- . ConfigureAwait ( false ) ;
420
-
421
- await WriteOciLayout ( writer , cancellationToken )
422
- . ConfigureAwait ( false ) ;
423
- }
424
-
425
401
private static async Task WriteOciImageToStreamAsync (
426
402
BuiltImage image ,
427
403
SourceImageReference sourceReference ,
@@ -443,22 +419,6 @@ await WriteOciLayout(writer, cancellationToken)
443
419
. ConfigureAwait ( false ) ;
444
420
}
445
421
446
- private static async Task WriteOciImageToBlobs (
447
- TarWriter writer ,
448
- BuiltImage image ,
449
- SourceImageReference sourceReference ,
450
- CancellationToken cancellationToken )
451
- {
452
- await WriteImageLayers ( writer , image , sourceReference , d => $ "{ _blobsPath } /{ d . Substring ( "sha256:" . Length ) } ", cancellationToken )
453
- . ConfigureAwait ( false ) ;
454
-
455
- await WriteImageConfig ( writer , image , $ "{ _blobsPath } /{ image . ImageSha } ", cancellationToken )
456
- . ConfigureAwait ( false ) ;
457
-
458
- await WriteManifestForOciImage ( writer , image , cancellationToken )
459
- . ConfigureAwait ( false ) ;
460
- }
461
-
462
422
private static async Task WriteOciLayout ( TarWriter writer , CancellationToken cancellationToken )
463
423
{
464
424
cancellationToken . ThrowIfCancellationRequested ( ) ;
@@ -493,6 +453,46 @@ private static async Task WriteManifestForOciImage(
493
453
}
494
454
}
495
455
456
+ private static async Task WriteOciImageToBlobs (
457
+ TarWriter writer ,
458
+ BuiltImage image ,
459
+ SourceImageReference sourceReference ,
460
+ CancellationToken cancellationToken )
461
+ {
462
+ await WriteImageLayers ( writer , image , sourceReference , d => $ "{ _blobsPath } /{ d . Substring ( "sha256:" . Length ) } ", cancellationToken )
463
+ . ConfigureAwait ( false ) ;
464
+
465
+ await WriteImageConfig ( writer , image , $ "{ _blobsPath } /{ image . ImageSha } ", cancellationToken )
466
+ . ConfigureAwait ( false ) ;
467
+
468
+ await WriteManifestForOciImage ( writer , image , cancellationToken )
469
+ . ConfigureAwait ( false ) ;
470
+ }
471
+
472
+ public static async Task WriteMultiArchOciImageToStreamAsync (
473
+ BuiltImage [ ] images ,
474
+ SourceImageReference sourceReference ,
475
+ DestinationImageReference destinationReference ,
476
+ Stream imageStream ,
477
+ CancellationToken cancellationToken )
478
+ {
479
+ cancellationToken . ThrowIfCancellationRequested ( ) ;
480
+
481
+ using TarWriter writer = new ( imageStream , TarEntryFormat . Pax , leaveOpen : true ) ;
482
+
483
+ foreach ( var image in images )
484
+ {
485
+ await WriteOciImageToBlobs ( writer , image , sourceReference , cancellationToken )
486
+ . ConfigureAwait ( false ) ;
487
+ }
488
+
489
+ await WriteIndexJsonForMultiArchOciImage ( writer , images , destinationReference , cancellationToken )
490
+ . ConfigureAwait ( false ) ;
491
+
492
+ await WriteOciLayout ( writer , cancellationToken )
493
+ . ConfigureAwait ( false ) ;
494
+ }
495
+
496
496
private static async Task WriteIndexJsonForMultiArchOciImage (
497
497
TarWriter writer ,
498
498
BuiltImage [ ] images ,
0 commit comments