Skip to content

ggcr: crane.Export not handling whiteout files in single-layer images #1623

@bcrochet

Description

@bcrochet

Describe the bug

crane.Export has an optimization that skips the mutate.Extract call if there is only a single layer. However, it is possible to have an image that has opaque whiteouts in the only layer. While not usually a problem, there are other [1] libraries that expect there to be no hidden files, and therefore throw errors. When calling mutate.Extract, it works as expected.

To Reproduce

crane export quay.io/integreatly/3scale-bundle:v0.8.0 3scale.tar

This produces a tarball that still has .wh..wh..opq files.

Expected behavior

No .wh. files at all.

Additional context

I haven't figured this out yet, but I suspect that these .wh..wh..opq files are being generated by flattening a 2-layer image that is FROM scratch. Regardless, crane.Export should handle these. Currently it leaves them in place.

  • latest version
  • quay.io here, but observed with other registries

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions