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

Edit the manifest when pushing uncompressed data from c/storage #2273

Merged

Commits on Feb 7, 2024

  1. Reword the documentation a bit to suggest the edits are idempotent

    In particular, it is OK to use CompressionOperation: Decompress
    on already-decompressed layers.
    
    TestUpdatedMIMEType already ensures this works correctly.
    
    Signed-off-by: Miloslav Trmač <[email protected]>
    mtrmac committed Feb 7, 2024
    Configuration menu
    Copy the full SHA
    27813fb View commit details
    Browse the repository at this point in the history
  2. Rename bpCompressionStepData.operation to uploadedOperation

    Make it clearer that it is intended for manifest edits, and is
    not indicative of what we actually did.
    
    Should not change behavior.
    
    Signed-off-by: Miloslav Trmač <[email protected]>
    mtrmac committed Feb 7, 2024
    Configuration menu
    Copy the full SHA
    230e72f View commit details
    Browse the repository at this point in the history
  3. Add a new bpCompressionStepData.operation

    ... describing in more granularity what we are doing.
    
    Use it in recordValidatedDigestData, adding a case where
    we can record that a layer is uncompressed when we determine that
    while copying it without changes.
    
    Adding this separate .operation field will also allow us to set
    .uploadedOperation to Decompress in the bpcOpPreserveUncompressed
    case, without changing what recordValidatedDigestData does.
    
    Signed-off-by: Miloslav Trmač <[email protected]>
    mtrmac committed Feb 7, 2024
    Configuration menu
    Copy the full SHA
    61312cf View commit details
    Browse the repository at this point in the history
  4. Ensure uncompressed layers from c/storage are recorded as uncompresse…

    …d on upload
    
    When copying an uncompressed layer without modification, arrange
    types.BlobInfo.CompressionOperation to be set to types.Decompress,
    so that we edit the manifest to use an uncompressed MIME type
    (and not, e.g. a zstd:chunked MIME type which might not be representable
    in the destination at all).
    
    This is all still gated by the
    > 	if srcInfosUpdated || layerDigestsDiffer(srcInfos, destInfos) {
    condition in copyLayers, so we don't do these manifest updates
    frivolously.
    
    Signed-off-by: Miloslav Trmač <[email protected]>
    mtrmac committed Feb 7, 2024
    Configuration menu
    Copy the full SHA
    772f391 View commit details
    Browse the repository at this point in the history
  5. Ensure uncompressed layers from c/storage are recorded as uncompresse…

    …d on reuse
    
    Signed-off-by: Miloslav Trmač <[email protected]>
    mtrmac committed Feb 7, 2024
    Configuration menu
    Copy the full SHA
    278b324 View commit details
    Browse the repository at this point in the history