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

Reorganize storageImageDestination to prioritize the private …WithOptions methods #1468

Merged
merged 12 commits into from
Feb 15, 2022

Commits on Feb 15, 2022

  1. Move storageImageDestination.HasThreadSafePutBlob

    ... so that it isn't in the middle of the PutBlob implementation.
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    de78555 View commit details
    Browse the repository at this point in the history
  2. Split storageImageDestination.putBlobToPendingFile from storageImageD…

    …estination.PutBlob
    
    For now this is just an alias, but we will want to remove the public
    PutBlob implementation (in favor of using a generic compat wrapper).
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    6fd9d8a View commit details
    Browse the repository at this point in the history
  3. Use the more modern PutBlobWithOptions interface in putBlobToPendingFile

    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    d194394 View commit details
    Browse the repository at this point in the history
  4. Implement PutBlob in terms of PutBlobWithOptions

    ... allowing this to be replaced with a generic stub later.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    aaa4ae1 View commit details
    Browse the repository at this point in the history
  5. Move the PutBlobPartial implementation

    ... so that it isn't in the middle of TryReusingBlob.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    71445ec View commit details
    Browse the repository at this point in the history
  6. Rename tryReusingBlobWithSrcRef to tryReusingBlobAsPending

    It will be the primary internal "locked" implementation
    point, we don't want to implement TryReusingBlob as a stack
    of calls, each WithOneMember implementing only that OneMember.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    8ebf5b5 View commit details
    Browse the repository at this point in the history
  7. Use TryReusingBlobOptions in tryReusingBlobAsPending

    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    2bf11af View commit details
    Browse the repository at this point in the history
  8. Use TryReusingBlobOptions in tryReusingBlobLocked

    ... just like its caller tryReusingBlobAsPending
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    c5b1242 View commit details
    Browse the repository at this point in the history
  9. Move the TryReusingBlob implementation

    ... so that tryReusingBlobAsPending and
    tryReusingBlobLocked are consecutive.  We will merge the two
    (and TryReusingBlob will go away completley, eventually).
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    49876c6 View commit details
    Browse the repository at this point in the history
  10. Implement TryReusingBlob in terms of TryReusingBlobWithOptions

    When options.SrcRef and options.LayerIndex is not set,
    it amounts to the same thing.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    716833b View commit details
    Browse the repository at this point in the history
  11. Inline tryReusingBlobLocked into tryReusingBlobAsPending

    It's the only caller now, and the semantics of "Locked"
    vs. "AsPending" is hard to describe; just have one larger
    function that does all kinds of lookups.  If it turns out
    to be too large, we can split it to individual lookups,
    instead of having the SrcRef case treated as uniquely special.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    940a46c View commit details
    Browse the repository at this point in the history
  12. Pass PutBlobOptions and TryReusingOptions by address in storage

    ... to avoid copies.
    
    Keep the interfaces in terms of struct values, to make the
    value semantics explicit (and maybe to help the compiler a bit
    to show that the data doesn't need to be on a heap).
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    4da6615 View commit details
    Browse the repository at this point in the history