Skip to content

mutate.Time should be lazy #1168

Open
Open
@imjasonh

Description

@imjasonh

pkg/v1/mutate.Time sets all timestamps in an image to the given time, typically to make the image more reproducible. For timestamps in layers, it calls layerTime which reads the layer contents and writes them to a buffered tar.Writer. This means that if the layer is huge, we may run out of memory buffering its contents.

We should consider making this a lazy transformation, so that layer mutations aren't made until they're read. We did a similar thing in pkg/v1/cache, where layer contents aren't cached until they're read via Compressed or Uncompressed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions