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

Consolidate the common parts of simple writers #1383

Merged
merged 4 commits into from
Oct 14, 2022

Commits on Oct 13, 2022

  1. Introduce store.writeToLayerStore

    ... to avoid the repetition of getting, locking,
    and reloading, the store.
    
    Use it at least for the simplest writers.
    
    This could be more elegant with Go generics, returning
    (T, error), with T possibly being void = struct{}.
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Oct 13, 2022
    Configuration menu
    Copy the full SHA
    d4d7d2a View commit details
    Browse the repository at this point in the history
  2. Introduce store.writeToContainerStore

    ... to avoid the repetition of getting, locking,
    and reloading, the store.
    
    Use it at least for the simplest writers.
    
    This could be more elegant with Go generic returning
    (T, error), with T possibly being void = struct{}.
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Oct 13, 2022
    Configuration menu
    Copy the full SHA
    6f1cdf9 View commit details
    Browse the repository at this point in the history
  3. Introduce store.writeToImageStore

    ... to avoid the repetition of getting, locking,
    and reloading, the store.
    
    Use it at least for the simplest writers.
    
    This could be more elegant with Go generics, returning
    (T, error), with T possibly being void = struct{}.
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Oct 13, 2022
    Configuration menu
    Copy the full SHA
    f0ada37 View commit details
    Browse the repository at this point in the history
  4. Introduce store.writeToAllStores

    ... to avoid the repetition of getting, locking,
    and reloading, the stores.
    
    This also makes it less error-prone to use a consistent
    locking order (but note that other instances of manual
    locking still exist).
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Oct 13, 2022
    Configuration menu
    Copy the full SHA
    cae12e3 View commit details
    Browse the repository at this point in the history