Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make blob reuse choices manifest-format-sensitive, and allow conversions when writing to format-agnostic transports #2213

Merged
merged 9 commits into from
Feb 5, 2024

Commits on Feb 2, 2024

  1. Try all manifest formats if the destinations accepts all of them

    We might want to trigger a conversion to OCI if the source is not
    OCI, but the destination already contains a Zstd version of a layer.
    
    We can do that for destinations that express a restricted list of
    manifest formats, so it is unexpected that completely unrestricted
    destinations can't trigger a conversion, and just fail (right now),
    or perhaps don't fail but unnecessarily upload (in the future), in that case.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    c438c69 View commit details
    Browse the repository at this point in the history
  2. Beautify determineManifestConversion a bit

    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    bbaad3d View commit details
    Browse the repository at this point in the history
  3. Reorder TryReusingBlobOptions

    ... to be a bit more similar to PutBlobOptions,
    to be consistent with the constructor, and to start
    with identification before parameters.
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    2879f25 View commit details
    Browse the repository at this point in the history
  4. Make manifestConversionPlan a field of imageCopier

    We will need to access it from copyLayer.
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    ea7437e View commit details
    Browse the repository at this point in the history
  5. Refactor BlobMatchesRequiredCompression a bit

    ... to allow adding more conditions
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    4f86a47 View commit details
    Browse the repository at this point in the history
  6. Rename *BlobMatchesRequiredCompression to *CandidateMatchesTryReusing…

    …BlobOptions
    
    ... because we will add more reasons to reject a match.
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    ffd21be View commit details
    Browse the repository at this point in the history
  7. Always pass OriginalCompression to TryReusingBlobWithOptions

    There's no reason not to, and we will need it in other cases
    as well.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    7a9148a View commit details
    Browse the repository at this point in the history
  8. Add an optionalCompressionName helper

    ... and eliminate incorrectly named requiredCompression variables
    by using it.
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    4d91fda View commit details
    Browse the repository at this point in the history
  9. Add and implement TryReusingOptions.PossibleManifestFormats

    ... so that we limit blob reuse to acceptable conversion formats,
    based on possible manifest formats.
    
    Implement it in CandidateMatchesTryReusingBlobOptions, covering all
    (in-tree) implementations.
    
    We still _try_ converting to schema2/schema1 (and upload the schema1
    empty layer to the destination registry) before succeeding with OCI.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    8aadec3 View commit details
    Browse the repository at this point in the history