File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -101,13 +101,19 @@ void copy(
101101 Manifest manifest = source .getManifest (sourceRef );
102102 String tag = sourceRef .getTag ();
103103
104- // Write config as any blob
105104 Objects .requireNonNull (manifest .getDigest (), "Manifest digest is required for streaming copy" );
106- try (InputStream is = source .pullConfig (sourceRef , manifest .getConfig ())) {
107- LOG .debug ("Copying config blob {}" , manifest .getConfig ().getDigest ());
108- target .pushBlob (targetRef .withDigest (manifest .getConfig ().getDigest ()), is );
109- LOG .debug ("Copied config blob {}" , manifest .getConfig ().getDigest ());
110- }
105+
106+ // Write config as any blob
107+ Config config = manifest .getConfig ();
108+ Objects .requireNonNull (config .getDigest (), "Config digest is required for streaming copy" );
109+ Objects .requireNonNull (config .getSize (), "Config size is required for streaming copy" );
110+ target .pushBlob (
111+ targetRef
112+ .forTarget (effectiveTargetRegistry )
113+ .withDigest (manifest .getConfig ().getDigest ()),
114+ config .getSize (),
115+ () -> source .pullConfig (sourceRef .forTarget (resolveSourceRegistry ), manifest .getConfig ()),
116+ config .getAnnotations ());
111117
112118 // Push the manifest
113119 LOG .debug ("Copying manifest {}" , manifestDigest );
You can’t perform that action at this time.
0 commit comments