Closed MathiasPius closed 7 months ago
Thanks for the quick reviews! I've implemented the changes as requested, please review the updated PR, and let me know if there's anything else :)
@MathiasPius can you please fix the small formatting issue that causes the windows test to fail?
Aside from that, the PR LGTM
Implements
Client::pull_manifest_raw
for fetching the plain text representation of a manifest without deserializing it into anOciManifest
.This way the manifest can be pushed elsewhere while maintaining the digest value of the manifest which is otherwise subject to change following re-serialization of the
OciManifest
object.Asymmetry with
push_raw_manifest
push_manifest_raw
takes aVec<u8>
, whilepull_manifest_raw
returns the content as aString
. I've chosen this route, since it allows us to still callvalidate_registry_response
inClient::_pull_manifest_raw
where the response status and manifest text is available for validation.Providing
accepted_media_types
when pulling raw manifestsSince
pull_manifest_raw
is specifically intended for fetching individual manifests for mirroring, I expect the caller to be traversing the tree of manifests manually and pushing/storing them elsewhere, and in that case they will have a very good idea of what kind of manifest they're likely to get back at each individual step.Deduplicating code
I've re-implemented
Client::_pull_manifest
in terms ofClient::_pull_manifest_raw
to reduce code duplication, so it now uses the raw function to get the text manifest, and then performs deserialization from there.Closes #114