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

Random storage-related cleanups #2287

Merged
merged 9 commits into from
Feb 8, 2024
Merged

Commits on Feb 8, 2024

  1. Move the definition of storageImageCloser closer to its methods

    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <[email protected]>
    mtrmac committed Feb 8, 2024
    Configuration menu
    Copy the full SHA
    f656155 View commit details
    Browse the repository at this point in the history
  2. Define storageImageMetadata for the JSON in Image.Metadata

    This way we:
    - have a single type, guaranteeing the source and destination don't
      get out of sync
    - separate the JSON-encoded data, without having to worry about
      Marshal/Unmarshal affecting unrelated fields of the source/destination.
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <[email protected]>
    mtrmac committed Feb 8, 2024
    Configuration menu
    Copy the full SHA
    4cc225e View commit details
    Browse the repository at this point in the history
  3. Remove an unnecessary pointer in map values

    First, it is unnecessary. Second, we will no longer
    need to worry about _allocating_ a variable to point to,
    or about pointing at a shared/volatile location.
    
    Signed-off-by: Miloslav Trmač <[email protected]>
    mtrmac committed Feb 8, 2024
    Configuration menu
    Copy the full SHA
    ee3bac4 View commit details
    Browse the repository at this point in the history
  4. Fix a comment

    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <[email protected]>
    mtrmac committed Feb 8, 2024
    Configuration menu
    Copy the full SHA
    9354d68 View commit details
    Browse the repository at this point in the history
  5. Simplify setting indexToStorageID

    Now that we don't need pointer values, assign directly.
    This means we no longer confusingly use lastLayer _both_
    for the parent layer and the currently-created layer.
    
    Signed-off-by: Miloslav Trmač <[email protected]>
    mtrmac committed Feb 8, 2024
    Configuration menu
    Copy the full SHA
    c5fd4cb View commit details
    Browse the repository at this point in the history
  6. Fail, instead of silently continuing, if a parent layer is not set yet

    That should never happen, so make sure we notice.
    
    Signed-off-by: Miloslav Trmač <[email protected]>
    mtrmac committed Feb 8, 2024
    Configuration menu
    Copy the full SHA
    a201809 View commit details
    Browse the repository at this point in the history
  7. Rename lastLayer to parentLayer

    ... now that it has that exclusive semantics.
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <[email protected]>
    mtrmac committed Feb 8, 2024
    Configuration menu
    Copy the full SHA
    31f6eeb View commit details
    Browse the repository at this point in the history
  8. Fix a comment documenting the locking rules

    We only care about concurrency within the scope of
    HasThreadSafePutBlob.
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <[email protected]>
    mtrmac committed Feb 8, 2024
    Configuration menu
    Copy the full SHA
    2029a3b View commit details
    Browse the repository at this point in the history
  9. Use digest.*.FromString where possible

    ... instead of doing the same thing manually.
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <[email protected]>
    mtrmac committed Feb 8, 2024
    Configuration menu
    Copy the full SHA
    e0e8045 View commit details
    Browse the repository at this point in the history