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

Implement private.ImageSource / ImageDestination in blobcache #1592

Merged
merged 9 commits into from Jul 6, 2022

Commits on Jul 5, 2022

  1. Move blobCacheSource into a separate source file

    ... to make the files a bit shorter.
    
    Only moves the code without modification, should not
    change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jul 5, 2022
    Copy the full SHA
    3770bca View commit details
    Browse the repository at this point in the history
  2. Move blobCacheDestination into a separate source file

    ... to make the files a bit shorter.
    
    Only moves the code without modification, should not
    change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jul 5, 2022
    Copy the full SHA
    13c5e5b View commit details
    Browse the repository at this point in the history
  3. Fix a nil dereference on an error path

    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jul 5, 2022
    Copy the full SHA
    af676b8 View commit details
    Browse the repository at this point in the history
  4. Move interface conformance assertions to the test suite

    ... to make it quite clear they don't have runtime cost.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jul 5, 2022
    Copy the full SHA
    5a7d97f View commit details
    Browse the repository at this point in the history
  5. Name temporary files based on the final file name

    ... by cmoputing the relevant components from the final
    file name instead of copy&pasting the logic.  This will
    make it easier to consolidate the file name logic.
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jul 5, 2022
    Copy the full SHA
    73577bf View commit details
    Browse the repository at this point in the history
  6. Replace makeFilename with BlobCache.blobPath

    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jul 5, 2022
    Copy the full SHA
    951055f View commit details
    Browse the repository at this point in the history
  7. Simplify blob lookups

    HasBlob did the isConfig checking loop,
    only for every consumer to repeat that loop.
    
    Instead, farm that loop out into BlobCache.findBlob
    which directly returns the found path, so that callers
    can just use that blob instead of reconstructing HasBlob's
    work.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jul 5, 2022
    Copy the full SHA
    b3bf595 View commit details
    Browse the repository at this point in the history
  8. Forward all of private.ImageSource by blobCacheSource

    Also add support for reading blob chunks from a (complete,
    not partial) cached blob.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jul 5, 2022
    Copy the full SHA
    f7703dd View commit details
    Browse the repository at this point in the history
  9. Implement private.ImageDestination in blobCacheDestination

    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jul 5, 2022
    Copy the full SHA
    305e6df View commit details
    Browse the repository at this point in the history