Store resolve registry when probing descriptor and use it for copy operation by jonesbusy · Pull Request #557 · oras-project/oras-java

Expand Up @@ -70,7 +70,7 @@ private Index( @JsonProperty(Const.JSON_PROPERTY_MANIFESTS) List<ManifestDescriptor> manifests, @JsonProperty(Const.JSON_PROPERTY_ANNOTATIONS) Map<String, String> annotations, @JsonProperty(Const.JSON_PROPERTY_SUBJECT) Subject subject) { this(schemaVersion, mediaType, artifactType, manifests, annotations, subject, null, null); this(schemaVersion, mediaType, artifactType, manifests, annotations, subject, null, null, null); }
private Index( Expand All @@ -81,8 +81,9 @@ private Index( Map<String, String> annotations, Subject subject, ManifestDescriptor descriptor, String registry, String json) { super(null, null, mediaType, annotations, artifactType, json); super(null, null, mediaType, annotations, artifactType, registry, json); this.schemaVersion = schemaVersion; this.descriptor = descriptor; this.subject = subject; Expand Down Expand Up @@ -183,7 +184,8 @@ public Index withNewManifests(ManifestDescriptor manifest) { newManifests.add(ManifestDescriptor.fromJson(descriptor.toJson())); } newManifests.add(manifest); return new Index(schemaVersion, mediaType, artifactType, newManifests, annotations, subject, descriptor, json); return new Index( schemaVersion, mediaType, artifactType, newManifests, annotations, subject, descriptor, registry, json); }
@Override Expand All @@ -209,7 +211,8 @@ public ManifestDescriptor getDescriptor() { * @return The manifest */ public Index withDescriptor(ManifestDescriptor descriptor) { return new Index(schemaVersion, mediaType, artifactType, manifests, annotations, subject, descriptor, json); return new Index( schemaVersion, mediaType, artifactType, manifests, annotations, subject, descriptor, registry, json); }
/** Expand All @@ -233,7 +236,8 @@ public Subject getSubject() { * @return The index */ public Index withSubject(Subject subject) { return new Index(schemaVersion, mediaType, artifactType, manifests, annotations, subject, descriptor, json); return new Index( schemaVersion, mediaType, artifactType, manifests, annotations, subject, descriptor, registry, json); }
/** Expand All @@ -260,7 +264,7 @@ public static Index fromPath(Path path) { * @return The index */ public static Index fromManifests(List<ManifestDescriptor> descriptors) { return new Index(2, Const.DEFAULT_INDEX_MEDIA_TYPE, null, descriptors, null, null, null, null); return new Index(2, Const.DEFAULT_INDEX_MEDIA_TYPE, null, descriptors, null, null, null, null, null); }
@Override Expand Down