@@ -76,6 +76,7 @@ void copy(
7676 for (Layer layer : source .collectLayers (sourceRef , contentType , true )) {
7777 Objects .requireNonNull (layer .getDigest (), "Layer digest is required for streaming copy" );
7878 Objects .requireNonNull (layer .getSize (), "Layer size is required for streaming copy" );
79+ LOG .debug ("Copying layer {}" , layer .getDigest ());
7980 target .pushBlob (
8081 targetRef .withDigest (layer .getDigest ()),
8182 layer .getSize (),
@@ -92,12 +93,17 @@ void copy(
9293 String tag = sourceRef .getTag ();
9394
9495 // Write config as any blob
96+ Objects .requireNonNull (manifest .getDigest (), "Manifest digest is required for streaming copy" );
9597 try (InputStream is = source .pullConfig (sourceRef , manifest .getConfig ())) {
98+ LOG .debug ("Copying config blob {}" , manifest .getConfig ().getDigest ());
9699 target .pushBlob (targetRef .withDigest (manifest .getConfig ().getDigest ()), is );
100+ LOG .debug ("Copied config blob {}" , manifest .getConfig ().getDigest ());
97101 }
98102
99103 // Push the manifest
104+ LOG .debug ("Copying manifest {}" , manifestDigest );
100105 target .pushManifest (targetRef .withDigest (tag ), manifest );
106+ LOG .debug ("Copied manifest {}" , manifestDigest );
101107
102108 if (recursive ) {
103109 LOG .debug ("Recursively copy referrers" );
@@ -114,23 +120,28 @@ else if (source.isIndexMediaType(contentType)) {
114120
115121 Index index = source .getIndex (sourceRef );
116122 String tag = sourceRef .getTag ();
117- target .pushIndex (targetRef .withDigest (tag ), index );
118123
119124 // Write all manifests and their config
120125 for (ManifestDescriptor manifestDescriptor : index .getManifests ()) {
121126 Manifest manifest = source .getManifest (sourceRef .withDigest (manifestDescriptor .getDigest ()));
122127
123128 // Write config as any blob
124129 try (InputStream is = source .pullConfig (sourceRef , manifest .getConfig ())) {
130+ LOG .debug ("Copying config blob {}" , manifest .getConfig ().getDigest ());
125131 target .pushBlob (
126132 targetRef .withDigest (manifest .getConfig ().getDigest ()), is );
133+ LOG .debug ("Copied config blob {}" , manifest .getConfig ().getDigest ());
127134 }
128135
129136 // Push the manifest
130137 target .pushManifest (
131138 targetRef .withDigest (manifest .getDigest ()), manifest .withDescriptor (manifestDescriptor ));
132139 }
133140
141+ LOG .debug ("Copying index {}" , manifestDigest );
142+ target .pushIndex (targetRef .withDigest (tag ), index );
143+ LOG .debug ("Copied index {}" , manifestDigest );
144+
134145 } else {
135146 throw new OrasException ("Unsupported content type: %s" .formatted (contentType ));
136147 }
0 commit comments