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 in all transports, improve transport helpers #1590

Merged
merged 13 commits into from Jul 5, 2022

Commits on Jul 5, 2022

  1. Move storageImageSource into a separate storage/storage_src.go

    storage_image.go is becoming too large, and we'd like to
    have easy access to both internal/imagesource/impl and
    internal/imagedestination/impl, which is easier with separate files.
    
    Only moves unchanged code, should not change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jul 5, 2022
    Copy the full SHA
    c4b384b View commit details
    Browse the repository at this point in the history
  2. Move storageImageDestination into a separate storage/storage_dest.go

    storage_image.go is becoming too large, and we'd like to
    have easy access to both internal/imagesource/impl and
    internal/imagedestination/impl, which is easier with separate files.
    
    Only moves unchanged code, should not change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jul 5, 2022
    Copy the full SHA
    4d73df3 View commit details
    Browse the repository at this point in the history
  3. Move openshiftImageSource into a separate openshift/openshift_src.go

    We'd like to have easy access to both internal/imagesource/impl and
    internal/imagedestination/impl, which is easier with separate files.
    
    Only moves unchanged code, should not change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jul 5, 2022
    Copy the full SHA
    e2fd56d View commit details
    Browse the repository at this point in the history
  4. Move openshiftImageDestination into a separate openshift/openshift_de…

    …st.go
    
    We'd like to have easy access to both internal/imagesource/impl and
    internal/imagedestination/impl, which is easier with separate files.
    
    Only moves unchanged code, should not change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jul 5, 2022
    Copy the full SHA
    9c2254e View commit details
    Browse the repository at this point in the history
  5. Beautify imagesource.wrapped

    Declare the data structure before using it, so that
    reading the file top-down is a bit easier.
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jul 5, 2022
    Copy the full SHA
    b7b48ae View commit details
    Browse the repository at this point in the history
  6. Add internal/imagesource/stubs.NoGetBlobAt

    ... so that we can have two lines instead of copy&pasted methods.
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jul 5, 2022
    Copy the full SHA
    301daca View commit details
    Browse the repository at this point in the history
  7. Add a transportName parameter to docker/internal/tarfile.NewSource

    This will allow using it in error messages in the future.
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jul 5, 2022
    Copy the full SHA
    6f22578 View commit details
    Browse the repository at this point in the history
  8. Implement private.ImageSource in non-forwarding transports

    This sets up the precedent that all transports should primarily implement
    the private interface; that will allow us to make future changes to the
    private interface easier, because we can just change the public interface
    wrappers in a single place instead of modifying transports - especially
    as more stubs are added soonish.
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jul 5, 2022
    Copy the full SHA
    592371c View commit details
    Browse the repository at this point in the history
  9. Implement private.ImageSource in oci/archive and openshift

    For forwarding, we use imagesource.FromPublic although we know
    that the transport implements the private interface, mostly for
    consistency.
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jul 5, 2022
    Copy the full SHA
    77b37a1 View commit details
    Browse the repository at this point in the history
  10. Add internal/imagesource/impl.Properties, use it to reduce boilerplate

    This matches internal/imagedestination/impl.Properties; it's not
    quite worth it for the single value, but the consistency is
    attractive.
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jul 5, 2022
    Copy the full SHA
    cbd13d3 View commit details
    Browse the repository at this point in the history
  11. Add stubs.ImplementsGetBlobAt

    This is not locally worth it, but it is a proof of the concept,
    and consistent with stubs.ImplementsPutBlobPartial.
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jul 5, 2022
    Copy the full SHA
    c00e0b7 View commit details
    Browse the repository at this point in the history
  12. Add impl.DoesNotAffectLayerInfosForCopy, use it to reduce boilerplate

    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jul 5, 2022
    Copy the full SHA
    654a6a6 View commit details
    Browse the repository at this point in the history
  13. Add internal/imagesource/impl.NoSignatures, use it to reduce boilerplate

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